Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restart a whole battle?
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#1
Restart a whole battle?

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
10-31-2014, 09:48 PM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#2
RE: Restart a whole battle?

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: (Select All)
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

10-31-2014, 11:05 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#3
RE: Restart a whole battle?

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
10-31-2014, 11:08 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Restart a whole battle?

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.

11-01-2014, 01:07 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#5
RE: Restart a whole battle?

You can also add ResetProp function.
This will reset props. i use it to reset cars driving Tongue
11-01-2014, 12:25 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#6
RE: Restart a whole battle?

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
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Restart a whole battle?

(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

Trying is the first step to success.
(This post was last modified: 11-01-2014, 07:15 PM by FlawlessHappiness.)
11-01-2014, 07:14 PM
Find




Users browsing this thread: 1 Guest(s)