Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help destroying key after use?
zombiehacker595 Offline
Member

Posts: 141
Threads: 51
Joined: Mar 2012
Reputation: 3
#1
destroying key after use?

how do my key after use
i have takin heeps out out of the script this is just the door opening door thingy
void OnStart()
{
AddUseItemCallback("OpenDoor", "key_study_1", "level_wood_1", "UnlockLevelDoor", true);

}
void OnEnter()
{
}
void OnLeave()
{
}
void UnlockLevelDoor(string &in item, string &in entity)
{
SetLevelDoorLocked(entity, false);
}
what would i have to add to destory the key after using it to unlock the door?
03-31-2012, 01:41 PM
Find
RedMser Offline
Junior Member

Posts: 40
Threads: 12
Joined: Mar 2012
Reputation: 1
#2
RE: destroying key after use?

The Engine Scripts Page is there to help you! It is RemoveItem("<NAME>"); where <NAME> is the name of the key, in this case key_study_1. So it's RemoveItem("key_study_1");
03-31-2012, 01:52 PM
Find
zombiehacker595 Offline
Member

Posts: 141
Threads: 51
Joined: Mar 2012
Reputation: 3
#3
RE: destroying key after use?

(03-31-2012, 01:52 PM)DoubleThinking Wrote:
The Engine Scripts Page is there to help you! It is RemoveItem("<NAME>"); where <NAME> is the name of the key, in this case key_study_1. So it's RemoveItem("key_study_1");
so i put it underneath void UnlockDoor?
03-31-2012, 02:10 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#4
RE: destroying key after use?

(03-31-2012, 02:10 PM)zombiehacker595 Wrote:
(03-31-2012, 01:52 PM)DoubleThinking Wrote:
The Engine Scripts Page is there to help you! It is RemoveItem(""); where is the name of the key, in this case key_study_1. So it's RemoveItem("key_study_1");
so i put it underneath void UnlockDoor?
Yes
Put it under the SetDoorLocked

It's also good to add.
GiveSanityBoostSmall();
PlaySoundAtEntity("", "unlock_door", "player", 0, false);

(This post was last modified: 03-31-2012, 03:40 PM by Xanthos.)
03-31-2012, 03:38 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#5
RE: destroying key after use?

Only add "GiveSanityBoostSmall();" if you want unlocking the door to feel like some sort of task has been completed. Otherwise, just adding the sound will let them realize they unlocked the door. Sometimes, I just feel that adding GiveSanityBoostSmall(); makes it seem like progress has been made, and unlocking each door isn't always a step in the right direction -evil face-

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

03-31-2012, 05:25 PM
Website Find
zombiehacker595 Offline
Member

Posts: 141
Threads: 51
Joined: Mar 2012
Reputation: 3
#6
RE: destroying key after use?

(03-31-2012, 05:25 PM)JetlinerX Wrote: Only add "GiveSanityBoostSmall();" if you want unlocking the door to feel like some sort of task has been completed. Otherwise, just adding the sound will let them realize they unlocked the door. Sometimes, I just feel that adding GiveSanityBoostSmall(); makes it seem like progress has been made, and unlocking each door isn't always a step in the right direction -evil face-
yea thanks Smile


04-01-2012, 02:26 AM
Find




Users browsing this thread: 1 Guest(s)