Seasoned Roamer Old MikeS Posted December 21, 2004 Share Posted December 21, 2004 I have the following code in a town's start state: Code: if (get_flag(4, 13) > 0) { 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 ii = get_char_status(plyr, 4); set_char_status(plyr, 4, -ii, 1, 0); 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); }} Basically, it watches a 'split off' character and forces a heal/rejoin if the character is in trouble. It works great as long as the character does not go into combat mode. There it only works if the wounded check is met between combat rounds. Otherwise, the game ends in death. Is there another way to force a party rejoin if a split character dies while in combat that I may have missed? Or do I just pop up message letting the player know that combat may not be the best option while 'split'? Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 21, 2004 Share Posted December 21, 2004 The only kind of script that gets called between moves in combat is a terrain script. If you put this in a terrain script's START_STATE and set the script's mode to 3 (so it would be called every turn), then this state would get called between every single PC move — but even then, I don't think it would get called between every monster move, so I don't think that would help much. Eh, no. I don't know how one might do this effectively. A warning, especially if you can make it plot-related and in-game sensical, might be best. EDIT: Oh, duh. Put it in the START_STATEs of the creature scripts of the creatures nearby, too, so it will be called on every monster move also. That should cover all of your bases. Link to comment Share on other sites More sharing options...
Seasoned Roamer Old MikeS Posted December 22, 2004 Author Share Posted December 22, 2004 Thanks for the warning. Luckily this isn't intergal to the plot line, just trying to dot the i's, cross the t's - so to speak. I'll probably just put in a warning message about combat mode and let the player make the choice. As another thought, would placing a check after each 'doattack()' call within the creature scripts be a better place to see if the split off character is in trouble? I may try this one day when I get really motivated. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Isaac Posted December 22, 2004 Share Posted December 22, 2004 Quote: Originally written by MikeS:would placing a check after each 'doattack()' call within the creature scripts be a better place to see if the split off character is in trouble? I don't think it's the only place needed, although it sounds like a good place. The PC can move away from the enemy, automatically causing an attack, or take damage from poison (if there's anything to cause poison). Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted December 22, 2004 Share Posted December 22, 2004 Use the script that you have posted as a terrain one, and also give the character who is to go into the arena a life-saving item right before he goes in. If the item is found to no longer exist in his possession nor on the floor of the arena, then take the character out immediately. What triggers the item check is left up to you. But even if the character is allowed to die, you could just revive him and allow the party to pick up all his items again, so I don't see what the big *practical* problem is. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Isaac Posted December 23, 2004 Share Posted December 23, 2004 Quote: Originally written by Garrison:I don't see what the big *practical* problem is. Blades of Avernum makes you lose if your party is split and the split off character dies. That needs to be circumvented. Link to comment Share on other sites More sharing options...
Recommended Posts