Hi guys, here is the problem, any help is appreciated
I am using scenario editor only!
I will use examples to guide you through.
1- I place 10 Teutonic Knights on the map
2- I change their speed through trigger ‘‘Change Object speed’’ to a new value.
3- Speed changes effectively, so far so good.
4- I make the Teutonic Knights trainable through the barracks and add more attributes(change attack, change armor etc)
5- I put the Trigger on loop, so the attributes take effect on the units I am going to train from the barracks that they are not yet at the field/map.
6- The Teutonic knight spawns with the new attributes at effect BUT the speed keeps climbing up to maximum speed, possibly affected by the loop.
If I remove the loop the spawned unit gets no modified attributes at all.
How am I going to alter the movement speed of units that are not yet trained?
I think I am missing something obvious here, any ideas?
To change the speed of all units of a certain type, you need to use modify attribute. Using “Change object speed” only applies to units currently on the map, and it always adds speed, you can’t set it. Because Modify attribute doesn’t support decimal values, you would need to set the speed to 10x (or 100x) what you want it to be, and then divide it by 10 (or by 100) to set it to the actual value you want.
2 Likes
As Conqueror already explained, the “change object [stat]” triggers create some kind of duplicated version of the unit, like making custom heroes out of regular units.
XS scripts “xsEffectAmount” and “Modify object attribute” triggers will change the base unit, in the core gameplay, to be spawned and already on the map.
Using XS scripting you can directly set float values, but as Conqueror said, you can use the divide method to set float values in triggers.
1 Like
I will try the modify attribute since I don’t use scripting, I will come back with the results,
Thank you so much for the fast replies guys!
EDIT: It WORKED! Thank you so much guys, you are the best!
1 Like
Scripting is a totally different world indeed, but it’s still good to know it exists.