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 script help
zombiehacker595 Offline
Member

Posts: 141
Threads: 51
Joined: Mar 2012
Reputation: 3
#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 Reply
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#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 Reply
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#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
Website Find Reply
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#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 Reply
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#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
Website Find Reply
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#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 Reply
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#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 Reply
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#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 Reply




Users browsing this thread: 1 Guest(s)