Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting issues
Author Message
Spermaharen Offline
Junior Member

Posts: 8
Joined: Dec 2011
Reputation: 0
Post: #1
Scripting issues
Hello Again ! Sorry if i post much of this but is a forum Blush
I,ve done a little script but it dont work when i try to start my custom story i get this error message : Fatal Error : could not load script file !
And my script looks like ! and if i delete the part with the door it works its really enoying so if someone knows please help ! Heart

SPERMAHAREN Cool


void OnStart()
{

AddUseItemCallback("", "Key1", "Door", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{

SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Door", 0, false);
RemoveItem("Key1");

}

//////// KEY 1 DONE

{

AddEntityCollideCallback("Player", "script_1", "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);
}
12-06-2011 09:38 AM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
RE: Scripting issues
Make sure your level file and your script file have the same name.
For example:
example.map
example.hps

12-06-2011 09:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Spermaharen Offline
Junior Member

Posts: 8
Joined: Dec 2011
Reputation: 0
Post: #3
RE: Scripting issues
(12-06-2011 09:54 AM)Tanshaydar Wrote:  Make sure your level file and your script file have the same name.
For example:
example.map
example.hps
My map and hps is same name so it cant be that
Mackan.map
Mackan.hps
12-06-2011 09:56 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,242
Joined: Jul 2011
Reputation: 216
Post: #4
RE: Scripting issues
You have a dangling code block directly under the "KEY 1 DONE" comment.

Tutorials: From Noob to Pro
12-06-2011 10:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Spermaharen Offline
Junior Member

Posts: 8
Joined: Dec 2011
Reputation: 0
Post: #5
RE: Scripting issues
(12-06-2011 10:08 AM)Your Computer Wrote:  You have a dangling code block directly under the "KEY 1 DONE" comment.
void OnStart()
{

AddUseItemCallback("", "Key1", "Door", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{

SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Door", 0, false);
RemoveItem("Key1");

}

//////// KEY 1 DONE

{ <----------------------- Deleted still dont work !

AddEntityCollideCallback("Player", "script_1", "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);
}
12-06-2011 10:27 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,242
Joined: Jul 2011
Reputation: 216
Post: #6
RE: Scripting issues
I'd fix it for you, but i have no idea what that AddEntityCollideCallback's purpose is. Was that code block supposed to be for a function that you forgot to define? Was that AddEntityCollideCallback supposed to go in OnStart but ended up else where? Figure out what you want to happen, then figure out how to make it happen. If you don't know what the purpose of every single thing you've written in the script is, then you're going to get lost again the next time this happens.

Tutorials: From Noob to Pro
12-06-2011 11:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Spermaharen Offline
Junior Member

Posts: 8
Joined: Dec 2011
Reputation: 0
Post: #7
RE: Scripting issues
(12-06-2011 11:57 AM)Your Computer Wrote:  I'd fix it for you, but i have no idea what that AddEntityCollideCallback's purpose is. Was that code block supposed to be for a function that you forgot to define? Was that AddEntityCollideCallback supposed to go in OnStart but ended up else where? Figure out what you want to happen, then figure out how to make it happen. If you don't know what the purpose of every single thing you've written in the script is, then you're going to get lost again the next time this happens.
Im newb at this scripting part i looked at some of your guides awesome !
12-06-2011 12:06 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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