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

Posts: 10
Joined: Jun 2012
Reputation: 0
Post: #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 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);
}


THANKS!!
06-10-2012 09:00 PM
Find all posts by this user Quote this message in a reply
Robosprog Offline
Posting Freak

Posts: 2,216
Joined: Apr 2012
Reputation: 57
Post: #2
RE: teleport script fatal error
... Good god, I hope Corinthian doesn't spot this.
Does it say anything other than Fatal Error when launching the custom story?

06-10-2012 09:06 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #3
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
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #4
RE: teleport script fatal error
void NailThatSucker:

I think this : is the problem

06-10-2012 09:22 PM
Find all posts by this user Quote this message in a reply
Science Offline
Junior Member

Posts: 9
Joined: Jun 2012
Reputation: 0
Post: #5
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 all posts by this user Quote this message in a reply
putty992 Offline
Junior Member

Posts: 10
Joined: Jun 2012
Reputation: 0
Post: #6
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 all posts by this user Quote this message in a reply
Post Reply 




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