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
Scripting Problems !
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#5
RE: Scripting Problems !


You cannot have 2 functions leading to the same void function.. like you cant have both:

AddEntityCollideCallback("Player", "ScriptArea_2", "Scare", true, 1);



and


AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);


have the same "Scare" function. You need to make a new name for the second reaction.

So for the first reaction do what i said and put

AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);



in the OnStart brackets and put the


AddEntityCollideCallback("Player", "ScriptArea_2", "Scare", true, 1);



ALSO in the OnStart brackets but for the second script dont use the Void function "Scare" becasue that is already in use so you have to change it to another name. Lets use Monster in this example. so your OnStart should look like this:


Void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Monster", true, 1);
}


//////// Then when you are making the reaction you have to do a separate void for each function so OUT of the OnStart brackets you should have:


void Scare(string &in asParent, string &in asChild, int alState)

{
///////The functions you want such as sanity damage or noises you want to put in
}


AND


void Monster(string &in asParent, string &in asChild, int alState)

{
/////// Whatever functions you want here.
}


SOOOOO YOUR TOTAL SCRIPT WITH 2 EFFECTS SHOULD LOOK LIKE THIS









Void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Monster", true, 1);
}


void Monster(string &in asParent, string &in asChild, int alState)

{
/////// Whatever functions you want here.
}



void Scare(string &in asParent, string &in asChild, int alState)

{
/////// Whatever functions you want here.
}














Would you like me to send you my HPS file for a part of my custom story so you can get ideas?

09-13-2011, 08:02 PM
Find


Messages In This Thread
Scripting Problems ! - by AmnesiaIsScary :S - 09-12-2011, 02:39 PM
RE: Scripting Problems ! - by Obliviator27 - 09-12-2011, 05:52 PM
RE: Scripting Problems ! - by Itskody - 09-12-2011, 06:04 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-13-2011, 07:40 PM
RE: Scripting Problems ! - by Itskody - 09-13-2011, 08:02 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-13-2011, 08:19 PM
RE: Scripting Problems ! - by Itskody - 09-14-2011, 12:35 AM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:52 AM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 04:10 PM
RE: Scripting Problems ! - by Your Computer - 09-14-2011, 04:24 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:16 PM
RE: Scripting Problems ! - by Your Computer - 09-14-2011, 05:22 PM
RE: Scripting Problems ! - by AmnesiaIsScary :S - 09-14-2011, 05:25 PM



Users browsing this thread: 1 Guest(s)