Jump to content

Death During Split Party


Castus

Recommended Posts

I played around with this some years ago. If you can keep the split character from going into combat, you can detect in the town start state that the character is dead before the game does anything with it and rejoin the party (and heal if need be). If the split character is in combat, you're out of luck, or at least I could never figure out how to detect the dead character before the game does.

I used the following snippet to monitor the split character in the town start state:

if (get_flag(4, 13) > 0) {

if ((is_combat()) && (get_flag(4, 16) == 0)) {

set_flag(4, 16, 1);

message_dialog("A voice booms out _Warning, cannot guarantee survivability while in combat mode_.", "");

}

plyr = get_selected_char();

// check if player in trouble in arena - loses automatically

if ((char_status(plyr) != 1) || (get_health(plyr) < 15)) {

// player has lost - rejoin party, then revive

reunite_party();

restore_pc(plyr);

play_sound(27);

message_dialog("You have lost your fight and have been teleported back to your companions.", "The victor is still getting crowd acclamation within the arena");

kill_char(get_flag(4, 3), 2, 0);

set_flag(4, 3, 0);

set_flag(4, 13, 0);

}

}

Link to comment
Share on other sites

Just thinking out loud here - couldn't you stick some sort of code in a creature's attacking state that would, when a PC gets to zero HP or less, reunite the party, and then kill the PC? Doesn't Stairway do something like this?

 

Edit: Just had a quick check. Yes, this should work provided you can reunite a party without having them step on blue rectangles...

 

Edit2: And the docs don't say anything about that...

 

Okay, what I'd do is use a bit of code like this in a creature script. Give all monsters who might fight the split-off PC this script (or if you wanted to be fancy, code it into your basicnpc, and turn it on/off with a flag/memory cell).

 

Code:
if(get_health(0)<=1) {    reunite_party();    kill_char(0,2,0);}

 

Considerations to take into account include making sure you grab the right PC to kill - you'd probably have to use a flag here ("get_selected_pc()" would be perfect, but it's reset to -1 whenever the script is run).

 

Link to comment
Share on other sites

Quote:
Doesn't Stairway do something like this?
No, it waits only until the target's HP is low (<=1, instead of ==0), not zero. I can't remember exactly why I did this, but I remember finding that I couldn't get it to work otherwise. It might, however, have been due to sloppily not putting any check in the START_STATE where there are other do_attack() calls rather than because of something more fundamental.

Quote:
Considerations to take into account include making sure you grab the right PC to kill
That should be easy; loop through the party (before reuniting!) and check each character with char_status(): ignore those with statuses >10 (variations on not present), and mark the one whose status is >=1 && <=5 to be killed after reuniting.

Quote:
If you can keep the split character from going into combat, you can detect in the town start state that the character is dead before the game does anything with it and rejoin the party (and heal if need be).
Interesting. It might not be the best approach to use here, but it's worth remembering.
Link to comment
Share on other sites

Originally Posted By: Niemand

Quote:
Considerations to take into account include making sure you grab the right PC to kill
That should be easy; loop through the party (before reuniting!) and check each character with char_status(): ignore those with statuses >10 (variations on not present), and mark the one whose status is >=1 && <=5 to be killed after reuniting.


I'm an idiot. An even easier way would be to mark the PC when it's split off, right after the player selects him. You'd just have to remember to unmark him if he reunites with the party without dying. tongue
Link to comment
Share on other sites

Thanks for all the input.

 

My creature now reports to a town state when it has neutralized its target. There I reunite the party if necessary.

 

I've tested it and it always worked except once. I'm still not sure whether I just didn't properly reload the scenario after I made changes to the script or if there are really some conditions under which this trick just doesn't work. That still worries me a little. Yet I've tried it about ten times now while being in as well as not being in combat. It worked every time.

@Old MikeS: In the code snippet you posted it says "cannot guarantee survivability while in combat mode". Does that mean that, while being in combat mode, sometimes you could and sometimes you couldn't detect the PC's death before the game? Or where you not able to detect it at all while in combat mode?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...