Needs help to make Mirror Mode

Twisty

New Member
Reaction score
0
Hello

I'm making a micro war, and i want to put in a Mirror Mode. That can be choosen if you find the game too easy.
It shall do so, if you want your unit to move left, it goes right instead.
This is my code: http://yfrog.com/i3unavngivetsp Please take a look at this and tell me what im doing wrong.

I hope some of you pros can help me a bit. Thanks!
 

jig7c

Stop reading me...-statement
Reaction score
123
lots of calculations..

i can't see that link, cause my work internet doesn't go on that web page
if you could post the triggers here, maybe i can figure something out for you...

that mode only mirrors movement right.. not AoE spells, or target point spells.. right?
 

Twisty

New Member
Reaction score
0
Well, i just figured out whats wrong 2 minutes ago.
its because the trigger "reacts" on itself.

each time a unit is issued a order targeting a point, the trigger starts making the unit go the opposite way, but doing that, is to issue order targeting a point, wich makes the trigger do again and again and so on. And thats why the game crashes..

Does anyone know how i can make the trigger not react on that one action in itself ?
 

sLsIDK

New Member
Reaction score
13
Trigger:
  • Trigger - Turn off (This Trigger)
    • Unit - Order to whatever
    • Trigger - Turn on (This Trigger)
 

Seprest

New Member
Reaction score
15
basically it tells you to go right if you try to go left.

however this thus tell you to go left because you're not going right o_O

plz post the trigger here, just copy the trigger as text, post in a reply, highlight and hit the "a" button on the post toolbar.

the screenshot you posted is a bit cutoff, so I can't see the entire THEN statement, though I can see that it basically orders the unit to someplace else, thus triggering itself over and over again.

@op:

Doesn't turning off the trigger effectively stop the trigger:confused: Even if it didn't, I think the wc3 trigger system checks for things being triggered after each trigger is done, not during. I could be wrong on that last statement though.





-ANYWAY-

My solution would be to set a boolean variable to true when the trigger runs the first time. Then when it is triggered again(presumably by itself immediately after), check in a if/then/else statement if the boolean variable is true. If it is set it to false and then end the trigger. This should nip the problem in the bud (I hope).


I think it would be something like this:
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (myChecker) Equal to True
    • Then - Actions
      • Set myChecker = false
    • Else - Actions
      • Set myChecker = ture
    • Custom script: PUT THE REST OF YOUR TRIGGER IN THE ELSE ACTIONS
 

Twisty

New Member
Reaction score
0
Thanks people :D!

it works, and this is how i did it:

Trigger:
  • Events
    • Unit - A unit is issued an order targeting a point
    • Conditions
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Then - Actions
    • Trigger - Turn off (This trigger)
    • Set MirrorModeUnit = (Triggering unit)
    • Set MirrorModePoint = (Target point of issued order)
    • Set MirrorModePoint2 = (Position of MirrorMode Unit)
    • Set MirrorModeAngle = (Angle from MirrorModePoint to MirrorModePoint2)
    • Unit - Order MirrorModeUnit to Move To (MirrorModePoint offset by ((Distance between MirrorModePoint and MirrorModePoint2) x 2.00) towards (MirrorModeAngledegrees)
    • Custom Script: call RemoveLocation(udg_MirrorModePoint)
    • Custom Script: call RemoveLocation(udg_MirrorModePoint2)
    • Trigger - Turn on (This trigger)


I think the angle part leaks, but what command shall i use to delete that one?

Anyways THANKS!! I love this forum ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top