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 teleport script fatal error
putty992 Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jun 2012
Reputation: 0
#1
teleport script fatal error

My script doesnt work its keep getting up "fatal error" when i launch the custom story


void OnStart()
}
AddEntityCollideCallback("Player","TeleportScript", string& asChildName, "NailThatSucker", true, 1);
{

void NailThatSuckerSadstring& asParent, string &in asChild, int alStates);
{
SetEntityActive("TeleportedNakedGuy", true);
AddPropForce("TeleportedNakedGuy", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportedNakedGuy", 0, false);
}


THANKS!!
06-10-2012, 09:00 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: teleport script fatal error

You got the curly brackets wrong the first time, but correct the second time. You got the function header correct the first time, but wrong the second time.

Tutorials: From Noob to Pro
(This post was last modified: 06-10-2012, 09:19 PM by Your Computer.)
06-10-2012, 09:18 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#3
RE: teleport script fatal error

void NailThatSucker:

I think this : is the problem

06-10-2012, 09:22 PM
Find
Science Offline
Junior Member

Posts: 9
Threads: 0
Joined: Jun 2012
Reputation: 0
#4
RE: teleport script fatal error

//Error code

void OnStart()
}
AddEntityCollideCallback("Player","TeleportScript", string& asChildName, "NailThatSucker", true, 1);
{

void NailThatSucker:(string& asParent, string &in asChild, int alStates);
{
-snip-
}


You didn't declare this, instead, you made a new section to the string. Look at the curly braces, { opens and } closes, you have it the other way around in your void OnStart() area. Also, in your function you added a colon ( : ) where it doesn't belong, and a semi-colon doesn't go at the end of a function.



//Good code

void OnStart()
{

AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}


void NailThatSucker(string& asParent, string &in asChild, int alStates)
{
SetEntityActive("TeleportedNakedGuy", true);
AddPropForce("TeleportedNakedGuy", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportedNakedGuy", 0, false);
}

I'm smart enough to know that I'm dumb.
(This post was last modified: 06-10-2012, 09:29 PM by Science.)
06-10-2012, 09:28 PM
Find
putty992 Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jun 2012
Reputation: 0
#5
RE: teleport script fatal error

The fatal error says : FATAL ERROR:could not script file
'Custom_Stories/TEST/custom_stories/TEST/maps/test.hps'!
main (2, 1) :ERR :Expected ',' or ';'
main (4, 1) :ERR :Unexpected token '{'
06-10-2012, 09:30 PM
Find




Users browsing this thread: 1 Guest(s)