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
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#71
RE: Script Problems

(03-13-2013, 05:26 PM)Coolfromdah00d Wrote:
(03-13-2013, 05:14 PM)Adrianis Wrote: EDIT: Wait, you've got 2 functions called UsedKeyOnDoor. Name one of those different, because as it is that won't work

I've tried to name it something else but then it cant find the function (or cant read it) any idea what I can name it to?

void OnStart ()
{
AddUseItemCallback("", "StrangeDoorKey", "door03", "UsedKeyOnDoor2", false);
SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false);
}


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);
GiveSanityDamage(5.0f, true);
}

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

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

(This post was last modified: 03-13-2013, 05:39 PM by Adrianis.)
03-13-2013, 05:38 PM
Find
Coolfromdah00d Offline
Junior Member

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

(03-13-2013, 05:38 PM)Adrianis Wrote:
(03-13-2013, 05:26 PM)Coolfromdah00d Wrote:
(03-13-2013, 05:14 PM)Adrianis Wrote: EDIT: Wait, you've got 2 functions called UsedKeyOnDoor. Name one of those different, because as it is that won't work

I've tried to name it something else but then it cant find the function (or cant read it) any idea what I can name it to?

void OnStart ()
{
AddUseItemCallback("", "StrangeDoorKey", "door03", "UsedKeyOnDoor2", false);
SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false);
}


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);
GiveSanityDamage(5.0f, true);
}

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

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

a function with the same name and parameter already exists.
03-13-2013, 05:47 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#73
RE: Script Problems

That doesn't make any sense... thats the message you should have been getting before...
Did you definately overwrite all of the previous script with this one, and saved the script before loading the map?

Try this...

void OnStart ()
{
AddUseItemCallback("", "StrangeDoorKey", "door03", "UsedKeyOnDoor", false);
SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false);
}


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


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);
GiveSanityDamage(5.0f, true);
}

03-13-2013, 06:00 PM
Find
PutraenusAlivius Offline
Posting Freak

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

PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("""StrangeDoorKey""door03""UsedKeyOnDoor2"false);
SetEntityCallbackFunc("GuestRoomKey""jump");
AddUseItemCallback("""GuestRoomKey""door01""UsedKeyOnDoor"false);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door.snt"asEntity0false);
RemoveItem(asItem);
}

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

void UsedKeyOnDoor2(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door.snt"asEntity0false);
RemoveItem(asItem);

I also added a few things from Adrianis' script.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 03-14-2013, 06:51 AM by PutraenusAlivius.)
03-14-2013, 06:47 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#75
RE: Script Problems

(03-14-2013, 06:47 AM)JustAnotherPlayer Wrote: *code*

I also added a few things from Adrianis' script.

Check the previous script dude - you can fit it all into 1 function using the parameters rather than hard coded names, and having the 2 functions didn't work, he said

03-14-2013, 10:34 AM
Find
Coolfromdah00d Offline
Junior Member

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

(03-14-2013, 10:34 AM)Adrianis Wrote:
(03-14-2013, 06:47 AM)JustAnotherPlayer Wrote: *code*

I also added a few things from Adrianis' script.

Check the previous script dude - you can fit it all into 1 function using the parameters rather than hard coded names, and having the 2 functions didn't work, he said

Guess the message that shows up when I try to use the key on the door...
03-14-2013, 09:39 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#77
RE: Script Problems

I'd really rather you told me Smile

The whole error message if that's ok, cause it might help

03-15-2013, 12:59 AM
Find
PutraenusAlivius Offline
Posting Freak

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

Eight pages. Longest script error thread ever.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-15-2013, 05:39 AM
Find
No Author Offline
Posting Freak

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

(03-14-2013, 09:39 PM)Coolfromdah00d Wrote: Guess the message that shows up when I try to use the key on the door...

Cannot use item ?

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

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

(03-15-2013, 05:40 AM)No Author Wrote:
(03-14-2013, 09:39 PM)Coolfromdah00d Wrote: Guess the message that shows up when I try to use the key on the door...

Cannot use item ?

yep
03-15-2013, 06:10 PM
Find




Users browsing this thread: 2 Guest(s)