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
Please check the troubleshooting guides before posting!
slater899 Offline
Junior Member

Posts: 2
Threads: 2
Joined: Jun 2012
Reputation: 0
#1
Please check the troubleshooting guides before posting!

ok so its been about 5 hours now and i still cant get this to work im making a custom story and i followed all the instructions to make a key open a door script and then everytime i try to run the map in game it says unable to load script unexpected end of file. here is my .HPS also i dont have much in the map either just two rooms basically its like a test. please respond asap! Smile
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);


for(int i = 0;i < 10;i++)
{
GiveItemFromFile("tinderbox", "tinderbox.ent");
}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
AddUseItemCallback("", "Newdoorkey_1", "Newdoor", "UsedKeyOnDoor", "true");
{
void UsedDoorKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Newdoor", false, true);
PlaySoundAtEntity("", "","Newdoor", 0, false);
RemoveItem(Newdoorkey_1);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}
06-29-2012, 06:00 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Please check the troubleshooting guides before posting!

At your if(ScriptDebugOn))) and void OnStart(), you forgot the ending bracket "}". Also, you forgot the "" at RemoveItem.
06-29-2012, 07:07 PM
Find
slater899 Offline
Junior Member

Posts: 2
Threads: 2
Joined: Jun 2012
Reputation: 0
#3
RE: Please check the troubleshooting guides before posting!

(06-29-2012, 07:07 PM)FastHunteR Wrote: At your if(ScriptDebugOn))) and void OnStart(), you forgot the ending bracket "}". Also, you forgot the "" at RemoveItem.
Now it says unexpected token for if and for?
06-29-2012, 11:43 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Please check the troubleshooting guides before posting!

Change this:
GiveItemFromFile("tinderbox", "tinderbox.ent");
to this:
GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
After correcting this and it still doesn't work, post the whole corrected script again.
06-29-2012, 11:53 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Please check the troubleshooting guides before posting!

He also should correctly close OnEnter.

Then again, learning the basics would have avoided all of this.

Tutorials: From Noob to Pro
06-29-2012, 11:59 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#6
RE: Please check the troubleshooting guides before posting!

True. the worst is the people who ask for the whole script or tell you to hurry up but are themselves too lazy to watch tutorials on how to script properly/understand the very, very basics.
Anyway, after that it should work. Depends if you made another mistake somewhere in the level editor. Just try it out.
06-30-2012, 12:09 AM
Find




Users browsing this thread: 1 Guest(s)