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
Locked Hatch found being open by itself?
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#10
RE: Locked Hatch found being open by itself?

You can, perhaps, hit "static physics" in the entity tab.
Then do an script area around the hatch, like this:

Spoiler below!
[Image: szg03m.jpg]

Now I guess you want to make player say "it's locked" when touching it. Go to your map script, and paste this code:

void int01(string &in asEntity)
{
SetMessage("Messages", "name_of_the_message_to_show", 5);
}

Put the "int01" here:

Spoiler below!
[Image: 14soaci.jpg]

(Tick also "item_interaction" in the same window, below)

Of course "Messages" is the category in your extra_english.lang file, and "name_of_the_message_to_show" is the entry name of the message to appear.

When you do script, simply make the key or everything else you want to be used on the script area, like this:

Spoiler below!
PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("""key_name""ScriptArea_1""UnlockHatch"true);
}
void UnlockHatch(string &in asItemstring &in asEntity)
{
  
SetPropStaticPhysics("hatch_ceiling_1"false);
  
SetEntityActive("ScriptArea_1"false);
  
PlaySoundAtEntity("""unlock_door.snt""hatch_ceiling_1"0false);
  
RemoveItem("key_name");



It should work fine, if you do this correctly.

EDIT: Forgot to put one thing, fixed.
(This post was last modified: 02-02-2014, 07:54 PM by Slanderous.)
02-02-2014, 07:48 PM
Find


Messages In This Thread
RE: Locked Hatch found being open by itself? - by Slanderous - 02-02-2014, 07:48 PM



Users browsing this thread: 2 Guest(s)