Frictional Games Forum (read-only)

Full Version: Help...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Error:
FATAL ERROR: Could not load script file
'custom_stories/Me/maps/Me.hps'!
main (5, 7) : ERR : Data type can't be 'void'
main 2, 25) : ERR : Only objects hace constructors
main (11, 1) : ERR : No matching signatures to 'PlaySoundEntity(string@&, string@&, string@&, const uinst, const boll)'

hps file:

////////////////////////////
// Run first time starting map
void OnStart()
{
void AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

i have followed the instructions both in video and the frictionalgames wiki and i doubled check if i missed something and i cant really see that i missed something, help?
It's PlaySoundAtEntity
Thanks hehe im a noob so excuse me Big Grin

but that didnt solve this

main (5, 7) : ERR : Data type can't be 'void'
main 2, 25) : ERR : Only objects hace constructors

Edit:
i solved them but i need help with this one, i had it Before and couldnt figure it out

main (9, 1) : ERR : Expected '('

you see my hps file above Smile
You don't have to use an void in the OnStart() Remove that and you're done... I hope Wink
Thats just caused Another error so im keeping the " void " :/

other ideas? Big Grin
(04-04-2013, 06:57 PM)Darkboot Wrote: [ -> ]Thats just caused Another error so im keeping the " void " :/

other ideas? Big Grin

Don't keep the void... That won't work. Trust me. Are you sure you have the same the right names and if there's a cache, delete it.

Code:
void OnStart()
{
AddUseItemCallback();
}
You need to post your newest script because we don't know what errors you've fixed and what you've changed.
////////////////////////////
// Run first time starting map

void OnStart()
{
void AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


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

}



Thats how it looks now Smile

and i only get this error:

main (9, 1) : ERR : Expected '('
You need to take out the void before AddUseItemCallback.

Edit: you also need to write
Code:
(string &in asItem, string &in asEntity)
after void UsedKeyOnDoor.
(04-04-2013, 07:22 PM)NaxEla Wrote: [ -> ]You need to take out the void before AddUseItemCallback.

Edit: you also need to write
Code:
(string &in asItem, string &in asEntity)
after void UsedKeyOnDoor.

How do you mean with " take out the void"?
Pages: 1 2 3