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
.Lang File Help Need help displaying door is locked on non-exit doors.
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#11
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.

Tutorials: From Noob to Pro
02-13-2012, 04:46 AM
Website Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#12
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
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#13
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
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#14
RE: Need help displaying door is locked on non-exit doors.

You spelled category wrong for the Doors category.

Tutorials: From Noob to Pro
02-13-2012, 07:38 AM
Website Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#15
RE: Need help displaying door is locked on non-exit doors.

I noticed an error in your LANG file.

PHP Code: (Select All)
<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:

PHP Code: (Select All)
SetLocalVarInt("doorUnlocked"1); 

And on your InteractCallback, do something like:

PHP Code: (Select All)
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
Website Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#16
RE: Need help displaying door is locked on non-exit doors.


This is what I've got, and it doesn't work still Sad 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
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#17
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
Website Find
julianprokop Offline
Junior Member

Posts: 19
Threads: 7
Joined: Nov 2011
Reputation: 0
#18
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
Find
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#19
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
Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#20
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
Find




Users browsing this thread: 4 Guest(s)