Player Teleport / NPC Spawn

Player Teleport / NPC Spawn

Re: Player Teleport / NPC Spawn Posted by kyaranger on Wed Oct 4th 2006 at 2:56am
kyaranger
4 posts
Posted 2006-10-04 2:56am
4 posts 0 snarkmarks Registered: Oct 3rd 2006
Hello,

Basically, I have this Func_Button trigger that once pressed teleports the player to a spot of an npc and kills that npc. What I want is to have a new npc spawn where the player's last location was.

What I'm trying to do is to have a possesive type gameplay, I'm doing a kind of hack job at it right now, but so far it works for me, all except replacing the last player position with a new npc..

Does this make sense?

Thank you.<html><head><link rel="stylesheet" href="themes/standard.css" type="text/css"></head><body topmargin=2 leftmargin=2>
Re: Player Teleport / NPC Spawn Posted by Campaignjunkie on Wed Oct 4th 2006 at 3:57am
Campaignjunkie
1309 posts
Posted 2006-10-04 3:57am
1309 posts 329 snarkmarks Registered: Feb 12th 2002 Occupation: Student Location: West Coast, USA
After a bit of thinking, I think I have an idea.

Make a template for the NPC you want to spawn. Parent an env_entity_maker to the activating player (!activator or !player perhaps?). When the button is activated, unparent the env_entity_maker (so it saves the last location of the player), teleport the player away, and then spawn the NPC. Voila!

If this is multiplayer though, I'm not too sure how this would handle.
Re: Player Teleport / NPC Spawn Posted by kyaranger on Wed Oct 4th 2006 at 6:16am
kyaranger
4 posts
Posted 2006-10-04 6:16am
4 posts 0 snarkmarks Registered: Oct 3rd 2006
Thank you for your reply,

Everything worked except the parenting of the env_entity_maker to the !player or !activator. I tried both and none seemed to work, when i unparented it, the npc would spawn just fine at its entity location.

Do you know of another way to parent an entity to the player?

Thank you!<html><head><link rel="stylesheet" href="themes/standard.css" type="text/css"></head><body topmargin=2 leftmargin=2>
Re: Player Teleport / NPC Spawn Posted by Campaignjunkie on Wed Oct 4th 2006 at 9:38pm
Campaignjunkie
1309 posts
Posted 2006-10-04 9:38pm
1309 posts 329 snarkmarks Registered: Feb 12th 2002 Occupation: Student Location: West Coast, USA
Hmm, odd. I guess entities can't be parented on the player? I'm not really sure how to circumvent that, then. You could try using something like a game_zone_player to try to track the player's position - arrange a bunch of game_zone_player's in a grid format and have them trigger when the player is there. That way, you'll know the player's position based on what game_zone_player he triggers. You could also use a trigger_multiple or something similar too.

Some caveats: I'm not sure how memory intensive all those trigger volumes would be on the engine. You'll also have to configure each grid spot by hand, which can be time consuming. But it'll work, even though it's a little hacky and it'll restrict your level design a bit.