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 Problems
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#31
RE: Script Problems

(03-06-2013, 03:47 PM)Coolfromdah00d Wrote:
(03-05-2013, 10:19 PM)darksky Wrote: what's the exact error message?

unexpected token {

void OnStart (){
AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoor", true);

SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
}


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

{
SetSwingDoorLocked("YOLO", false, true);
PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{

}


I am sorry... I am a beginner with codes....I'm not so old and I've looked everywhere I can on the page. I've remade the codes so many times I've lost the count. but I just cant find the error... it says ERR:25, 1 a function with the same name and parameters already exists. If you'd help me with this it'd be great. PS: I will try not to use you guys as my coders more.

(03-09-2013, 11:28 PM)Coolfromdah00d Wrote:
(03-06-2013, 03:47 PM)Coolfromdah00d Wrote:
(03-05-2013, 10:19 PM)darksky Wrote: what's the exact error message?

unexpected token {

void OnStart (){
AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoor", true);

SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
}


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

{
SetSwingDoorLocked("YOLO", false, true);
PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{

}


I am sorry... I am a beginner with codes....I'm not so old and I've looked everywhere I can on the page. I've remade the codes so many times I've lost the count. but I just cant find the error... it says ERR:25, 1 a function with the same name and parameters already exists. If you'd help me with this it'd be great. PS: I will try not to use you guys as my coders more.

I'm trying to fix so a key can open door YOLO
(This post was last modified: 03-09-2013, 11:29 PM by Coolfromdah00d.)
03-09-2013, 11:28 PM
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#32
RE: Script Problems

You've called two functions the same name.
03-10-2013, 02:21 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#33
RE: Script Problems

(03-10-2013, 02:21 AM)sonataarctica Wrote: You've called two functions the same name.

It was UsedKeyOnDoor right? I bet this guy is a hipster. Why? he used the word "YOLO" a few times.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-10-2013, 02:34 AM
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#34
RE: Script Problems

(03-10-2013, 02:34 AM)JustAnotherPlayer Wrote:
(03-10-2013, 02:21 AM)sonataarctica Wrote: You've called two functions the same name.

It was UsedKeyOnDoor right? I bet this guy is a hipster. Why? he used the word "YOLO" a few times.

Yeah I saw that and it annoyed me but I didn't say anything haha.
03-10-2013, 02:35 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#35
RE: Script Problems

Try this :
PHP Code: (Select All)
void OnStart (){ 
   
AddUseItemCallback("""StrangeDoorKey""YOLO""UsedKeyOnDoor"true);

   
SetEntityCallbackFunc("GuestRoomKey""jump");
   
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoorYOLO"true);
}
     

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UsedKeyOnDoorYOLO(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("YOLO"falsetrue);
PlaySoundAtEntity("""Unlock_door""YOLO"0false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{



[Image: the-cabin-in-the-woods-masked-people.jpg]
03-10-2013, 03:15 AM
Find
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#36
RE: Script Problems

(03-10-2013, 02:34 AM)JustAnotherPlayer Wrote:
(03-10-2013, 02:21 AM)sonataarctica Wrote: You've called two functions the same name.

It was UsedKeyOnDoor right? I bet this guy is a hipster. Why? he used the word "YOLO" a few times.

You know I hate all swagfags and yolo and shit. I just tried to name door02 someting else and the first thing that came up in my head was YOLO. so I tried it out......

(03-10-2013, 03:15 AM)No Author Wrote: Try this :
PHP Code: (Select All)
void OnStart (){ 
   
AddUseItemCallback("""StrangeDoorKey""YOLO""UsedKeyOnDoor"true);

   
SetEntityCallbackFunc("GuestRoomKey""jump");
   
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoorYOLO"true);
}
     

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UsedKeyOnDoorYOLO(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("YOLO"falsetrue);
PlaySoundAtEntity("""Unlock_door""YOLO"0false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{


nope that didnt work. I can enter the map now but it says "cannot use this item this way" on strange door....
(This post was last modified: 03-10-2013, 11:50 AM by Coolfromdah00d.)
03-10-2013, 11:37 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#37
RE: Script Problems

Strange door is the door named "YOLO" right ?
If so try this :
PHP Code: (Select All)
void OnStart (){ 
   
AddUseItemCallback("""StrangeDoorKey""YOLO""UsedKeyOnDoorYOLO"true);

   
SetEntityCallbackFunc("GuestRoomKey""jump");
   
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoor"true);
}
     

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UsedKeyOnDoorYOLO(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("YOLO"falsetrue);
PlaySoundAtEntity("""Unlock_door""YOLO"0false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{



[Image: the-cabin-in-the-woods-masked-people.jpg]
(This post was last modified: 03-10-2013, 12:00 PM by No Author.)
03-10-2013, 12:00 PM
Find
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#38
RE: Script Problems

(03-10-2013, 12:00 PM)No Author Wrote: Strange door is the door named "YOLO" right ?
If so try this :
PHP Code: (Select All)
void OnStart (){ 
   
AddUseItemCallback("""StrangeDoorKey""YOLO""UsedKeyOnDoorYOLO"true);

   
SetEntityCallbackFunc("GuestRoomKey""jump");
   
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoor"true);
}
     

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UsedKeyOnDoorYOLO(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("YOLO"falsetrue);
PlaySoundAtEntity("""Unlock_door""YOLO"0false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{



Still says cannot use this item this way
03-10-2013, 12:32 PM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#39
RE: Script Problems

This ?
PHP Code: (Select All)
void OnStart (){ 
   
AddUseItemCallback("""StrangeDoorKey""YOLO""UsedKeyOnDoorYOLO"false);

   
SetEntityCallbackFunc("GuestRoomKey""jump");
   
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoor"false);
}
     

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UsedKeyOnDoorYOLO(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("YOLO"falsetrue);
PlaySoundAtEntity("""Unlock_door""YOLO"0false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{



[Image: the-cabin-in-the-woods-masked-people.jpg]
03-10-2013, 12:33 PM
Find
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#40
RE: Script Problems

(03-10-2013, 12:33 PM)No Author Wrote: This ?
PHP Code: (Select All)
void OnStart (){ 
   
AddUseItemCallback("""StrangeDoorKey""YOLO""UsedKeyOnDoorYOLO"false);

   
SetEntityCallbackFunc("GuestRoomKey""jump");
   
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoor"false);
}
     

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door01"falsetrue);
PlaySoundAtEntity("""Unlock_door""door01"0false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntitystring &in type)
{
SetEntityActive("corpse01"true);
PlaySoundAtEntity("""12_girl_scream.snt""corpse01"0false);
StartScreenShake(0.5f200.25);
}


void UsedKeyOnDoorYOLO(string &in asItemstring &in asEntity)

{
SetSwingDoorLocked("YOLO"falsetrue);
PlaySoundAtEntity("""Unlock_door""YOLO"0false);
RemoveItem("StrangeDoorKey");
}


void OnEnter()
{

}

void OnLeave()
{



nope
03-10-2013, 12:39 PM
Find




Users browsing this thread: 3 Guest(s)