HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Using JASS bits in GUI

08-24-2006, 12:58 AM#1
darkwulfv
Ok, I have WEU, so I thought I'd implement some of the Advanced things that came with it. One I noticed was Advanced-Jass Code. So I thought for a second. I remebered hearing somewhere that triggering unit is lost after waits, which I have. So I messed around a bit, and I got this as my trigger.
Trigger:
Flaming Egg
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Flaming Egg
Collapse Actions
Custom script: local unit udg_dummyunit
Custom script: local unit u = GetTriggerUnit()
Unit - Create 1 Caster Dummy for (Owner of (u)) at (Position of (u)) facing Default building facing (270.0) degrees
Set dummyunit = (Last created unit)
Unit - Set level of Flaming Egg [Dummy] for dummyunit to (Level of Flaming Egg for (u))
Unit - Order dummyunit to Neutral - Parasite (Target unit of ability being cast)
Advanced - Wait for event: (Target unit of ability being cast) Dies. Check every 1.00 seconds.
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Flaming Egg for (u)) Equal to 1
Collapse Then - Actions
Unit - Create 1 Phoenix [1] for (Owner of (u)) at (Position of (Target unit of ability being cast)) facing Default building facing (270.0) degrees
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Flaming Egg for (u)) Equal to 2
Collapse Then - Actions
Unit - Create 1 Phoenix [2] for (Owner of (u)) at (Position of (Target unit of ability being cast)) facing Default building facing (270.0) degrees
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Flaming Egg for (u)) Equal to 3
Collapse Then - Actions
Unit - Create 1 Phoenix [3] for (Owner of (u)) at (Position of (Target unit of ability being cast)) facing Default building facing (270.0) degrees
Collapse Else - Actions
Do nothing

Seeing as how GUI is turned into JASS anyways, I thought that by using JASS code (u) in place of Triggering Unit would work. So, I guess my question is, not will the trigger itself work, but will using "u" in place of Triggering Unit work?
(I know, I leak some stuff. I'll get around to it soon)
08-24-2006, 12:17 PM#2
martix
Erm, no not actually, its just the opposite - triggering unit is the only event response that stays after waits.
08-24-2006, 12:19 PM#3
iNfraNe
the only? noway. Alot stay. Just not things like "GetSpellAbilityUnit()"
08-24-2006, 12:22 PM#4
Wyvernoid
Really? My test result is that none of them stays. I had to use a local.
Logically... things from blizzard.j will not stay for sure, but I don't know if things from common.j stay.
08-24-2006, 12:24 PM#5
iNfraNe
GetTriggeringTrigger stays, GetTriggerPlayer stays, GetDyingUnit, GetEnteringUnit etc etc. Those all stay (at least.. ithink so)
08-24-2006, 12:34 PM#6
martix
Ugh, dunno, Daelin said so...
08-24-2006, 12:40 PM#7
Vexorian
I actually think that the only event responses that don't survive waits are the spell ones.
08-24-2006, 12:43 PM#8
darkwulfv
Ok thanks alot guys, I don't think my trigger is going to work right, as there are alot of local variable refrences in different functions, so I'd have to redeclare the variable too many times.
08-25-2006, 04:03 AM#9
PipeDream
What you've written won't work unless you use an editor hack to remove the udg_ prefix. It still won't work right though, there are a couple different problems with trying to lexically scope multiple variables in JASS that pretty much make it not worth the hassle.

Take the one day or so it takes to get the hang of JASS. Your map will thank you.
08-25-2006, 05:43 AM#10
darkwulfv
I sorta understand JASS, its the tons of If Thens Elses that seriously screw me up.
I found an easier way to so this anyways. Thanks guys.