Forum

> > Stranded II > Scripts > Unit_ID
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Unit_ID

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Unit_ID

Luke81
User Off Offline

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

alt Re: Unit_ID

JasJack67
Super User Off Offline

Zitieren
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.
5× editiert, zuletzt 23.06.22 10:44:24
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht