Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
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 |
|
Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
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 |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
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 |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Script Problems
void OnStart() { AddUseItemCallback("", "StrangeDoorKey", "door03", "UsedKeyOnDoor2", false); SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "unlock_door.snt", 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); }
void UsedKeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false); RemoveItem(asItem); }
I also added a few things from Adrianis' script.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-14-2013, 06:47 AM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
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 |
|
Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
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 |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
RE: Script Problems
I'd really rather you told me
The whole error message if that's ok, cause it might help
|
|
03-15-2013, 12:59 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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 ?
|
|
03-15-2013, 05:40 AM |
|
Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
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 |
|
|