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
Script Help Make a monster spawn when you touch an entity?
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
Make a monster spawn when you touch an entity?

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?

05-10-2013, 09:19 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: Make a monster spawn when you touch an entity?

SetEntityPlayerInteractCallback should do the trick.
Here's the code:

PHP Code: (Select All)
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: (Select All)
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: (Select All)
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.
(This post was last modified: 05-10-2013, 09:53 PM by OriginalUsername.)
05-10-2013, 09:48 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Make a monster spawn when you touch an entity?

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.

Tutorials: From Noob to Pro
05-10-2013, 09:51 PM
Website Find
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#4
RE: Make a monster spawn when you touch an entity?

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.

05-10-2013, 10:21 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Make a monster spawn when you touch an entity?

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

Trying is the first step to success.
05-10-2013, 11:20 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#6
RE: Make a monster spawn when you touch an entity?

@BeeKayK: Is that a math symbol for the logical OR I see there? \/?
Big Grin Cool
05-11-2013, 09:43 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: Make a monster spawn when you touch an entity?

Yes it is Smile Why? Just something i picked up in math

Trying is the first step to success.
05-12-2013, 02:32 AM
Find




Users browsing this thread: 3 Guest(s)