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
Script Help [Solved]-> Key unlocks door ANOTHER WAY ^.-
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#1
[Solved]-> Key unlocks door ANOTHER WAY ^.-

Hi

Spoiler below!
NO IT'S NOT PROBLEM LIKE:HEY I NEED A HELP HOW TO MAKE KEY UNLOCKS DOOR I'M SO STUPID...NO! something else :)

i need a when PLAYER pick up KEY doors unlocks,without using key on any doors

i have a some script here

Spoiler below!


void OnStart()
{
SetEntityPlayerInteractCallback("Key01", "PickKey", true);
}

void PickKey(string &in asEntity, string &in asType)
{
GiveSanityBoostSmall(); //Just a nice little sanity boost
SetSwingDoorLocked("Door01", false, true);
}

so to don't use key just pick it up ok ?

Spoiler below!
Problem:Script doesn't work no errors just don't work...!

(This post was last modified: 05-18-2014, 09:48 PM by Straxedix.)
05-18-2014, 07:55 PM
Find
Skyy Offline
Member

Posts: 60
Threads: 5
Joined: Dec 2013
Reputation: 3
#2
RE: Key unlocks door ANOTHER WAY ^.-

Make sure everything is named correctly in the Level Editor. I can't see any error.

Edit: If you click the key in the Level Editor and go to the second tab there should be an option called "PlayerInteractCallback", if you type in "PickKey" it should work.
(This post was last modified: 05-18-2014, 08:39 PM by Skyy.)
05-18-2014, 08:35 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#3
RE: Key unlocks door ANOTHER WAY ^.-

Still stuck at this, huh? And as Skyy said, I can't find any error (as before). Follow Skyy's advice.

EDIT: Not PlayerInteractCallback, CallbackFunc.

Derp.
(This post was last modified: 05-18-2014, 08:40 PM by Neelke.)
05-18-2014, 08:40 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#4
RE: Key unlocks door ANOTHER WAY ^.-

i added a PickKey but still don't work i will check everything

EDIT:Sanity boost doesn't work two o.O

(This post was last modified: 05-18-2014, 08:57 PM by Straxedix.)
05-18-2014, 08:56 PM
Find
Skyy Offline
Member

Posts: 60
Threads: 5
Joined: Dec 2013
Reputation: 3
#5
RE: Key unlocks door ANOTHER WAY ^.-

(05-18-2014, 08:40 PM)Neelke Wrote: EDIT: Not PlayerInteractCallback, CallbackFunc.

It's called "PlayerInteractCallback" in the Editor.

Maybe you are talking about something else?
05-18-2014, 08:57 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#6
RE: Key unlocks door ANOTHER WAY ^.-

Oh my god, I suck.

This should work. Replace SetEntityPlayerInteractCallback with this.

SetEntityCallbackFunc("Key01", "PickKey");

Derp.
05-18-2014, 09:14 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#7
RE: Key unlocks door ANOTHER WAY ^.-

Interaction callbacks are for grabbing and moving and clicking, not specifically picking up items. Use the CallbackFunc as Neelke said. That one has a type called OnPickup, which is what you want.

05-18-2014, 09:45 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#8
RE: Key unlocks door ANOTHER WAY ^.-

Neelke thanks it works now +reputation Smile for you Smile

Mudbil +reputation for you two you helped me a lot Smile

(This post was last modified: 05-18-2014, 09:54 PM by Straxedix.)
05-18-2014, 09:47 PM
Find




Users browsing this thread: 1 Guest(s)