Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Problem
Author Message
jmayo Offline
Junior Member

Posts: 18
Joined: Sep 2011
Reputation: 0
Post: #1
Another Problem
I Am Trying to make The monster Spawn When You Go To The Script Area And I Tried This:

AddEntityCollideCallback("Player", "monster", "MonsterStart", true, 1);
}

void MonsterStart(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "endNode", 9999.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 9999.0f, "");
}

But I Got an error Can You help me Exclamation
10-05-2011 11:46 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
RE: Another Problem
Is this whole script file?
Also, what kind of error do you get?
Also, why did you write 9999.0f for the waiting time?

10-06-2011 12:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
jmayo Offline
Junior Member

Posts: 18
Joined: Sep 2011
Reputation: 0
Post: #3
RE: Another Problem
I Took That Part From Another Story
And No Its Not The Whole script The Rest is For Unlocking A Door
10-06-2011 12:08 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #4
RE: Another Problem
You're going to need to post more than that and also provide us with the error you got.

Tutorials: From Noob to Pro
10-06-2011 01:01 AM
Visit this user's website Find all posts by this user Quote this message in a reply
jmayo Offline
Junior Member

Posts: 18
Joined: Sep 2011
Reputation: 0
Post: #5
RE: Another Problem
[Image: erroris.png]

Here Is The Whole Script:

////////////////////////////+
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Prisonkey_1", "prison_1", "usedkeyondoor", true);
}
void usedkeyondoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_1", 0, false);
RemoveItem("Prisonkey_1");
}

{
AddEntityCollideCallback("Player", "monster", "MonsterStart", true, 1);
}

void MonsterStart(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "endNode", 9999.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 9999.0f, "");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
10-07-2011 12:16 AM
Find all posts by this user Quote this message in a reply
Gamemakingdude Offline
Senior Member

Posts: 478
Joined: Nov 2010
Reputation: 9
Post: #6
RE: Another Problem
PHP Code: (Select All)
////////////////////////////+
// Run first time starting map
void OnStart()
{
AddUseItemCallback("""Prisonkey_1""prison_1""usedkeyondoor"true);
AddEntityCollideCallback("Player""monster""MonsterStart"true1);
}
void usedkeyondoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("prison_1"falsetrue);
PlaySoundAtEntity("""unlock_door""prison_1"0false);
RemoveItem("Prisonkey_1");
}



void MonsterStart(string &in asParentstring &in asChildint alState)
{
SetEntityActive("servant_grunt_1"true);
AddEnemyPatrolNode("servant_grunt_1""endNode"9999.0f"");
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"9999.0f"");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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



Always put your call backs in the onStart() Proc and not anywhere in the code!

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011 12:18 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)