Split out characters and death

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Split out characters and death
Apprentice
Member # 5294
Profile Homepage #0
I have the following code in a town's start state:
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'?
Posts: 30 | Registered: Wednesday, December 15 2004 08:00
Off With Their Heads
Member # 4045
Profile Homepage #1
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.

[ Tuesday, December 21, 2004 07:38: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 5294
Profile Homepage #2
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? :confused: I may try this one day when I get really motivated. :)
Posts: 30 | Registered: Wednesday, December 15 2004 08:00
Warrior
Member # 4202
Profile Homepage #3
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).

--------------------
Creator of the 3D Blades of Avernum Editor for Mac. Get it at Ingenious Isaac's Illusion, my web page. Better yet, get Battle for Wesnoth, a wonderful free TBS game.
Posts: 192 | Registered: Sunday, April 4 2004 08:00
Agent
Member # 2820
Profile #4
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.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Warrior
Member # 4202
Profile Homepage #5
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.

--------------------
Creator of the 3D Blades of Avernum Editor for Mac. Get it at Ingenious Isaac's Illusion, my web page. Better yet, get Battle for Wesnoth, a wonderful free TBS game.
Posts: 192 | Registered: Sunday, April 4 2004 08:00