Is it possible to detect the environment of the tile a unit is on during combat using scripts? I plan to give some waterwalking units extra movement allowance on water tiles.
Modding Discussion Thread
|
Should be possible in 1.4.4.
...looks like I forgot to include the scripts.txt file in the update. Scripts.TXT (Size: 20.6 KB / Downloads: 16) Use GetTerrain with the position of the unit which you can get from Getstat.
May I suggest that next version to include ability to remove ability line so that modder could replace original name text with new one (such as rename "Misfortune" to "Jinx", etc)?
I want to use script to give enchantment to specific unit when at water tile. How to use getterrain or anything in precombat script to detect if combat is fought on water tile? And what value I need to looking for?
(July 17th, 2022, 11:24)Suppanut Wrote: May I suggest that next version to include ability to remove ability line so that modder could replace original name text with new one (such as rename "Misfortune" to "Jinx", etc)? In theory you already can by making a new ID for the enchantment but it comes at the cost of having to re-implement the effect in unitcalc.cas. Quote:I want to use script to give enchantment to specific unit when at water tile. How to use getterrain or anything in precombat script to detect if combat is fought on water tile? And what value I need to looking for? I think that's not possible yet. I'll need to add some functions to get the location of the current combat. (July 21st, 2022, 17:21)Seravy Wrote:(July 17th, 2022, 11:24)Suppanut Wrote: May I suggest that next version to include ability to remove ability line so that modder could replace original name text with new one (such as rename "Misfortune" to "Jinx", etc)? Then I will ask for next best thing, as ocean/sea combat map has only water combat tile, how to detect water combat tile in combat? And what is example of how to use getterrain/setterrain?
What are suppose to be terrain value that should be use or return from get/setterrain? What is code for each type of terrain at all?
Code: Overland |