Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting issues
Spermaharen Offline
Junior Member

Posts: 8
Threads: 3
Joined: Dec 2011
Reputation: 0
#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
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#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
Website Find
Spermaharen Offline
Junior Member

Posts: 8
Threads: 3
Joined: Dec 2011
Reputation: 0
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
Spermaharen Offline
Junior Member

Posts: 8
Threads: 3
Joined: Dec 2011
Reputation: 0
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
Spermaharen Offline
Junior Member

Posts: 8
Threads: 3
Joined: Dec 2011
Reputation: 0
#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




Users browsing this thread: 1 Guest(s)