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


Messages In This Thread
RE: Make a monster spawn when you touch an entity? - by OriginalUsername - 05-10-2013, 09:48 PM



Users browsing this thread: 1 Guest(s)