English Unit_ID

3 replies
Goto Page
To the start Previous 1 Next To the start
04.06.22 06:17:32 pm
Up
Luke81
User
Offline Off
Hello.

Is there a script changing Unit_ID during the game?

For example, after killing an animal I would like a new-spawned animal to get the ID of the killed one.

Is it possible?
05.06.22 09:40:23 am
Up
Assassin moder
User
Offline Off
Its not, units and any other entity will always get +1 of their Id per map
05.06.22 02:44:00 pm
Up
Luke81
User
Offline Off
OK, thanks for the answer.
23.06.22 10:12:51 am
Up
JasJack67
Super User
Offline Off
you can however assign a "variable" to each animal...and the one that gets killed(in the example you gave above) you can change the variable to match.

in the "definitions" of each animal you can add variables.

Then, the new spawned animal can be scripted to do what you intended it to do via the matching variable.

(they would be "global" variables, accessible in script from any other scripts.)

example:
unit2 $var1=1
unit3 $var2=2
unit4 $var3=3

unit2 with definition $var1=1 gets killed.
new unit4 spawns having $var3=3.

so you script ( maybe on:create{ ): $var3 = 1

now what ever you had scripted for unit2 (IF $var1=1) to do, you can this script instead (IF $var3=1) do this ELSEIF $var1=1) do this . .checking for the newly spawned animal/s first.
edited 5×, last 23.06.22 10:44:24 am
The Survivalist_12-24-19 is now available. DOWNLOAD HERE >The Survivalist 12-24-19 | Performance-In options keep Water Detail off
To the start Previous 1 Next To the start