As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Modding Discussion Thread

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.
Reply

Should be possible in 1.4.4.
...looks like I forgot to include the scripts.txt file in the update.

.txt   Scripts.TXT (Size: 20.6 KB / Downloads: 16)

Use GetTerrain with the position of the unit which you can get from Getstat.
Reply

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)?
Reply

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?
Reply

(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.
Reply

(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)?

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.

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?
Reply

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?
Reply

Code:
Overland
      LTOCean = 0;
      LTShore = 1;
      LTLake = 2;
      LTRiverMouth = 3;
      LTGrassland = 4;
      LTHill = 5;
      LTMountain = 6;
      LTVolcano = 7;
      LTDesert = 8;
      LTSwamp = 9;
      LTTundra = 10;
      LTRiver = 11;
      LTForest = 12;
      LTChaosNode = 13;
      LTNatureNode = 14;
      LTSorceryNode = 15;
      LTRiverStart = 16;
Ores
      OreWildgame = 1;
      OreNightshade = 2;
      OreAdamantium = 3;
      OreMithril = 4;
      OreOrihalcon = 5;
      OreIron = 6;
      OreCoal = 7;
      OreSilver = 8;
      OreGold = 9;
      OreGems = 10;
      OreCrysx = 11;
      OreQuork = 12;
Combat
CTGrass = 1;
      CTSea = 2;
      CTForest = 3;
      CTIce = 4;    
      CTPine = 5;
      CTrock = 6;
      CTRock2 = 7;
      CTMountain = 8;
      CTDesert = 9;
      CTSwamp = 10;
      CTCenter = 11;
      CTFloating = 12;
Reply

Thank you.
Reply

Is it possible to get unit's coordinate or using getterrain without coordinate?

Also how to use alive(u)? I try to use it on crack call script but no matter how I try it return with error.
Reply



Forum Jump: