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
Script Help script help
Author Message
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #1
script help
AddEntityCollideCallback("player", "Monster_Deactivate_1", "DeactivateGrunt", true, 1);
}

void DeactivateGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}

is there anything wrong in that i get no error but the script doesnt work by the names you should know what i am trying to do so is anything wrong in it?
04-04-2012 12:15 PM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #2
RE: script help
(04-04-2012 12:15 PM)zombiehacker595 Wrote:  AddEntityCollideCallback("player", "Monster_Deactivate_1", "DeactivateGrunt", true, 1);
}

void DeactivateGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}

is there anything wrong in that i get no error but the script doesnt work by the names you should know what i am trying to do so is anything wrong in it?
There is something called "debug messages" that can help you track down the root of your many problems. Just add the following in various places of your code:
AddDebugMessage("Well, at least this part of the code was executed.", false);

Just by setting this line inside your DeactivateGrunt() function, you can find out if the first two lines are working as they should or not.

Noob scripting tutorial: From Noob to Pro

04-04-2012 12:39 PM
Find all posts by this user Quote this message in a reply
JetlinerX Offline
Senior Member

Posts: 601
Joined: Jun 2011
Reputation: 19
Post: #3
RE: script help
Just making sure... you do have a "{" before your Collide right? Such as:

{
AddEntityCollideCallback("player", "Monster_Deactivate_1", "DeactivateGrunt", true, 1);
}

void DeactivateGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 04-04-2012 03:47 PM by JetlinerX.)
04-04-2012 03:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 622
Joined: Dec 2011
Reputation: 12
Post: #4
RE: script help
Try this
{
AddEntityCollideCallback("Player", "Monster_Deactivate_1", "DeactivateGrunt", true, 1);
}

void DeactivateGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}
The addentitycollidecallback had player and i think its supposed to be capitalized like Player try that

04-04-2012 06:00 PM
Find all posts by this user Quote this message in a reply
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #5
RE: script help
(04-04-2012 12:15 PM)zombiehacker595 Wrote:  AddEntityCollideCallback("player", "Monster_Deactivate_1", "DeactivateGrunt", true, 1);
}

void DeactivateGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}

is there anything wrong in that i get no error but the script doesnt work by the names you should know what i am trying to do so is anything wrong in it?
{
AddEntityCollideCallback("player", "Monster_Deactivate_1", "DeactivateGrunt", true, 1);
}

void DeactivateGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", false);
}



try that

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-04-2012 06:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #6
RE: script help
Is the grunt called "servant_grunt_2"?
Is the area called "Monster_Deactivate_1"?

Try capitalizing "player" to "Player".
04-04-2012 07:53 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 622
Joined: Dec 2011
Reputation: 12
Post: #7
RE: script help
(04-04-2012 07:53 PM)Putmalk Wrote:  Is the grunt called "servant_grunt_2"?
Is the area called "Monster_Deactivate_1"?

Try capitalizing "player" to "Player".
I already said that capitalizing the player to Player now we just wait for the answer did it work Big Grin

04-04-2012 08:01 PM
Find all posts by this user Quote this message in a reply
Putmalk Offline
Senior Member

Posts: 275
Joined: Apr 2012
Reputation: 15
Post: #8
RE: script help
(04-04-2012 08:01 PM)Datguy5 Wrote:  
(04-04-2012 07:53 PM)Putmalk Wrote:  Is the grunt called "servant_grunt_2"?
Is the area called "Monster_Deactivate_1"?

Try capitalizing "player" to "Player".
I already said that capitalizing the player to Player now we just wait for the answer did it work Big Grin
Yup, hopefully. Smile
04-04-2012 09:15 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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