Frictional Games Forum (read-only)
Script Problems - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script Problems (/thread-20613.html)

Pages: 1 2 3 4 5 6 7 8 9


RE: Script Problems - Coolfromdah00d - 03-09-2013

(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


RE: Script Problems - ExpectedIdentifier - 03-10-2013

You've called two functions the same name.


RE: Script Problems - PutraenusAlivius - 03-10-2013

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


RE: Script Problems - ExpectedIdentifier - 03-10-2013

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


RE: Script Problems - No Author - 03-10-2013

Try this :
PHP Code:
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()
{





RE: Script Problems - Coolfromdah00d - 03-10-2013

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


RE: Script Problems - No Author - 03-10-2013

Strange door is the door named "YOLO" right ?
If so try this :
PHP Code:
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()
{





RE: Script Problems - Coolfromdah00d - 03-10-2013

(03-10-2013, 12:00 PM)No Author Wrote: Strange door is the door named "YOLO" right ?
If so try this :
PHP Code:
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


RE: Script Problems - No Author - 03-10-2013

This ?
PHP Code:
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()
{





RE: Script Problems - Coolfromdah00d - 03-10-2013

(03-10-2013, 12:33 PM)No Author Wrote: This ?
PHP Code:
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