Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: End mission when player dies

  1. #1

    End mission when player dies (question about onPlayerKilled.sqs)

    When the player dies in SP mission, I'd want the screen to fade black and then end the mission. Is this possible?
    Last edited by Janat; Dec 6 2010 at 16:54.

  2. #2
    Hello.

    Yes it's possible.

    http://forums.bistudio.com/showthread.php?t=109926

    Kind Regards
    Melvin

  3. #3
    Corporal
    Join Date
    Jul 18 2009
    Location
    Finland
    Posts
    94
    Author of the Thread
    Thanks. But now if I wanted the mission to end only after a certain trigger has been activated, and if player dies before the trigger's been activated the default menu with revert and abort options shows up. Would that be possible?

  4. #4
    Quote Originally Posted by Janat View Post
    Thanks. But now if I wanted the mission to end only after a certain trigger has been activated, and if player dies before the trigger's been activated the default menu with revert and abort options shows up. Would that be possible?
    Hello.

    In the trigger you want to have activated first put a variable (ie. cheesecake) true. onAct: cheesecake = true;

    then in the ending trigger put

    condition: !(alive player) AND cheesecake
    or whatever you had there already and add AND cheesecake.

    Regards
    Melvin

  5. #5
    Corporal
    Join Date
    Jul 18 2009
    Location
    Finland
    Posts
    94
    Author of the Thread
    Quote Originally Posted by MelvinNor View Post
    Hello.

    In the trigger you want to have activated first put a variable (ie. cheesecake) true. onAct: cheesecake = true;

    then in the ending trigger put

    condition: !(alive player) AND cheesecake
    or whatever you had there already and add AND cheesecake.

    Regards
    Melvin
    I did so but the mission doesn't end. You just die normally. There's no debriefing. That's why I came to ask about it here. Though I've only tried it in editor, maybe it indeed works outside of editor? I don't know and can't try right now.
    Last edited by Janat; Dec 5 2010 at 15:23.

  6. #6
    Hello.

    I'm wondering, did you read the other post? Because I think it explains the exact problem you have. Or maybe I didn't understand the post I linked. I think I did though

    Kind Regards
    Melvin

  7. #7
    Corporal
    Join Date
    Jul 18 2009
    Location
    Finland
    Posts
    94
    Author of the Thread
    I have to admit that I read it very quickly and didn't see all those important bits. Now I think I know how to do it.

  8. #8
    Corporal
    Join Date
    Jul 18 2009
    Location
    Finland
    Posts
    94
    Author of the Thread
    After experimenting a little bit, I can't get my onPlayerKilled.sqs work properly. I have tried this script:
    Code:
    titleCut ["","BLACK OUT",5]
    5 fadeMusic 0
    ~7
    if outroo  then endMission "END1" else enableEndDialog
    exit
    But regardless of whether "outroo" is true or false, mission ends. I've also tried outroo == true and outroo = true in place of outroo, but none of them work.

    On the other hand, this script always gives the revert menu, no matter what "outroo" status is.
    Code:
    enableEndDialog
    titleCut ["","BLACK OUT",5]
    5 fadeMusic 0
    ~7
    if outroo  then endMission "END1"
    exit
    Also tried this but it didn't work at all. No dialog what so ever, I had to alt-F4 out of the game.
    Code:
    titleCut ["","BLACK OUT",5]
    5 fadeMusic 0
    ~7
    ? outroo: endMission "END1"
    ? !outroo: enableEndDialog
    exit

  9. #9
    Corporal
    Join Date
    Jul 18 2009
    Location
    Finland
    Posts
    94
    Author of the Thread
    No one knows what's wrong with my script?

  10. #10
    I can't verify this in the editor right now but my guess is there are some brackets missing in your if .. then statement:
    Code:
    if (outroo)  then {endMission "END1";}
    // maybe you even have to use if {...} instead of if (...) - not sure about the syntax right now
    In addition I think you are not supposed to actually use the endMission command. Instead you should use a boolean variable in conjunction with an end trigger in the editor and the variable as condition.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •