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
Error when loading second map
Ubermensch Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2016
Reputation: 0
#1
Error when loading second map

So I just finished scripting my first map. Here's the .hps file:

Spoiler below!
void OnStart()
{
AddUseItemCallback("", "lockpick", "introcelldoor", "UseKeyOnDoor", true);
AddUseItemCallback("", "BlockBKey", "BlockB", "UseKeyOnLevelDoor", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)

{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void UseKeyOnLevelDoor(string &in asItem, string &in asEntity)

{
SetLevelDoorLocked(asEntity, false);
PlaySoundAtEntity("", "door_sewer_unlock.snt", asEntity, 0, false);
RemoveItem(asItem);
CompleteQuest("touchblockdoor", "BlockBLocked");
GiveSanityBoost();
}

void touchblockdoor(string &in asEntity)

{
AddQuest("touchblockdoor", "BlockBLocked");
}

After that, I made the .hps file for my second map. Here it is:

Spoiler below!
void OnStart()
{
SetEntityPlayerLookAtCallback("", "lookatcorpse", true);
}

void lookatcorpse(string &in asEntity, 1)

{
GiveSanityDamage(25.0f, true)
}

The issue here is that the second map does not load. Since I'm pretty new to the editor and scripting it could be a little bit silly. Anyways, the error that shows up is:

Spoiler below!
FATAL ERROR
Couldn't load (map name and directory here)
ExecuteString (1,1): ERR : No matching signatures to 'OnLeave()'
main (6, 40) : ERR : Expected data type


I did try some things, but I'm kinda lost here so any help is appreciated! Tongue

p.s: looks like I posted in the wrong section. my bad. Confused
(This post was last modified: 10-16-2016, 10:00 PM by Ubermensch.)
10-16-2016, 09:47 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Error when loading second map

The issue is that your parameters for your "lookatcorpse" function are incorrect. You're not supposed to edit anything in the parameters after you copy them to your script because they need to match what is required by the function call.

SetEntityPlayerLookAtCallback requires these parameters:

void MyFunc(string &in asEntity, int alState)

So that's what you must use. Replace the 1 with "int alState".

Also, in your OnStart, you didn't specify which entity the player must look at to call this event, so it will never happen.

10-16-2016, 10:24 PM
Find
Ubermensch Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2016
Reputation: 0
#3
RE: Error when loading second map

(10-16-2016, 10:24 PM)Mudbill Wrote: The issue is that your parameters for your "lookatcorpse" function are incorrect. You're not supposed to edit anything in the parameters after you copy them to your script because they need to match what is required by the function call.

SetEntityPlayerLookAtCallback requires these parameters:

void MyFunc(string &in asEntity, int alState)

So that's what you must use. Replace the 1 with "int alState".

Also, in your OnStart, you didn't specify which entity the player must look at to call this event, so it will never happen.

Hm... Thanks! I'll let you know how it went when I modify the script.
(This post was last modified: 10-16-2016, 10:53 PM by Ubermensch.)
10-16-2016, 10:39 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Error when loading second map

By the way, in case you haven't yet, just look at the engine scripts page for all the references of what the callback syntaxes are.

https://wiki.frictionalgames.com/doku.ph..._functions

10-17-2016, 12:24 AM
Find
Ubermensch Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2016
Reputation: 0
#5
RE: Error when loading second map

Oh, it worked!

Thanks a bunch. Big Grin
10-17-2016, 01:31 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#6
RE: Error when loading second map

Your friendly neighbourhood moderator here;

Don't worry about the posting in the wrong section Smile Eventually myself or someone else will move it for you Smile Glad to hear you got your issue solved!

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 10-17-2016, 01:53 PM by Romulator.)
10-17-2016, 01:52 PM
Find




Users browsing this thread: 2 Guest(s)