HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Does this leak?

02-14-2007, 01:03 AM#1
notor
Trigger:
entersSnow
Collapse Events
Unit - A unit enters snowRegion <gen>
Collapse Conditions
(Terrain type at (Position of (Triggering unit))) Equal to Lordaeron Summer - Rock
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
skillSnow[(Player number of (Triggering player))] Equal to True
Then - Actions
Collapse Else - Actions
Unit - Set (Triggering unit) movement speed to ((Default movement speed of (Triggering unit)) x 0.50)
Game - Display to (All players) the text: You are in snow, yo...
Wait 2.00 seconds
Trigger - Run (This trigger) (checking conditions)


Trigger:
leavesSnow
Collapse Events
Unit - A unit leaves snowRegion <gen>
Conditions
Collapse Actions
Unit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))
02-14-2007, 01:14 AM#2
Mezzer
Yes, it it leaks a location in the first trigger's conditions. Also, the first trigger will probably work wrong, but that's besides the point.
Oh, and setting a unit's movement speed like that is a really bad idea, since it will take into account any values that may have changed it from the original value, such as items or auras. It would be much more prudent to hit the unit with a slow ability every 2 seconds which lasts 2 seconds.
02-14-2007, 02:00 AM#3
Pyrogasm
This:
Trigger:
If skillSnow[(Player number of (Triggering player))] Equal to True
is wrong. It should be
Trigger:
If skillSnow[(Player number of (Owner of (Triggering Unit)))] Equal to True

Secondly, I would suggest using a modified "Slow Aura (Tornado)" to do your slowing down. Here's what the triggers would look like using that method:
Trigger:
entersSnow
Collapse Events
Unit - A unit enters snowRegion <gen>
Conditions
Collapse Actions
Set TempPoint = Position of (Triggering Unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Terrain type at (TempPoint) Equal to Lordaeron Summer - Rock
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
skillSnow[(Player number of (Triggering player))] Equal to False
Collapse Then - Actions
If (Level of (Your Slow Aura-based spell) for (Triggering unit) = 0) then do (Unit - Add (Your Slow Aura-based spell) to Triggering Unit), else do (Do Nothing)
Game - Display to (All players) the text: You are in snow, yo...
Else - Actions
Custom script: call RemoveLocation( udg_TempPoint )
Wait 2.00 seconds
Trigger - Run (This trigger) (checking conditions)
Trigger:
leavesSnow
Collapse Events
Unit - A unit leaves snowRegion <gen>
Conditions
Collapse Actions
Unit - Remove (Your Slow Aura-based spell) from (Triggering unit))
Also, when you do a "Run (This Trigger), checking conditions", it's not going to do anything. When you run it like that, nothing's going to happen because of the "Triggering Unit" stuff. This is what I'd suggest doing:
Trigger:
Collapse Events
Unit - A unit enters snowRegion <gen>
Conditions
Collapse Actions
Custom script: local location udg_TempPoint
Custom script: loop
Custom script: exitwhen GetUnitAbilityLevel(GetTriggerUnit(), 'Rawcode of your tornado ability inside these quotes') == 0
<The trigger actions here>
Custom script: endloop
Custom script: set udg_TempPoint = null
02-14-2007, 02:39 AM#4
notor
hmmm ok, how do i hit it with a slow spell? and what type of variable do you use to store player position?
02-14-2007, 02:53 AM#5
Pyrogasm
By "player position", do you mean the position of a unit owned by a player? I'd imagine so, since in JASS points are locations.

As for the "slowing" via spell (I'm telling you... tornado aura is much easier), base a spell off of "slow" (the sorceress spell), and do these actions:
Trigger:
Unit - Create one (Whatever Your Dummy Unit Is) for (Owner of (Triggering Unit)) at (TempPoint) <I'm assuming you fixed the memory leaks>
Unit - Add (Your New Slow Spell) to (Last created unit)
Unit - Order (Last created unit) to (Human Sorceress - Slow) (Triggering unit)
Unit - Add a 2.00 second Generic Expiration timer to (Last created unit)
02-14-2007, 03:11 AM#6
notor
aaah man this is confusing as all hell hahah brain melting