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 Where is a key usually hidden? [Solved]
ethics Offline
Member

Posts: 51
Threads: 18
Joined: Jan 2014
Reputation: 0
#3
RE: Where is a key usually hidden?

(04-17-2014, 02:03 PM)Romulator Wrote: I can help :3

The way I see it, you can do this one of two ways Smile You can give the item directly from the code, or you can make it drop from the shirt, preferably underneath it.

The first one, which you get directly from the shirt:
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
SetEntityPlayerInteractCallback("<your_shirt_name>""your_function"true);
}

void your_function(string &in asEntity)
{
GiveItem("<the_key_name>""Puzzle""<itemname_in_lang_file>""key_study.tga"1);



That, I BELIEVE would work, but you would have to just test it to make sure you receive a key at all. Change the appropriate stuff that you need to (anything enclosed in a <> but don't delete the "" marks). The thing in the lang file is ItemName_<itemname> and ItemDesc_<itemname>. You can change the graphical image to whatever is in the redist/graphics/item/ folder.

The other method, which is make a key appear from underneath and fall to the ground is this:
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
SetEntityPlayerInteractCallback("<your_shirt_name>""your_function"true);
}

void your_function(string &in asEntity)
{
SetEntityActive("<name_of_key"true);



This one, you have to place the appropriate key underneath the shirt, name it whatever the name of the key is in the Level Editor, and untick "Active" from the Level Editor.

Didn't knew it was that easy!
But I tried this script once for a locked door, I should interact with it and a message should be displayed. Didn't work.
I think ''SetEntityPlayerInteractionCallback'' works only for pickable items, like notes or oil.
But i'm gonna try it anyway.
Thanks! Big Grin

EDIT: As I said, didn't work. I think you ave to place a script area in front of the shirt to be able to interact with it.

ANOTHER EDIT: This time, I looked through the map of "Deterioration", and skimmed to the place, where I found the key in the shirt and indeed, you have to place a script area.
Thanks for your help, but now, I know the FULL TRUTH! Smile

(This post was last modified: 04-17-2014, 04:30 PM by ethics.)
04-17-2014, 04:19 PM
Find


Messages In This Thread
RE: Where is a key usually hidden? - by Romulator - 04-17-2014, 02:03 PM
RE: Where is a key usually hidden? - by ethics - 04-17-2014, 04:19 PM
RE: Where is a key usually hidden? - by Mudbill - 04-17-2014, 05:17 PM



Users browsing this thread: 2 Guest(s)