Curious Artila Castus Posted April 8, 2010 Share Posted April 8, 2010 It seems that when the party is split and the character that is split off dies you lose the game. I would like the player to continue playing with the remaining characters. How would I go about doing that? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted April 8, 2010 Share Posted April 8, 2010 I'm doubtful that there's any way to do it, unfortunately, since there isn't any way I can think of to trigger a script when that happens, and thus no way to alter the game's standard behavior. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Enraged Slith Posted April 8, 2010 Share Posted April 8, 2010 I'm almost certain I've never received a game over this way. Quote Link to comment Share on other sites More sharing options...
Seasoned Roamer Old MikeS Posted April 8, 2010 Share Posted April 8, 2010 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); } } Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted April 8, 2010 Share Posted April 8, 2010 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). Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted April 8, 2010 Share Posted April 8, 2010 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. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted April 8, 2010 Share Posted April 8, 2010 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. Quote Link to comment Share on other sites More sharing options...
Curious Artila Castus Posted April 9, 2010 Author Share Posted April 9, 2010 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? Quote Link to comment Share on other sites More sharing options...
Seasoned Roamer Old MikeS Posted April 9, 2010 Share Posted April 9, 2010 It's been awhile, but I believe while in combat and the player died (health < 0) and luck failed, the game just ended, the check in the town start state didn't run. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.