Frictional Games Forum (read-only)

Full Version: Make a monster spawn when you touch an entity?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want a water lurker to activate when you pick up an object (in my case a cog), is this possible or will I simply have to do a collide callback to spawn it?

Also when it comes to the water lurker do I simply have to place path nodes and it will follow them or do I need to script them in as well?
SetEntityPlayerInteractCallback should do the trick.
Here's the code:

PHP Code:
void OnStart()
{
SetEntityPlayerInteractCallback("cog_name""func_name"true); 
}

void func_name(string &in asEntity)
{
SetEntityActive("waterlurker_name"true);


And for the monsters: It depends. Do you want to let him patrol or chase the player?
For patrolling:
PHP Code:
AddEnemyPatrolNode("waterlurker_name""pathnode_name"0(or any time you want to let the monster wait), ""); 
If you have more nodes, just duplicate this with the right name of the node.

If you want him to chase the player:
PHP Code:
ShowEnemyPlayerPosition("waterlurker_name"); 
This means the monster'll run straight to the player. He will get stuck behind corners and debris, so it's good if he has to chase him in a long, clean corridor.

Also, this.
Water lurkers move based on sound, but they also require the use of path nodes to help them navigate the environment. No scripting is required for water lurkers, except perhaps to activate them.
Ah thanks, I knew it was something like SetEntityPlayerInteractCallback but wasnt 100%.

@Your Computer, cheers that makes it much simpler to set one up, ive just got to make sure there are plenty of path nodes.
When you have an idea of what it is, go to this site: http://wiki.frictionalgames.com/hpl2/amn..._functions

Press Ctrl F \/ Cmd F to activate the search function in your browser.

Start searching for what you might think it is you're looking for. It's a very easy way
@BeeKayK: Is that a math symbol for the logical OR I see there? \/?
Big Grin Cool
Yes it is Smile Why? Just something i picked up in math