Serenity09 Moderator
| Subject: Trigger that works some of the time Wed Jan 26, 2011 10:15 pm | |
| Variables:
integer A is defined in the loop, its the index which goes from 0 - 7
Left is a boolean that is true when the left arrow key is pressed and false when it is released. checking to see if right was pressed at the time made it glitchy (so both can be pressed, but only the first pressed will do anything). its an array where left[0] is for red, left[1] blue etc
Right is the same deal
Angle is an array of reals. Angle[0] is for red etc. Angle starts out as 90 for each element and is updated by this function. Angle works fine. it might look weird, but its made to prevent you from turning most of the way left or most of the way right. the very last part of ifs is to slowly reset your angle to being forward.
temp point is what its always been
heroes[0] is red's demonhunter etc
don't worry about timepressed
- Code:
-
Turn Events Time - Every 0.05 seconds of game time Conditions Actions Do Multiple ActionsFor each (Integer A) from 0 to 7, do (Actions) Loop - Actions Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Left[(Integer A)] Equal to (==) True Then - Actions Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Angle[(Integer A)] Less than (<) 155.00 Then - Actions Set TimePressed[(Integer A)] = (TimePressed[(Integer A)] + 0.05) Set Angle[(Integer A)] = (Angle[(Integer A)] + (0.50 + ((TimePressed[(Integer A)] + 1.00) x 3.00))) Set TempPoint3 = (Position of Heroes[(Integer A)]) Unit - Move Heroes[(Integer A)] instantly to TempPoint3, facing Angle[(Integer A)] degrees Custom script: call RemoveLocation(udg_TempPoint3) Else - Actions Set Angle[(Integer A)] = 160.00 Else - Actions Do Multiple ActionsFor each (Integer A) from 0 to 7, do (Actions) Loop - Actions Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Right[(Integer A)] Equal to (==) True Then - Actions Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Angle[(Integer A)] Greater than (>) 25.00 Then - Actions Set TimePressed[(Integer A)] = (TimePressed[(Integer A)] + 0.05) Set Angle[(Integer A)] = (Angle[(Integer A)] - (0.50 + ((1.00 + TimePressed[(Integer A)]) x 3.00))) Set TempPoint3 = (Position of Heroes[(Integer A)]) Unit - Move Heroes[(Integer A)] instantly to TempPoint3, facing Angle[(Integer A)] degrees Custom script: call RemoveLocation(udg_TempPoint3) Else - Actions Set Angle[(Integer A)] = 20.00 Else - Actions Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Angle[(Integer A)] Greater than (>) 100.00 Then - Actions Set Angle[(Integer A)] = (Angle[(Integer A)] - 0.50) Set TempPoint3 = (Position of Heroes[(Integer A)]) Unit - Move Heroes[(Integer A)] instantly to TempPoint3, facing Angle[(Integer A)] degrees Custom script: call RemoveLocation(udg_TempPoint3) Else - Actions Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Angle[(Integer A)] Less than (<) 80.00 Then - Actions Set Angle[(Integer A)] = (Angle[(Integer A)] + 0.50) Set TempPoint3 = (Position of Heroes[(Integer A)]) Unit - Move Heroes[(Integer A)] instantly to TempPoint3, facing Angle[(Integer A)] degrees Custom script: call RemoveLocation(udg_TempPoint3) Else - Actions Do nothing
- Code:
-
DirectionPressLeft Blue Events Player - Player 2 (Blue) Presses the Left Arrow key Conditions Actions Set Left[1] = True - Code:
-
DirectionReleaseLeft Blue Events Player - Player 2 (Blue) Releases the Left Arrow key Conditions Actions Set Left[1] = False Set TimePressed[1] = 0.00
the problem is that for any player but red, the game registers that you hit left only some of the time. ive only tested this as red and blue but as blue right works perfectly and left works about half the time its not a delay problem, if it doesnt work, it won't work at all. it doesnt seem like a problem red causes for blue and i checked the set left/right triggers and red's doesn't mess with blues blue can go left regardles of whether red's left/right are true/false... but still only half the time i honestly have no idea whats causing such a half-the-time problem...
Last edited by Serenity09 on Thu Jan 27, 2011 6:29 pm; edited 1 time in total (Reason for editing : problem fixed) | |
|
Serenity09 Moderator
| Subject: Re: Trigger that works some of the time Thu Jan 27, 2011 4:38 pm | |
| update: right works perfectly for all player left doesn't work at all for teal down.
fixed had a for loop in the middle that didnt need to be there. it shouldnt have caused problems though
Last edited by Serenity09 on Thu Jan 27, 2011 6:29 pm; edited 1 time in total (Reason for editing : fixed) | |
|
AmAzIn[G] Commander
| Subject: Re: Trigger that works some of the time Thu Jan 27, 2011 11:42 pm | |
| someone has been having some anal refluxing going on :O. | |
|
Serenity09 Moderator
| Subject: Re: Trigger that works some of the time Fri Jan 28, 2011 3:07 am | |
| - AmAzIn[G] wrote:
- someone has been having some anal refluxing going on :O.
yep bud, you nailed it anal reflux hit me pretty hard this time around, deleted half my maps and killed a few of my triggers. it was rough, but thats how i like it. | |
|
Sponsored content
| Subject: Re: Trigger that works some of the time | |
| |
|