The script runs after the combat mode starts but before it is determined whether it will be normal or automatic combat, so terrain is not yet generated. So it's not possible to change it from Entercombat.Cas unfortunately.
Unitcalc is a good workaround, it is the last thing being run before the user is given control of the battle.
Seravy, why you don't make it possible to mod resource on any terrain? I think about wild game in tundra which I request several times but it still not possible to mod this yet.
(July 3rd, 2023, 09:30)Suppanut Wrote: ... I think about wild game in tundra ...
I'm not sure how you intended to implement it, but moose in the tundra, as you can see in the image below, must be possible somehow.
There I didn't understand how to use the SpellTargetPlane variable in OLSpell.CAS to set the plane...
Edit: Now it works, with SpellTargetPlane=1 or 2.
There is no MaxOres in MODDING.INI to add custom ores though, but that might require more than that...
(July 3rd, 2023, 09:30)Suppanut Wrote: ... I think about wild game in tundra ...
I'm not sure how you intended to implement it, but moose in the tundra, as you can see in the image below, must be possible somehow.
There I didn't understand how to use the SpellTargetPlane variable in OLSpell.CAS to set the plane...
Edit: Now it works, with SpellTargetPlane=1 or 2.
There is no MaxOres in MODDING.INI to add custom ores though, but that might require more than that...
I want random spawning wild game on tundra. How you are doing that?
(July 3rd, 2023, 09:30)Suppanut Wrote: Seravy, why you don't make it possible to mod resource on any terrain? I think about wild game in tundra which I request several times but it still not possible to mod this yet.
Two reasons :
1. It's not supposed to be a resource producing tile similarly to the sea. I doubt it'll cause AI problems to have food on the north pole but it's not something I'm adding as a last minute change.
2. It's not an "ore tile" meaning the ore system, if it rolls ore for the tile sees it, will do nothing. Simply allowing Wild Game on Tundra would result in a 100% chance of every ore on tundra being Wild Game. This needs to be special cased like Forest, Swamp or Grasslands which solve this by having a smaller chance of their appropriate resource and a larger chance to be converted into a different tile that allows more outcomes. Without that, you get way too many Wild Game tiles, this is why half (or 3/4, not sure) of Forest ore tiles are converted to Swamp or Hills.
However it should be possible to do it by generating the wild game from a script that runs at the start of the game. The AI scripts probably run before terrain exists so the best way would be to use the overland end turn script and generate the tiles when it's player 0's first turn ending.
(July 3rd, 2023, 19:52)Seravy Wrote: However it should be possible to do it by generating the wild game from a script that runs at the start of the game. The AI scripts probably run before terrain exists so the best way would be to use the overland end turn script and generate the tiles when it's player 0's first turn ending.
Why don't you just create turn "0" (first end turn before game actual start) for any script that happened before start game that could not trigger on AI script?