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
01.hps FATAL ERROR Help!! [FIXED]
theveeus Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jul 2012
Reputation: 0
#1
01.hps FATAL ERROR Help!! [FIXED]

Please someone help me, i cant get my map to open, i get this error "FATAL ERROR: Could not load script file 'custom_stories/Test/maps/01.hps(01 is the name of the .map file too)!' main (8,32): ERR : Expected data type"


////////////////////////////
// Run first time starting map
void OnEnter()
{
AddUseItemCallback("", "DoorKey_1", "EXAMPLE_DOOR", "UsedKeyOnDoor", true);
}
void MyFunc(string &in asItem, &in asEntity)
{
SetSwingDoorLocked("EXAMPLE_DOOR", false, true);
PlaySoundAtEntity("", "unlock_door", "EXAMPLE_DOOR", 0, false);
RemoveItem(DoorKey_1);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Thank you!!
(This post was last modified: 07-26-2012, 05:05 PM by theveeus.)
07-25-2012, 10:18 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: 01.hps FATAL ERROR Help!!

MyFunc

^ there you have your problem. You are calling the function UsedKeyOnDoor but the function is named MyFunc it should be named UsedKeyOnDoor.

also is you door named EXAMPLE_DOOR? and is your key named DoorKey_1? and you need to change this to RemoveItem("DoorKey_1");

and put the AddUseItemCallback on OnStart and the MyFunc function under the OnStart like you have now but under the OnStart instead of OnEnter

07-25-2012, 10:22 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: 01.hps FATAL ERROR Help!!

You didn't declare (which means put into quotations) "DoorKey_1", and the name of the function UsedKeyOnDoor didn't match MyFunc. I also put the callbacks under OnStart instead of OnEnter. Here's the revision:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "DoorKey_1", "EXAMPLE_DOOR", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("EXAMPLE_DOOR", false, true);
PlaySoundAtEntity("", "unlock_door", "EXAMPLE_DOOR", 0, false);
RemoveItem("DoorKey_1");
}

///on enter
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

I rate it 3 memes.
(This post was last modified: 07-25-2012, 10:25 PM by Adny.)
07-25-2012, 10:24 PM
Find
theveeus Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jul 2012
Reputation: 0
#4
RE: 01.hps FATAL ERROR Help!!

thank you very much, im really a noob with this stuff Smile
07-25-2012, 11:18 PM
Find




Users browsing this thread: 1 Guest(s)