The perfect one step solution for creating Ice/Sliding Mazes in both Reign of Chaos and The Frozen Throne. It is the only decent system around and it even works in RoC, is lagfree, perfectly optimized, fast and reliable. The included TerrainKill feature frees you from the tedious task of creating a thousand kill-regions.
Basically, it's your sliding system, changed to Speed[GetConvertedPlayerId(GetOwningPlayer(u))] for the player unit.
Then all the events are added by trigger in the initialization...
Then...
Booster
Events
Conditions
(GetUnitFlyHeight(GetTriggerUnit())<1)
((Triggering unit) is in H) Equal to (==) True
Actions
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
Wait 0.10 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
Wait 0.10 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
Wait 0.10 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
Wait 1.00 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Booster
Events
Conditions
(GetUnitFlyHeight(GetTriggerUnit())<1)
((Triggering unit) is in H) Equal to (==) True
Actions
For Each Integer A 1 to 3, do Actions
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
Wait 0.10 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
Wait 1.00 seconds
For Each Integer A 1 to 7, do Actions
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Wait 0.05 seconds
Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
it makes it look neater anyway.... and i think it gives you less time to load this trigger.......
Beautiful. No leaks. Elegant solution. You rewrote my system to use arrays :)
This was my original plan actually. (Except I will also make the sliding units an array to avoid the calls to GetPlayerId(GetOwningPlayer(u)), and be able to use udg_H with udg_Speed - much faster.)
One small note: Speed[GetConvertedPlayerId(GetOwningPlayer(u))]
should be udg_Speed[GetPlayerId(GetOwningPlayer(u))+1]
to get rid of that ugly BJ function. (GetConvertedPlayerId = Player number of = BJ function)
And samtre's solution is off by one:
For Each Integer A 1 to 3, do Actions
should be
For Each Integer A 1 to 4, do Actions
and
For Each Integer A 1 to 7, do Actions
should be
For Each Integer A 1 to 8, do Actions
--3ICE
EDIT: Never mind the last part. I found the reason: The waits are different: 0.10 vs 1.00
Last edited by 3ICE on Sat Sep 05, 2009 8:50 am, edited 4 times in total.
Reason:nvm last part
Jesus! That puts the first line of my other post out of the way...
Are you happy at the fact that I redirected someone to your website from The Hive Workshop who was looking for a sliding system? [here]
EDIT: I used the GUI version of the player number because I get my JASS based off converted ones... (That's if I can't find the function name in JNGP search thingy).
manstie wrote:Are you happy at the fact that I redirected someone to your website from The Hive Workshop who was looking for a sliding system? [here] :roll:
He says it doesn't help. I did not post because I don't want to get involved. EDIT: Oh my god I just noticed my blog links are all totally broken! Nobody should ever have access to the postID and yet the default link to my sliding system iswas "/?p=253" instead of "/3ice-sliding-system-for-roc-v3/". Fixing... EDIT2: Looks like the settings were reset. But surely not by me... EDIT3: Fixed.
manstie wrote:EDIT: I used the GUI version of the player number because I get my JASS based off converted ones... (That's if I can't find the function name in JNGP search thingy).
Okay. But manually adding +1 to GetPlayerId() is faster than calling a function to do it for you. Check the source of GetConvertedPlayerId() in Jasscraft or JNGP and you'll see. (Hopefully :P)