3 steps needed
- create a global variable for each POI
- add a condition checking that variable onto each POI
-3: add a script to the map marker that sets the cooldown variable
I'll use the excellent Batten's Wrecks mod as an example, whilst it doesn't really need a cooldown, I'll post a complete patch as an example.
1. adding a global
The easiest bit, you'll need a new global variable for each POI that has a cooldown; this will actually store the cooldown and when it runs out. You can call it what you like, I recommend you stick with the naming convention of "PCM_Cooldown_XXXX" where XXXX refers to the specific name of the POI.
Here's how it may look for Batten's wrecks

2. add a condition checking against that variable
For each POI, you need to add a condition checking if the cooldown is still active or not. this is done in the Worldspace object, under the BGSPlanetContentManagerContentProperties_Component conditions. The condition is - is the Cooldown global for this particular POI less than the built-in global GameDaysPassed?
It looks like this:

3: calling a script
The addon is triggered when the player enters the map marker of the POI and it goes from undiscovered to discovered. To support this, you need to add a script to the map marker object with the following properties:
ScriptName: MapMarkerVariableCooldownScript
first property:
propertyName:cooldownDays
Type:object
FormID: POICooldownDelayInDays [GLOB:07000803]
second property:
propertyName: LocationCooldown
Type:object
FormID: < your cooldown global >
here's how it might look in xEdit:

To check its all in correctly, especially if adding cooldown to lots of POIs at once, I like to go back and check the references for each Global variable - there should be exactly 2, one for the script on the map marker, and one for the condition on the worldspace.
advanced
The expected behaviour is for a POI to only have its cooldown set when the player enters the map marker and it goes to discovered. If you wanted another condition, eg when the POI is actually placed, or when the POI is cleared, you'll need to write a separate script that expects these conditions and sets the cooldown value accordingly, though that is all possible.
The cooldowns all reset automatically when entering the Unity; I'm looking at how I can have a user friendly way of resetting/viewing the cooldowns and if I get something up, then POIs from mods will need to be added to those lists as well.
how to check what's on cooldown
No neat way at the moment (I'm hoping to have something in the next version) - if you're on PC you can use the console command help PCM_cooldown which will list all of the current values of the cooldown. You'll also need to know the current in-game day which is either on the status screen or can be shown with help gamedayspassed.
0 comments