Frictional Games Forum (read-only)

Full Version: Start event when player spawns at a certain PlayerStartArea?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Like the title says, is there a way where if a player spawns at a certain PlayerStartArea an event happens? (like monsters spawn etc.)

What I want to do is when the player spawns at PlayerStartArea_2, monsters spawn at the same time in a different room.
Uhh could you use this (bolded part)

CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file

and then make the function Checkpoint_2/1 whatever
SetEntityActive("", true/false)
So On
So On

I'm not completely sure with checkpoints mainly because in my custom story I haven't added them but. I think that'd work.

-Grey Fox

(10-06-2011, 03:36 AM)GreyFox Wrote: [ -> ]Uhh could you use this (bolded part)

CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file

and then make the function Checkpoint_2/1 whatever
SetEntityActive("", true/false)
So On
So On

I'm not completely sure with checkpoints mainly because in my custom story I haven't added them but. I think that'd work.

-Grey Fox
That looks like it'll work! I'll try it out right now Smile
If you want the player to move areas completely, you can always use

TeleportPlayer(string& asStartPosName);

To get them there.

(10-06-2011, 05:28 AM)Obliviator27 Wrote: [ -> ]If you want the player to move areas completely, you can always use

TeleportPlayer(string& asStartPosName);

To get them there.
Yeah I know, but it wasn't what I was looking for. :p


Well I tried out what you said Grey Fox, but it didnt work unfortunately :/
(10-07-2011, 02:30 AM)Xvideogamer720X Wrote: [ -> ]Well I tried out what you said Grey Fox, but it didnt work unfortunately :/

In what way? There are only two ways to achieve what you want, and that is either through checkpoints (i.e. after the player dies) or when the player enters at the desired spot (e.g. having previously interacted with a level door); there is no other instance that i know of that the player "spawns."
(10-07-2011, 03:50 AM)Your Computer Wrote: [ -> ]
(10-07-2011, 02:30 AM)Xvideogamer720X Wrote: [ -> ]Well I tried out what you said Grey Fox, but it didnt work unfortunately :/

In what way? There are only two ways to achieve what you want, and that is either through checkpoints (i.e. after the player dies) or when the player enters at the desired spot (e.g. having previously interacted with a level door); there is no other instance that i know of that the player "spawns."
When player enters at the desired spot, which is PlayerStartArea_2.
(10-07-2011, 04:31 AM)Xvideogamer720X Wrote: [ -> ]When player enters at the desired spot, which is PlayerStartArea_2.

I meant, what doesn't work? How do you have things set up?
(10-07-2011, 05:57 AM)Your Computer Wrote: [ -> ]
(10-07-2011, 04:31 AM)Xvideogamer720X Wrote: [ -> ]When player enters at the desired spot, which is PlayerStartArea_2.

I meant, what doesn't work? How do you have things set up?
Like when I spawn (on the P.S.A 2 PlayerStartArea_2) nothing happens (but I want monsters to spawn right when the Player spawns on P.S.A 2)
Just make a scripted area where the PlayerStartArea is. So when the player spawns in at PlayerStartArea_2, he will instantly collide with the script area and do whatever you want it to do. That is how I do it if I want something to happen the second I spawn in an area.
Pages: 1 2