Raymond
Member
Posts: 126
Threads: 24
Joined: Feb 2011
Reputation:
0
|
Why does my SetSwingDoorLocked no effect?
I try to use the key on it but it says " Cannot use this item away". My code is like this: void Onstart()
{
AddUseItemCallback("", "prisonkeylight_1", "mansion_3", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem("prisonkeylight_1");
}
It doesn't have any errors it just doesn't seem to work. Did i put something wrong .
One World To Another [DEMO] coming soon.
|
|
03-19-2011, 05:56 AM |
|
Danny Boy
Posting Freak
Posts: 2,718
Threads: 85
Joined: Mar 2011
Reputation:
81
|
|
03-19-2011, 11:58 AM |
|
Raymond
Member
Posts: 126
Threads: 24
Joined: Feb 2011
Reputation:
0
|
RE: Why does my SetSwingDoorLocked no effect?
I followed "the Make a key unlock a specific door" but still not working.
One World To Another [DEMO] coming soon.
|
|
03-19-2011, 02:35 PM |
|
Danny Boy
Posting Freak
Posts: 2,718
Threads: 85
Joined: Mar 2011
Reputation:
81
|
RE: Why does my SetSwingDoorLocked no effect?
oh! i think i found it!
in the
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
you missed ; at the end!
void UsedKeyOnDoor(string &in asItem, string &in asEntity);
this is the correct one... i hope it helps
|
|
03-19-2011, 02:42 PM |
|
Linus Ågren
Senior Member
Posts: 309
Threads: 58
Joined: Jan 2011
Reputation:
5
|
RE: Why does my SetSwingDoorLocked no effect?
(03-19-2011, 02:42 PM)Danarogon Wrote: oh! i think i found it!
in the
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
you missed ; at the end!
void UsedKeyOnDoor(string &in asItem, string &in asEntity);
this is the correct one... i hope it helps
Callbacks aren't supposed to have ;'s at the end.
Is the door named "mansion_3" and the key prisonkeylight_1?
Creator of The Dark Treasure.
|
|
03-19-2011, 03:07 PM |
|
Raymond
Member
Posts: 126
Threads: 24
Joined: Feb 2011
Reputation:
0
|
RE: Why does my SetSwingDoorLocked no effect?
(03-19-2011, 02:42 PM)Danarogon Wrote: oh! i think i found it!
in the
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
you missed ; at the end!
void UsedKeyOnDoor(string &in asItem, string &in asEntity);
this is the correct one... i hope it helps
The video didn't tell me to put the ";". Besides, when i put the ";" it gives me an error said "Unexpected {".
One World To Another [DEMO] coming soon.
|
|
03-19-2011, 03:16 PM |
|
Danny Boy
Posting Freak
Posts: 2,718
Threads: 85
Joined: Mar 2011
Reputation:
81
|
RE: Why does my SetSwingDoorLocked no effect?
oh... right sorry i haven't noticed i didn't had it either in my own code... well so the best thing i can tell you is that try to save the map before you test it... sometimes stupid stuff like thus happens because i fergot to save the map. or you cold try to make code from scratch again and if it does not work i hope someone whit more knolage about scripting than me helps you out.
|
|
03-19-2011, 03:40 PM |
|
Pandemoneus
Senior Member
Posts: 328
Threads: 2
Joined: Sep 2010
Reputation:
0
|
RE: Why does my SetSwingDoorLocked no effect?
You wrote Onstart().
It has to be OnStart().
Noticed the difference?
|
|
03-19-2011, 04:17 PM |
|
Nye
Senior Member
Posts: 250
Threads: 8
Joined: Jan 2011
Reputation:
2
|
RE: Why does my SetSwingDoorLocked no effect?
(03-19-2011, 04:17 PM)Pandemoneus Wrote: You wrote Onstart().
It has to be OnStart().
Noticed the difference?
In case you don't notice the difference, it needs to be capitalised 100% accurately. Scripting is very case sensitive, so be careful in future!
|
|
03-19-2011, 07:54 PM |
|
Raymond
Member
Posts: 126
Threads: 24
Joined: Feb 2011
Reputation:
0
|
RE: Why does my SetSwingDoorLocked no effect?
(03-19-2011, 07:54 PM)Nye Wrote: (03-19-2011, 04:17 PM)Pandemoneus Wrote: You wrote Onstart().
It has to be OnStart().
Noticed the difference?
In case you don't notice the difference, it needs to be capitalised 100% accurately. Scripting is very case sensitive, so be careful in future!
I see the difference. Onstart = OnStart, i forgotten the capital S.
Thanks.
One World To Another [DEMO] coming soon.
|
|
03-20-2011, 04:06 AM |
|
|