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
Start event when player spawns at a certain PlayerStartArea?
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#1
Start event when player spawns at a certain PlayerStartArea?

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.
10-06-2011, 03:14 AM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#2
RE: Start event when player spawns at a certain PlayerStartArea?

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


Current Project
Forgotten
10-06-2011, 03:36 AM
Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#3
RE: Start event when player spawns at a certain PlayerStartArea?

(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
10-06-2011, 04:06 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Start event when player spawns at a certain PlayerStartArea?

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
Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#5
RE: Start event when player spawns at a certain PlayerStartArea?

(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 :/
(This post was last modified: 10-07-2011, 02:59 AM by SonOfLiberty796.)
10-07-2011, 02:30 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Start event when player spawns at a certain PlayerStartArea?

(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."

Tutorials: From Noob to Pro
10-07-2011, 03:50 AM
Website Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#7
RE: Start event when player spawns at a certain PlayerStartArea?

(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
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Start event when player spawns at a certain PlayerStartArea?

(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?

Tutorials: From Noob to Pro
10-07-2011, 05:57 AM
Website Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#9
RE: Start event when player spawns at a certain PlayerStartArea?

(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)
10-08-2011, 12:37 AM
Find
LowFire3 Offline
Junior Member

Posts: 26
Threads: 4
Joined: Dec 2010
Reputation: 1
#10
RE: Start event when player spawns at a certain PlayerStartArea?

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.

[Image: at_7728609.png]
10-08-2011, 12:46 AM
Find




Users browsing this thread: 2 Guest(s)