Frictional Games Forum (read-only)

Full Version: Restart a whole battle?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!!
i'm finished with my Halloween custom story!!
but the end is a boss battle..
where you have to Lure 3 monster into the gate.
afte they are all in a portal will appear where you can ESCAPE!! Big Grin
but the problem is, if YOU fall in the gate, you will die to! (or the monster smashes you)
how am i supposed to restart the WHOLE map and WHOLE functions, like i'm by the FINAL monster, and i die. then i will respawn back to the place where i respawned at begin, and i have to begin ALL over agian (boss battle) so the first boss.. Can someone help me fast Please!! i want to finish this today to publish it on modbb Tongue
I managed to bring back my monsters with the checkpoint script. You can make a collide script box, and the function you call for it can be the checkpoint. The checkpoint function callback can reset your monsters and other functions.

I believe you may have to put additional monsters that are inactive that are set to active during the checkpoint callback, however you may not have to do that, just fiddle around and see what works for you.

This is an example of what the script would look like for that:

Spoiler below!
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""Checkpoint""CheckPoint"false1);
}

void CheckPoint(string &in asParentstring &in asChildint alState
{
CheckPoint ("""PlayerStartArea_1""CheckpointRespawnScript""Hints""Death_Hint1");
}

void Checkpoint RespawnScript(string &in asNameint alCount
{
SetEntityActive("monster1"true);
SetEntityActive("monster2"true);
SetEntityActive("monster3"true);



You'd have to play around with names, obviously, to see what works for you, but that should work. Big Grin
Thanks Big Grin
but for secure, my Monster2 is Active if the Monster1 Falls down the gate, and Monster3 is avaible after Monster2 Falls, that works, right? Tongue
I'm going to try everything.
Thank you Big Grin
Monsters de-spawn when you die. If you re-enable them using SetEntityActive within the check point callback, they should reappear from their original position, like missy said.
You can also add ResetProp function.
This will reset props. i use it to reset cars driving Tongue
Hey, while we are at it: If I deactivate and activate an Entity, will it reset it's position ? It would help me at closing doors without using prop force, because these functions require lot of tweaking ;(
(11-01-2014, 07:06 PM)Darkfire Wrote: [ -> ]Hey, while we are at it: If I deactivate and activate an Entity, will it reset it's position ? It would help me at closing doors without using prop force, because these functions require lot of tweaking ;(

No.

To reset an entity use ResetProp.
To close a door, use SetSwingDoorClosed