| 05-03-2003, 11:50 PM | #1 |
I have a spell which knocks everyone in the area back about 500. In one of my other threads someone suggested that I do this lets say 20 or 50 at a time, unfortunately I dont know how to do this. In multiplayer, what would I use to make a unit move 50 back 10 times? |
| 05-04-2003, 12:30 AM | #2 |
I'm not sure but there was mention about using a loop. Even: Blah blah when Knock back is triggered Conditions: Blah blah Actions: For integer A from 1 to 10 do move (attacked unit) instantly from (attacked unit's position) towards whatever direction with offset (50) I'm not sure about the details and exact triggerings or coding... |
| 05-04-2003, 02:15 AM | #3 |
yeah, this is what I tried, it just did it all at once |
| 05-04-2003, 04:39 AM | #4 |
Oh yeah that will happen because the loop does things very quickly. Maybe make the knock back only by 200? Because 500 seems a very long distance for a knock back. Then maybe moving such a shorter distance instantly doesn't look so awkward. I was also thinking, maybe set it such that when the knock back is supposed to kick in, set the movement speed of that victim to be very fast and move him the distance back. When he has reached the max knock back distance restore the previous speed of the unit. This "adds" another feature of knock back in the sense that the victim of the knock back is forced to face away from you. Not sure if this would work though. |
| 05-04-2003, 05:35 AM | #5 |
you need a wait in there other wise everything happens almost at the same time most people who use the "knockback" probably did it in jass so the loop could easily have more than 1 action. You cannot tell the loop to run a trigger because the trigger that was executed will not wait for a return value before continueing, so the loop will still run without any waits, however: you can set do it like this: Actions: move the unit with the offset wait X.XX set (Integer varible) = arthmatic(value + 1) If (integer comparison(integer varible) = *loop max*) then do nothing, else Trigger execute (this trigger) |
| 05-04-2003, 05:51 AM | #6 |
Would running trigger in a For integer... using have the same effect as a loop in JASS? |
| 05-04-2003, 03:20 PM | #7 |
it would loop yes, but in JASS you can put multiple actions into the loop adding a wait to the loop, which you cannot do with the GUI triggers |
| 05-04-2003, 11:36 PM | #8 |
What I meant was this: Events: Blah Conditions: BLah Actions: For integer A from 0 to 9 Run TriggerX checking conditions -TriggerX- Events: None Conditions: None Actions: - blah1 - blah2 - blah3 Will this have the same effect as a For loop in JASS that loops 10 times? |
| 05-05-2003, 12:33 AM | #9 |
if there is a wait in the trigger that gets called by the loop... no. other wise yes |
| 05-05-2003, 12:52 AM | #10 |
If there's a wait in the trigger it will suffer from the wait bug? If so, why? The trigger will have only one wait action... Sorry for being persistent but I'm learning from this. Thank you. |
| 05-05-2003, 01:12 AM | #11 |
not the wait bug, but you are running a triggerB, triggerA doesnt wait for triggerB to finish before continuing on the loop, so by the time triggerB's wait is over, triggerA is finished and triggerB will have been performed as it was the first way with no "waits" that will take place.. hard to explain.. but try it and you will see it doesnt work |
| 05-05-2003, 08:16 AM | #12 |
Why not daisy-chain triggers together to make a makeshift loop since you only want to loop a relatively small number of times? Just run an initial trigger that catches the event and fire another trigger ignoring conditions. So move him back a little in one trig, wait, run the next trig ignoring conditions, and then do that ten times. This way, you could vary the speed of the knockback so that the unit moves faster initially and then slows down at the end. EDIT: Scratch that ignoring conditions part if you want. |
| 05-05-2003, 09:54 AM | #13 |
1 trigger, with a 2 integer variables, do the knockback based on a inital integer variable. then set that value = to value + whatever... set a counter varible = to value + 1, wait x.xx. If counter < loopmax, then run this trigger, else do nothing.... |
| 05-05-2003, 10:38 AM | #14 |
An update: Dakan's trigger is for the most part working, it knows them back a little at a time, what is the smalles wait I can put into GUI? As it is right now, most monsters can almost keep up with the wind, so it kind of holsd them at bay for a while, should I make distance a little longer (its at 50) or try to make time shorter? (at .03) |
| 05-05-2003, 11:44 AM | #15 |
i remember reading somewhere that the minimum wait was 0.25... so you might wanna increase the distance moved per loop |
