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
How can i separated script commands in Notepad++?
hecike3 Offline
Junior Member

Posts: 1
Threads: 1
Joined: Nov 2012
Reputation: 0
#1
How can i separated script commands in Notepad++?

firstly . sorry for my bad english i m ,from hungary!
second Confusedorry for the noob question ,but i am newbie!

For example : i crated a script in 00_test.hps

it looks like this :


////////////////////////////
// Run first time starting map
void OnStart(){
SetEntityCallbackFunc("key", "jump");
}

void jump(string &in asEntity, string &in type) {
SetEntityActive("pig",true);
PlayGuiSound("21/21_scream10.ogg",1.0f);
StartScreenShake(0.5f,2,0,0.25);
}

Now i want to add a new script . for example this :

void OnStart()

{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}void OnStart()

{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

But i've got an error and it sead " OnStart is the same and the parameters"

Now what can i do and how can i debbuging this ?

Please help me gusy! *-*
11-12-2012, 05:11 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: How can i separated script commands in Notepad++?

You should only have 1 void OnStart(). Try this:

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityCallbackFunc("key", "jump");
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void jump(string &in asEntity, string &in type)
{
SetEntityActive("pig",true);
PlayGuiSound("21/21_scream10.ogg",1.0f);
StartScreenShake(0.5f,2,0,0.25);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
11-12-2012, 05:42 PM
Find




Users browsing this thread: 1 Guest(s)