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
Script Help Help...
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#1
Help...

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?
(This post was last modified: 04-04-2013, 05:43 PM by Darkboot.)
04-04-2013, 05:38 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: Help...

It's PlaySoundAtEntity
04-04-2013, 06:07 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#3
RE: Help...

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
(This post was last modified: 04-04-2013, 06:26 PM by Darkboot.)
04-04-2013, 06:20 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#4
RE: Help...

You don't have to use an void in the OnStart() Remove that and you're done... I hope Wink
04-04-2013, 06:38 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#5
RE: Help...

Thats just caused Another error so im keeping the " void " :/

other ideas? Big Grin
04-04-2013, 06:57 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#6
RE: Help...

(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.

void OnStart()
{
AddUseItemCallback();
}
04-04-2013, 07:08 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#7
RE: Help...

You need to post your newest script because we don't know what errors you've fixed and what you've changed.

In Ruins [WIP]
04-04-2013, 07:16 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#8
RE: Help...

////////////////////////////
// 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 '('
(This post was last modified: 04-04-2013, 07:19 PM by Darkboot.)
04-04-2013, 07:18 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#9
RE: Help...

You need to take out the void before AddUseItemCallback.

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

In Ruins [WIP]
(This post was last modified: 04-04-2013, 07:26 PM by NaxEla.)
04-04-2013, 07:22 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#10
RE: Help...

(04-04-2013, 07:22 PM)NaxEla Wrote: You need to take out the void before AddUseItemCallback.

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

How do you mean with " take out the void"?
04-04-2013, 07:37 PM
Find




Users browsing this thread: 1 Guest(s)