1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll has begun! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Help with triggering error?

Discussion in 'Map Development' started by Modeler, Sep 19, 2005.

  1. Modeler

    Modeler

    Joined:
    Aug 27, 2004
    Messages:
    496
    Resources:
    0
    Resources:
    0
    I tried to make a skip cinimatic... but i cant get it to work...
    Code (Text):

    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 (Text):

    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 (Text):

    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 (Text):

    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...
     
  2. Pyrodactyl

    Pyrodactyl

    Joined:
    Jun 9, 2004
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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...
     
  3. qwerty

    qwerty

    Joined:
    Jul 2, 2004
    Messages:
    695
    Resources:
    0
    Resources:
    0
    wouldnt be a key be better? like if you clicked esc then the cinematic will be skipped for you.
     
  4. Modeler

    Modeler

    Joined:
    Aug 27, 2004
    Messages:
    496
    Resources:
    0
    Resources:
    0
    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...?
     
  5. Pyrodactyl

    Pyrodactyl

    Joined:
    Jun 9, 2004
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  6. Modeler

    Modeler

    Joined:
    Aug 27, 2004
    Messages:
    496
    Resources:
    0
    Resources:
    0
    Alright, i got my player detection to work (thanks :). Now my arrow key detection triggers are:

    Detect
    Code (Text):

    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 (Text):

    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...
     
  7. Sunny_D

    Sunny_D

    Joined:
    Sep 17, 2005
    Messages:
    277
    Resources:
    0
    Resources:
    0
    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 (Text):
    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 (Text):
    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.
     
  8. Modeler

    Modeler

    Joined:
    Aug 27, 2004
    Messages:
    496
    Resources:
    0
    Resources:
    0
    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...