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
Key Script?
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#11
RE: Key Script?

If you look at the script tutorial it is basically using a timer to show a message, use the timer to disable the monster instead.

http://hpl2.frictionalgames.com/tutorial...tutorial_1
09-15-2010, 02:33 PM
Website Find
grahfcard Offline
Junior Member

Posts: 12
Threads: 1
Joined: Sep 2010
Reputation: 0
#12
RE: Key Script?

Thanks for the info, Jens Big Grin
I have absolutely no experience in any scripting language (except a couple of interactive fiction ones, but they were obviously different), so most of the scripts look like gibberish since I can't understand the terms. The manual is coming in handy, and I've started reading up.
09-15-2010, 02:50 PM
Find
sacroid Offline
Member

Posts: 88
Threads: 11
Joined: Apr 2010
Reputation: 0
#13
RE: Key Script?

(09-15-2010, 02:33 PM)jens Wrote: If you look at the script tutorial it is basically using a timer to show a message, use the timer to disable the monster instead.

http://hpl2.frictionalgames.com/tutorial...tutorial_1

That's a nice alternative, thanks!

09-15-2010, 02:55 PM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#14
RE: Key Script?

(09-15-2010, 02:31 PM)Jordo76 Wrote: Door are Simple,All you need is a Door (Of course),a key (Big Grin) and a .hps

To open a door with a key,it's simple,name the door first,we'll name it "door_1" and the key "key_1"
Set the Door to Locked
Go to the hps file,open it and type :
void UseKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

RemoveItem(asItem);
}


void OnStart()
{

AddUseItemCallback("useexit", "key_1", "door_1", "UseKey",true);

}

And you're all set !
You can add everything in void Onstart() for example :
GiveItemFromFile("lantern", "lantern.ent");
For giving a lantern to the players,etc...
Yes i used the script of the 30 min editor map,
I hope you will do a great map !

PS : If my english is bad it's because i'm french ^^

Thanks for your help, that worked well, but I have one more question: Is there a way to rename the key you place into your map? The one I have that works is called the "Machine Room Key", but obviously that's not what it is used for. Thanks!

Check out my custom stories(1)(2)!
09-15-2010, 10:05 PM
Find
sacroid Offline
Member

Posts: 88
Threads: 11
Joined: Apr 2010
Reputation: 0
#15
RE: Key Script?

To change the entity's name you need to select it in the editor and in the entity bar, you can change it's name Wink

09-15-2010, 11:14 PM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#16
RE: Key Script?

(09-15-2010, 11:14 PM)sacroid Wrote: To change the entity's name you need to select it in the editor and in the entity bar, you can change it's name Wink

I was trying to change the name that is shown when you pick it up in-game, but I can't seem to get it to work right. I'm trying to enter the name in the "CustomSubItemTypeName" field in the Entity tab, but every time I pick it up ingame, all it says is, "Picked up"? There's no name after those two words. What is the right syntax to use when entering a name in that field? It says, to use 'ItemName_', but I can't find out whether to remove the ' and where to place the name and whether it needs an underscore instead of a space, etc... Lol a lot of stuff I don't know and need to know.

Check out my custom stories(1)(2)!
09-16-2010, 12:43 AM
Find
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#17
RE: Key Script?

Most of the name stuff are stored inside the lang files, you may need to modify them and call the string name from the entity in the level editor.

Neurological - Music Entertainment
http://www.neuro-lab.net
09-16-2010, 12:46 AM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#18
RE: Key Script?

(09-16-2010, 12:46 AM)Neurological Wrote: Most of the name stuff are stored inside the lang files, you may need to modify them and call the string name from the entity in the level editor.

Haha ok sorry for yet another question, but how do I do that?

Check out my custom stories(1)(2)!
09-16-2010, 01:03 AM
Find
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#19
RE: Key Script?

inside config/lag_main there are all the language files where all text is stored. Ope n for example english.lang with notepad or any other text editor.

The category for the inventory items is right on the top. Example:

<Entry Name="ItemName_KeyWineCellar">Wine Cellar Key</Entry>

The suffix ItemName_ is what tell the game that this is the text for the item title name, you would need to put only KeyWineCellar on the entity in the level editor.

Try to put another string and see if it works.

Neurological - Music Entertainment
http://www.neuro-lab.net
09-16-2010, 01:20 AM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#20
RE: Key Script?

(09-16-2010, 01:20 AM)Neurological Wrote: inside config/lag_main there are all the language files where all text is stored. Ope n for example english.lang with notepad or any other text editor.

The category for the inventory items is right on the top. Example:

<Entry Name="ItemName_KeyWineCellar">Wine Cellar Key</Entry>

The suffix ItemName_ is what tell the game that this is the text for the item title name, you would need to put only KeyWineCellar on the entity in the level editor.

Try to put another string and see if it works.

Ok, so let me get this straight, I need to add a new entry in the english.lang, or edit a current one (wouldn't that also then edit that entity in the main game then)? Where would I put the name in the editor?

EDIT: Nevermind this post, looks like I found it out, thanks for your help!

Check out my custom stories(1)(2)!
09-16-2010, 01:34 AM
Find




Users browsing this thread: 1 Guest(s)