• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help with triggering error?

Status
Not open for further replies.
Level 9
Joined
Aug 27, 2004
Messages
471
I tried to make a skip cinimatic... but i cant get it to work...
Code:
Startup
    Events
        Map initialization
    Conditions
    Actions
        Set Intro = 0
        Set Nointro = 0
        Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
        Wait 0.01 seconds
        Game - Display to (All players) for 11.00 seconds the text: |cFF990000You have ...
        Dialog - Create a dialog button for DialogIntro labelled Show intro
        Set Shwointrobutton = (Last created dialog Button)
        Wait 0.10 seconds
        Dialog - Create a dialog button for DialogIntro labelled Skip Intro
        Set Dontshowintrobutton = (Last created dialog Button)
        Wait 0.01 seconds
        Dialog - Show DialogIntro for Player 1 (Red)
        Dialog - Show DialogIntro for Player 2 (Blue)
        Camera - Lock camera target for Player 1 (Red) to Scientist 0000 <gen>, offset by (0.00, 0.00) using Default rotation
        Camera - Lock camera target for Player 2 (Blue) to Scientist 0000 <gen>, offset by (0.00, 0.00) using Default rotation

Code:
Show Intro
    Events
        Dialog - A dialog button is clicked for DialogIntro
    Conditions
        (Clicked dialog button) Equal to Shwointrobutton
    Actions
        Dialog - Hide DialogIntro for (Triggering player)
        Set Intro = (Intro + 1)

Code:
Dont Show Intro
    Events
        Dialog - A dialog button is clicked for DialogIntro
    Conditions
        (Clicked dialog button) Equal to Dontshowintrobutton
    Actions
        Dialog - Hide DialogIntro for (Triggering player)
        Set Nointro = (Nointro + 1)

Code:
RunVoteCheck
    Events
        Time - Elapsed game time is 15.50 seconds
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Player 1 (Red) controller) Equal to User
            Then - Actions
                Set PlayerAmount = (PlayerAmount + 1)
            Else - Actions
                Do nothing
        Wait 0.10 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Player 2 (Blue) controller) Equal to User
            Then - Actions
                Set PlayerAmount = (PlayerAmount + 1)
            Else - Actions
                Do nothing
        Wait 1.00 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Intro + Nointro) Equal to PlayerAmount
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Intro Greater than or equal to Nointro
                    Then - Actions
                        Trigger - Run Intro <gen> (ignoring conditions)
                        Dialog - Hide DialogIntro for Player 1 (Red)
                        Dialog - Hide DialogIntro for Player 2 (Blue)
                    Else - Actions
                        Dialog - Hide DialogIntro for Player 1 (Red)
                        Dialog - Hide DialogIntro for Player 2 (Blue)
                        Player Group - Add Player 1 (Red) to Slayers
                        Player Group - Add Player 2 (Blue) to Slayers
                        Wait 0.10 seconds
                        Cinematic - Turn cinematic mode On for (All players)
                        Cinematic - Disable user control for (All players)
                        Wait 0.10 seconds
                        Trigger - Run Story <gen> (ignoring conditions)
            Else - Actions
                Dialog - Hide DialogIntro for Player 1 (Red)
                Dialog - Hide DialogIntro for Player 2 (Blue)
                Trigger - Run Intro <gen> (ignoring conditions)

It should work... But it just doesnt. It runs the intro without reguard for anything...
 
Level 5
Joined
Jun 9, 2004
Messages
181
i think the vote check trigger should be one with the vote triggers like this:

EV: a button is clicked for dialog (your dialog)
COND: -
ACT: if clicked button is intro then set intro=intro+1
if clicked button is no intro then set nointro=nointro+1
if intro+nointro equal to (number of players that are controlled by User and Is playing)
then
if intro >= nointro then run intro
else ...
else
...

something like that should work...
 
Level 10
Joined
Jul 2, 2004
Messages
690
wouldnt be a key be better? like if you clicked esc then the cinematic will be skipped for you.
 
Level 9
Joined
Aug 27, 2004
Messages
471
Its a two player game, and requires that both player negotitate on everything. Hence two player voting system :p.

I have a second question. I have a trigger to detect when a player hits the down arrow, and then when he releases it. But it doesnt seem to detect the release...?
 
Level 5
Joined
Jun 9, 2004
Messages
181
I think i have found the erroe in your script: it was the player amount thingy. If i'm right you tested it alone. Player 1 and Player 2 are set to be user-controlled, so it is constantly true that they are controlled by a User, so PlayerAmount will ALWAYS be 2. If you test it alone, then the number of votes will never be the same as the Playeramount variable, thus the ELSE functions will run that automaticly strats the intro.

Fix:
If Player 1 slot status is playing) then playeramount:=playeramount+1
If Player 2 slot status blah blah..

Arrow key release dectection must work, because i use it many of my maps. Perhaps show the triggers (the one with "Presses key" and the one with "Releases key"), and i'll take a look at them and tell you if anything is wrong.
 
Level 9
Joined
Aug 27, 2004
Messages
471
Alright, i got my player detection to work (thanks :). Now my arrow key detection triggers are:

Detect
Code:
Ducking P1
    Events
        Player - Player 1 (Red) Presses the Down Arrow key
    Conditions
        Dontduck Equal to False
    Actions
        Set DuckingP1 = True
        Wait 0.01 seconds
        Trigger - Turn off Constant P1 <gen>
        Wait 0.05 seconds
        Camera - Apply Currduck for Player 1 (Red) over 0.40 seconds
        Wait 0.41 seconds
        Trigger - Turn on Constant Ducking p1 <gen>
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DuckingP1 Equal to True
            Then - Actions
                Set Player1Ammo = Player1AmmoMax
                Wait 0.01 seconds
                Player - Set Player 1 (Red) Current gold to Player1Ammo
            Else - Actions
                Do nothing

Release
Code:
Unducking P1
    Events
        Player - Player 1 (Red) Releases the Down Arrow key
    Conditions
        DuckingP1 Equal to True
    Actions
        Set DuckingP1 = False
        Wait 0.01 seconds
        Trigger - Turn off Constant Ducking p1 <gen>
        Wait 0.01 seconds
        Camera - Apply Currcam for Player 1 (Red) over 0.40 seconds
        Wait 0.41 seconds
        Trigger - Turn on Constant P1 <gen>


I cant find the problem no matter how hard i try...
 
Level 6
Joined
Sep 17, 2005
Messages
276
hm... the condition in trigger 2 is useless, isnt it?
why add a condition which says you the button down must be pressed before? The event 'Release' Includes that already cz if you want to release the button it HAS TO be pressed before.

Secondly i would do the trigger a bit more simple.
I dont know if that fits with the other triggers you have...

Code:
Ducking P1 

    Events 
        Player - Player 1 (Red) Presses the Down Arrow key 
    Conditions 
        Dontduck Equal to False 
    Actions 
        Set DuckingP1 = True 
        Wait 0.01 seconds 
        Trigger - Turn off Constant P1 <gen> 
        Wait 0.05 seconds 
        Camera - Apply Currduck for Player 1 (Red) over 0.40 seconds 
        Wait 0.41 seconds 
        Trigger - Turn on Constant Ducking p1 <gen> 
        If (All Conditions are True) then do (Then 
        Set Player1Ammo = Player1AmmoMax 
        Wait 0.01 seconds 
        Player - Set Player 1 (Red) Current gold to Player1Ammo

<<<<< i think you dont need the if function cz some seconds before you set the var duckingp1 to true so that is always true. >>>>>


Release

Code:
Unducking P1 
    Events 
        Player - Player 1 (Red) Releases the Down Arrow key 
    Conditions 
    Actions 
        Set DuckingP1 = False 
        Wait 0.01 seconds 
        Trigger - Turn off Constant Ducking p1 <gen> 
        Wait 0.01 seconds 
        Camera - Apply Currcam for Player 1 (Red) over 0.40 seconds 
        Wait 0.41 seconds 
        Trigger - Turn on Constant P1 <gen>


Perhaps this may help you.... Or another reason could be the much waits in your triggers, so if you can delete them, try it this way.
 
Level 9
Joined
Aug 27, 2004
Messages
471
<<<<< i think you dont need the if function cz some seconds before you set the var duckingp1 to true so that is always true. >>>>>

I dont want it to reload unless they are dukcing after .60 seconds. (not a long wait)

I did remove the condition, i had it in cause i am dumb :p. Still having a few bugs with it though...
 
Status
Not open for further replies.
Top