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 Script Error
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#1
Script Error

Hi. My next script error. main (11,1) ERR: Unexpected token. That's my script:


void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages","Alexander",10);
}

{
AddUseItemCallback("","key1","door1","Door",true);
}

void Door (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)
}
03-30-2014, 08:20 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Script Error

(03-30-2014, 08:20 PM)MaksoPL Wrote: {
AddUseItemCallback("","key1","door1","Door",true);
}

This is your problem. Smile To fix it, simply move it to OnStart().

Try this!

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}

void Message1(string &in asChildstring &in asParentint alState)
{
SetMessage("Messages","Alexander",10); 
}

void Door (string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)


Discord: Romulator#0001
[Image: 3f6f01a904.png]
03-30-2014, 09:04 PM
Find
MaksoPL Offline
Member

Posts: 51
Threads: 26
Joined: Mar 2014
Reputation: 0
#3
RE: Script Error

(03-30-2014, 09:04 PM)Romulator Wrote:
(03-30-2014, 08:20 PM)MaksoPL Wrote: {
AddUseItemCallback("","key1","door1","Door",true);
}

This is your problem. Smile To fix it, simply move it to OnStart().

Try this!

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}

void Message1(string &in asChildstring &in asParentint alState)
{
SetMessage("Messages","Alexander",10); 
}

void Door (string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)


Main (16,1) ERR: Expected ';'
03-30-2014, 09:07 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: Script Error

void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages","Alexander",10);
}

void Door (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false);
}

A missing ; in PlaySoundAtEntity.

Derp.
03-30-2014, 09:21 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#5
RE: Script Error

so you can debug your own files
16,1 means

16 lines down from the top
and
1 character over from the right.

03-30-2014, 10:26 PM
Find




Users browsing this thread: 1 Guest(s)