• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Trigger to skip current action.

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi, i'm making an RPG that features A LOT of talking with NPC's. I though about a trigger that Skips to the next dialog when Esc (or any other set) key is pressed, but never found the way to do it, so i made a "ChatSpeed" ability, and custom commands to modify its lvl, and set the "Wait" duration between text to the lvl of that ability.

BUT

What i really want is setting the "Wait" duration between text blocks to: (Until the Player presses 'A' Key) The unit is paused, so pressing 'A' has no effect at all)

  • Roger 1
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Selling unit) Equal to Roger 0000 <gen>
      • (Item-type of (Sold Item)) Equal to Talk
      • ((Buying unit) is A Hero) Equal to True
    • Actions
      • Unit - Pause (Buying unit)
      • Camera - Set (Owner of (Buying unit))'s camera Distance to target to 1200.00 over 0.50 seconds
      • Camera - Pan camera for (Owner of (Buying unit)) to (Position of (Buying unit)) over 0.50 seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Hi! Whats your name...
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to ...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Camera - Pan camera for (Owner of (Buying unit)) to (Position of (Selling unit)) over 0.50 seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Hi! I'm |cffffd700R...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Some texts are shor...
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to ...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Some will be really...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Type '|cffffd700cs+...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to The min speed is -|...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to You can check your ...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Notice that your un...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to You should also che...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Now we're done, go ...
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Ok...
      • Wait (Real((Level of Chat speed for (Buying unit)))) seconds
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to Follow the path to ...
      • Camera - Pan camera for (Owner of (Buying unit)) to (Position of (Buying unit)) over 0.50 seconds
      • Camera - Set (Owner of (Buying unit))'s camera Distance to target to 2000.00 over 0.50 seconds
      • Unit - Unpause (Buying unit)
Any help around?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
(Until the Player presses 'A' Key) The unit is paused, so pressing 'A' has no effect at all)

You will have to force the player to select a unit with an ability with hotkey "A". Then when you detect that ability being cast you skip the wait. This could be done by looping with a wait until a global boolean variable is true. Then you set it to false and move onto next wait.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
JASS:
globals
    boolean array ABeenPressed
endglobals

function WaitForA takes integer p returns nothing
    loop
        exitwhen ABeenPressed
        call TriggerSleepAction(0.0)
    endloop
    set ABeenPressed = false
endfunction

where p is the player slot number.

You set the global boolean true when the A dummy ability is pressed at the inder of the player number.

You just call the function when ever you want to wait until A is pressed.

Ofcourse remember that the unit the player has selected bust be able to cast the "A" dummy ability.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok, so, that makes the Boolean true, and then it requires to be set to "True" again when the next wait action is?... BTW, i don't undertand very much of jass =/ If you can give me a simple Copy/paste/Modify version, would be a lot better.. I'm already ashamed for being so dumb, but i would love a demo map =/ :$
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
try this...
  • Chat 1 Buy
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • -------- dialog 1 here... --------
      • Wait 2.00 seconds
      • Trigger - Turn on Chat 2 <gen>
Chat 2 wont fire if ESC key is not pressed, so you are forced to press this
  • Chat 2
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- dialog 2 here... --------
      • Wait 2.00 seconds
      • Trigger - Turn on Chat 3 <gen>
Chat 3 wont fire if ESC key is not pressed, so you are forced to press this
  • Chat 3
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- dialog 3 here... --------
      • Wait 2.00 seconds
      • Trigger - Turn on Chat 4 <gen>
and so on...
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
IT would require TONS of triggers. I stick to the "ChatSpeed" ability then, and make the "Wait" duration the same as the "Ability lvl". I tryed a whole day to make a unit with the 'A' function to Skip the current text, but I never made it work... neither understood what Dr Super Good gently tried to explain to me.
 
Status
Not open for further replies.
Top