Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Noob in trouble!
Author Message
Macetrow Offline
Junior Member

Posts: 38
Joined: Apr 2012
Reputation: 1
Post: #11
RE: Noob in trouble!

I tried that, but it didn't work either. This is quite frustrating xD I'm really grateful that someone is trying to help me with this!
04-14-2012 09:41 AM
Find all posts by this user Quote this message in a reply
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #12
RE: Noob in trouble!

(04-14-2012 09:41 AM)Macetrow Wrote:  I tried that, but it didn't work either. This is quite frustrating xD I'm really grateful that someone is trying to help me with this!


AddUseItemCallback("", "key_1", "mansion_3", "UsedKeyOnDoor", true);

change that to this

AddUseItemCallback("OpenDoor", "key_1", "mansion_3", "UsedKeyOnDoor", true);

in your script you didnt have OpenDoor which will mean it wont work if this still doesnt work i have no idea whats wrong
04-14-2012 10:18 AM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 621
Joined: Dec 2011
Reputation: 12
Post: #13
RE: Noob in trouble!

Btw heres an offtopic question:Does your door display a message when you interact with it and its locked?Because mine doesnt Sad

04-14-2012 11:54 AM
Find all posts by this user Quote this message in a reply
Macetrow Offline
Junior Member

Posts: 38
Joined: Apr 2012
Reputation: 1
Post: #14
RE: Noob in trouble!

Quote:
zombiehacker595
Wrote:
Quote:AddUseItemCallback("", "key_1", "mansion_3", "UsedKeyOnDoor", true);

change that to this

AddUseItemCallback("OpenDoor", "key_1", "mansion_3", "UsedKeyOnDoor", true);

in your script you didnt have OpenDoor which will mean it wont work if this still doesnt work i have no idea whats wrong
I tried it, but nothing changed.


Quote: Btw heres an offtopic question:Does your door display a message when you interact with it and its locked?Because mine doesnt [Image: sad.gif]
Add a category in your .lang file with something like:

<CATEGORY Name="Messages">
<Entry Name="msgname1">This door is locked, you need the key to go through.</Entry>
</CATEGORY>
And make sure you have something like this in your script:

void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("mansion_3") == true)
{

SetMessage("Messages", "msgname1", 0);

}
}

This is what i'm using and it's working.
04-14-2012 03:55 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 621
Joined: Dec 2011
Reputation: 12
Post: #15
RE: Noob in trouble!

(04-14-2012 03:55 PM)Macetrow Wrote:  
Quote:
zombiehacker595
Wrote:
Quote:AddUseItemCallback("", "key_1", "mansion_3", "UsedKeyOnDoor", true);

change that to this

AddUseItemCallback("OpenDoor", "key_1", "mansion_3", "UsedKeyOnDoor", true);

in your script you didnt have OpenDoor which will mean it wont work if this still doesnt work i have no idea whats wrong
I tried it, but nothing changed.


Quote: Btw heres an offtopic question:Does your door display a message when you interact with it and its locked?Because mine doesnt [Image: sad.gif]
Add a category in your .lang file with something like:

<CATEGORY Name="Messages">
<Entry Name="msgname1">This door is locked, you need the key to go through.</Entry>
</CATEGORY>
And make sure you have something like this in your script:

void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("mansion_3") == true)
{

SetMessage("Messages", "msgname1", 0);

}
}

This is what i'm using and it's working.


I have it exactly like that.The messages name in my lang is msgname and in the hps heres the part of my script:
void Lol(string &in entity)


{
if(GetSwingDoorLocked("Baws") == true)
{

SetMessage("Messages", "msgname", 0);

}
}

04-14-2012 04:09 PM
Find all posts by this user Quote this message in a reply
Macetrow Offline
Junior Member

Posts: 38
Joined: Apr 2012
Reputation: 1
Post: #16
RE: Noob in trouble!

Are you sure you've got msgname in your .lang file as well?

Also, check if you've typed your function into the "PlayerInteractCallback" box on your door in the Level Editor?
04-14-2012 04:12 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 621
Joined: Dec 2011
Reputation: 12
Post: #17
RE: Noob in trouble!

(04-14-2012 04:12 PM)Macetrow Wrote:  Are you sure you've got msgname in your .lang file as well?

Also, check if you've typed your function into the "PlayerInteractCallback" box on your door in the Level Editor?


Yes i have done those both.In my lang file its msgname and in the script its like that.

04-14-2012 05:15 PM
Find all posts by this user Quote this message in a reply
Macetrow Offline
Junior Member

Posts: 38
Joined: Apr 2012
Reputation: 1
Post: #18
RE: Noob in trouble!

Then i don't know why it doesn't work.
04-14-2012 05:51 PM
Find all posts by this user Quote this message in a reply
Datguy5 Offline
Senior Member

Posts: 621
Joined: Dec 2011
Reputation: 12
Post: #19
RE: Noob in trouble!

(04-14-2012 05:51 PM)Macetrow Wrote:  Then i don't know why it doesn't work.

Ok.But thanks anyways.

04-14-2012 06:01 PM
Find all posts by this user Quote this message in a reply
DRedshot Offline
Senior Member

Posts: 374
Joined: Jun 2011
Reputation: 11
Post: #20
RE: Noob in trouble!

This is a long-shot, but try it anyways:

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_3", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("key_1", "OnPickup");
}

void UsedKeyOnDoor(string &in item, string &in entity)
{
SetSwingDoorLocked(entity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", entity, 0, false);
RemoveItem(item);
AddDebugMessage("Key has been used, is door unlocked?" , false);
}

Check if the debug message shows up when you unlock the door. If it doesn't, there is a problem with the AddUseItemCallback, if it does, the problem is related to the SetSwingDoorLocked function.
Also, make sure you are hitting enter when you type the entity name in the Level Editor. It sounds like an obvious thing to say, but so many times I have had these mysterious problems because I forgot to hit enter and the entities name doesn't register.

(This post was last modified: 04-14-2012 06:47 PM by DRedshot.)
04-14-2012 06:46 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)