Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New scenario: Moonlit Night #77909

Merged
merged 4 commits into from
Nov 21, 2024
Merged

Conversation

ampersand55
Copy link
Contributor

@ampersand55 ampersand55 commented Nov 16, 2024

Summary

Content "New scenario: Moonlit Night"

Purpose of change

A new scenario that offers a new type of challenge: to navigate through a group of zombies on a moonlit night where you have the benefit of vision but the monsters don't.

Also features a game mechanic maybe not all new players know about and teaches the importance of vision and aggro.

Describe the solution

  • Set start date to the beginning of a full moon phase.
  • Add SCENARIO_SPECIFIC EOC to ensure clear weather and benefit of moonlight.

Not sure why my clear weather EOC isn't working, tried to follow the procedure outlined by Ramza13 in #63444, which to my understanding was to set conditions with weather( s ) to where only clear sky is possible and then call next_weather.

EDIT; Weather EOC fixed by creating a custom weather.

  • Fix clear weather EOC

Describe alternatives you've considered

Testing

Works except for the clear weather EOC.

Additional context

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Scenarios New Scenarios, balancing, bugs with scenarios EOC: Effects On Condition Anything concerning Effects On Condition json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Nov 16, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 16, 2024
@github-actions github-actions bot removed json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 17, 2024
@ampersand55
Copy link
Contributor Author

Ok this was rather annoying to debug as I had to restart until I got specific weather conditions, but I eventually got it working by creating a weather that's guaranteed to be free of fog or rain.

It seems like you can't set { "math": [ "weather('humidity')", "=", "0" ] }, even though it says you can in NPC.md. Or at least I couldn't make it to work.

weather(s) Return or set a weather aspect

Also the issue #63444 can probably be closed as you can copy my methods for creating scenarios with specific weather conditions.

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Nov 17, 2024
@ampersand55 ampersand55 marked this pull request as ready for review November 17, 2024 08:20
@IdleSol
Copy link
Contributor

IdleSol commented Nov 17, 2024

It seems like you can't set { "math": [ "weather('humidity')", "=", "0" ] }, even though it says you can in NPC.md. Or at least I couldn't make it to work.

It works, it's just that next_weather resets right away

Ok this was rather annoying to debug as I had to restart until I got specific weather conditions

Bionics weather reader to your rescue

UPD. I've been trying to find a solution. But apparently you've found one before. This option is not ready. Once the effect is complete, the weather remains. But you can make sure that the pressure and humidity changes.

[
  {
    "type": "effect_type",
    "id": "TEST_clear_weather",
    "name": ["TEST_clear_weather"],
    "max_intensity": 1,
    "rating": "good",
    "apply_message": "TEST_clear_weather        start",
    "remove_message": "TEST_clear_weather        stop"
  },


  {
    "type": "effect_on_condition",
    "id": "EOC_scenario_clear_weather",
    "eoc_type": "SCENARIO_SPECIFIC",
    "effect": [
      { "u_message": "EOC_scenario_clear_weather        START" },
      { "u_add_effect": "TEST_clear_weather", "duration": 60 },
      { "run_eocs": "EOC_clear_1_min", "time_in_future": "5 seconds" }
    ]
  },


  {
    "type": "effect_on_condition",
    "id": "EOC_clear_1_min",
    "condition": { "u_has_effect": "TEST_clear_weather" },
    "effect": [
      { "u_message": "EOC_clear_1_min         START" },
      { "math": [ "weather('humidity')", "=", "0" ] },
      { "math": [ "weather('pressure')", "=", "1050" ] }
    ]
  },


  {
    "type": "scenario",
    "id": "a_moonlit_night_start",
    "name": "A Moonlight Night",
    "points": 0,
    "description": "You've been holed up in your basement ever since the Cataclysm happened a little over a week ago, but now you've run out of food and have been forced to go on a supply run on this fateful moonlit night.  You see zombies all around you, but thankfully, most of them can't seem to see as well in moonlight as you do.",
    "start_name": "In the Middle of Town",
    "start_of_cataclysm": { "hour": 0, "day": 61, "season": "spring", "year": 1 },
    "start_of_game": { "hour": 23, "day": 72, "season": "spring", "year": 1 },
    "allowed_locs": [ "sloc_town_in_the_open" ],
    "eoc": [ "EOC_scenario_clear_weather" ],
    "requirement": "achievement_survive_one_day",
    "flags": [ "CITY_START", "LONE_START", "SUR_START" ],
    "surround_groups": [ [ "GROUP_BLACK_ROAD", 70.0 ] ]
  },
  {
    "type": "start_location",
    "id": "sloc_town_in_the_open",
    "name": "Town, in the open",
    "terrain": [
      { "om_terrain": "road_nesw_manhole", "om_terrain_match_type": "PREFIX" },
      { "om_terrain": "playground", "om_terrain_match_type": "TYPE" },
      { "om_terrain": "park", "om_terrain_match_type": "TYPE" }
    ],
    "flags": [ "ALLOW_OUTSIDE" ]
  }
]

@IdleSol
Copy link
Contributor

IdleSol commented Nov 17, 2024

123

@ampersand55
Copy link
Contributor Author

Bionics weather reader to your rescue

Reading the weather wasn't an issue, it was restarting until you got game where it wasn't foggy.

I think humidity and other weather stuff isn't global, but defined for each overmap tile, so changing it gets quite messy. But let me know if you find a good solution.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 17, 2024
@IdleSol
Copy link
Contributor

IdleSol commented Nov 17, 2024

I haven't dealt with either weather or EoC, so I'm not sure if I can help. But try calling EOC while there is a condition. For example, while the effect is hanging, call EoC.

And from what I understand, setting the pressure and humidity doesn't change the weather. Fog remains fog. (Or maybe I've complicated things and/or done something wrong).

@IdleSol
Copy link
Contributor

IdleSol commented Nov 17, 2024

If I understand you correctly, you need certain weather for testing?

"base_wind_season_variation": 50

--      "base_wind_season_variation": 50
++      "base_wind_season_variation": 50,
++      "weather_white_list": [ "clear", "cloudy" ],

or

      "weather_black_list": [ "sunny" ]

| `weather_black_list` | Ids of weather types not allowed in this region. |
| `weather_white_list` | Ids of the only weather types allowed in this region. |

@ampersand55
Copy link
Contributor Author

Correct me if I'm wrong, but I think regional settings is only for weathers that occur naturally. As "Moonli"t is a weather that's EOC triggered I don't think it's needed.

@IdleSol
Copy link
Contributor

IdleSol commented Nov 17, 2024

It's not for the mod. It's for testing. As I understand it, you've been loading a lot of times to get fog at game start? Ideally, if you limit the weather to fog only, it would reduce the number of reloads.

Reading the weather wasn't an issue, it was restarting until you got game where it wasn't foggy.

It only now reached me that you were on the contrary trying to get rid of the fog.

@ampersand55
Copy link
Contributor Author

Ah, I misunderstood you. That's a good tip for next time!

@Night-Pryanik Night-Pryanik merged commit ca1d575 into CleverRaven:master Nov 21, 2024
27 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Scenarios New Scenarios, balancing, bugs with scenarios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants