HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

assining local in GUI

10-02-2006, 01:11 PM#1
Hemlock
I tried assigning a local variable in GUI with the following

Trigger:
Activation
Collapse Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Collapse Actions
Trigger - Run Ability settings <gen> (ignoring conditions)
-------- Setting up the variables --------
Custom script: local unit udg_SE_Castunit
Set SE_Castunit = Warden 0001 <gen>
-------- Action --------

but it gives me an error, I got it from a tutorial on this site if one wants to know.
10-02-2006, 01:19 PM#2
Vexorian
local must be the first line in the function, you are doing it after a call to TriggerExecute
10-02-2006, 02:04 PM#3
Hemlock
thnx, but now I tried using it in a different trigger, with refering to the local first again, but that doesn't seem to work.

Trigger:
test
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
Custom script: local unit udg_SE_Castunit
Unit - Move SE_Castunit instantly to ((Position of SE_Castunit) offset by 10.00 towards (Facing of SE_Castunit) degrees), facing Default building facing degrees
10-02-2006, 02:09 PM#4
Vexorian
you are not giving that local any value
10-02-2006, 02:13 PM#5
Hemlock
how would I value the casting unit from the other trigger?
10-02-2006, 02:54 PM#6
oNdizZ
thats what you use globals for :p
you could always attach the unit to gamecache and take it from there
10-02-2006, 02:57 PM#7
The)TideHunter(
Set like:

Trigger:
Custom script: local unit udg_SE_Castunit
set udg_SE_CastUnit = MyUnit

Or easier

Trigger:
Custom script: local unit udg_SE_Castunit = MyUnit