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
Simple help with scripting?
KenOfAllTrades Offline
Member

Posts: 53
Threads: 2
Joined: Apr 2011
Reputation: 0
#1
Simple help with scripting?

Okay so I've been searching the forum, and I've found a lot of useful scripts. So far I've been able to spawn a monster when I walk to a certain spot, but I don't know how to make it go to a path node.

I've found some lines I can't find again on how to make it instantly spot my location or go to the path node, but I don't know HOW to add them. I've tried a lot of different things. My problem is just that I don't know how to ADD stuff to the OnStart part.

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player" , "MonsterArea" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monsterguy" , true);
}
ShowEnemyPlayerPosition("Monsterguy");
}

If I want my monster to go to "Path01", EXACTLY what do I have to add where? Can anyone write me a modified version of this script that would make him head for "Path01"? And maybe try to explain how it works? Help is VERY much appreciated

I probably made a LP of this! Youtube channel here!
05-22-2011, 12:19 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Simple help with scripting?

Here, try this:

void OnStart()
{
     AddEntityCollideCallback("Player", "MonsterArea", "MonsterFunc1", true, 1);
}
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
     SetEntityActive("Monsterguy", true);
     AddEnemyPatrolNode("Monsterguy", "Path01", 0, "");
}

05-22-2011, 12:30 AM
Find
KenOfAllTrades Offline
Member

Posts: 53
Threads: 2
Joined: Apr 2011
Reputation: 0
#3
RE: Simple help with scripting?

Thank you SO MUCH!! It worked now, and I learned A LOT about how scripting works in a flash!!

I probably made a LP of this! Youtube channel here!
05-22-2011, 12:24 PM
Find




Users browsing this thread: 2 Guest(s)