Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Need help displaying door is locked on non-exit doors.
The issue, aside from the fact that the callback setter is in a random code block, is that Door != locked_door.
|
|
02-13-2012, 04:46 AM |
|
julianprokop
Junior Member
Posts: 19
Threads: 7
Joined: Nov 2011
Reputation:
0
|
RE: Need help displaying door is locked on non-exit doors.
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
Just a brief description!
</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_roomkey">"Room Key"</Entry>
<Entry Name="ItemName_roomkey">"Room Key"</Entry>
</CATEGORY>
<CATAGORY Name="Doors">
<Entry Name = "door"> The door seems to be locked and needs a key.</Entry>
</CATAGORY>
</LANGUAGE>
I also, went back and changed "Door" to "locked_door" in the if statement.
Still nothing.
(This post was last modified: 02-13-2012, 06:02 AM by julianprokop.)
|
|
02-13-2012, 05:54 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Need help displaying door is locked on non-exit doors.
I can't find anything wrong with the language file. Add a debug message using:
AddDebugMessage("it works", true);
Into the function. Turn on debug messages on developer mode and test doing the same thing. This will eliminate if the callback doesn't work; or if the .lang file has something wrong with it.
Sorry, I don't know what else to do about this :/
|
|
02-13-2012, 06:59 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Need help displaying door is locked on non-exit doors.
You spelled category wrong for the Doors category.
|
|
02-13-2012, 07:38 AM |
|
Linus Ågren
Senior Member
Posts: 309
Threads: 58
Joined: Jan 2011
Reputation:
5
|
RE: Need help displaying door is locked on non-exit doors.
I noticed an error in your LANG file.
<Entry Name="ItemDesc_roomkey">"Room Key"</Entry> <Entry Name="ItemName_roomkey">"Room Key"</Entry>
You have written Room Key as "Room Key". Remove the "s and it should probably work.
Also, you named it CATAGORY and not CATEGORY at the bottom.
If you want to do SilentStriker's method with local vars, here's one example.
Example:
On your UseItemCallback, add:
SetLocalVarInt("doorUnlocked", 1);
And on your InteractCallback, do something like:
void CALLBACK(string &in asEntity) { if(GetLocalVarInt("doorUnlocked") == 0) //As long as "doorUnlocked" is 0, the message will be displayed, so when you use the key on the door, the message should disappear. { SetMessage("Messages", "DoorLocked", 3.0f); } }
Creator of The Dark Treasure.
(This post was last modified: 02-13-2012, 07:52 AM by Linus Ågren.)
|
|
02-13-2012, 07:45 AM |
|
julianprokop
Junior Member
Posts: 19
Threads: 7
Joined: Nov 2011
Reputation:
0
|
RE: Need help displaying door is locked on non-exit doors.
This is what I've got, and it doesn't work still I fixed the .lang file though a while ago.
/////////CALLBACK
{
AddUseItemCallback("", "key_study_1", "door_locked", "UsedKeyOnDoor", true);
SetLocalVarInt("doorUnlocked", 1);
}
////////LOCKED DOOR MESSAGE
void door_message(string &in asEntity)
{
if(GetLocalVarInt("doorUnlocked") == 0)
{
SetMessage("Doors", "door", 3.0f);
}
}
|
|
02-13-2012, 09:23 AM |
|
Linus Ågren
Senior Member
Posts: 309
Threads: 58
Joined: Jan 2011
Reputation:
5
|
RE: Need help displaying door is locked on non-exit doors.
Put the LocalVarInt code inside your UsedKeyOnDoor function.
Creator of The Dark Treasure.
|
|
02-13-2012, 10:17 AM |
|
julianprokop
Junior Member
Posts: 19
Threads: 7
Joined: Nov 2011
Reputation:
0
|
RE: Need help displaying door is locked on non-exit doors.
Like this?
/////////CALLBACK
{
AddUseItemCallback("", "key_study_1", "door_locked", "UsedKeyOnDoor", true);
}
////////LOCKED DOOR MESSAGE
void door_message(string &in asEntity)
{
if(GetLocalVarInt("doorUnlocked") == 0)
{
SetMessage("Doors", "door", 3.0f);
}
}
////////USED KEY ON DOOR
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_locked", false, true);
PlaySoundAtEntity("", "unlock_door", "door_locked", 0, false);
RemoveItem("study_key_1");
AddDebugMessage("KeyOnDoor", false);
SetLocalVarInt("doorUnlocked", 1);
}
|
|
02-13-2012, 10:23 AM |
|
onv
Member
Posts: 51
Threads: 12
Joined: Feb 2012
Reputation:
2
|
RE: Need help displaying door is locked on non-exit doors.
Is your door a Level Door ? or just a normal door ?
For the level doors , you can use this void SetLevelDoorLockedText(string& asName, string& asTextCat, string& asTextEntry);
Displays a message when interacting with a locked level door.
asName - internal name
asTextCat - the category in the .lang file
asTextEntry - the entry in the .lang file
:
|
|
02-14-2012, 10:55 AM |
|
Ninami
Member
Posts: 59
Threads: 6
Joined: Feb 2012
Reputation:
2
|
RE: Need help displaying door is locked on non-exit doors.
Sorry but you're not even using the functions they told you to use?
They told you to use:
"SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);"
And I can't find that function in your script...
I'm currently on a Mac so I can't help you but your script is totally wrong. If you still have problems when I'm on my PC then I'll help you.
|
|
02-15-2012, 05:58 AM |
|
|