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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key Script?
Author Message
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #1
Key Script?

So I'm trying to make it so a key in the room I'm creating can open the door of a desk, but I don't believe I can do that without scripting (at least I haven't found it out yet at least), and my scripting expertise is non-existent... Is there anyone who is willing to take a little time out of their day/night to create/help me create a script that codes a specific key to unlock said door? Oh, and one more thing, I couldn't seem to find out where to rename the key, is that also done in scripting?

While I'm at it, can someone help me create a script that activates a grunt when I pick up the lantern in the room? Thanks if you decide to help me!

It would be nice to learn how to script myself, is there any good place for tutorials on that kind of thing, like for Amnesia? Thanks again... Blush

Check out my custom stories(1)(2)!
09-15-2010 06:37 AM
Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 4,095
Joined: Apr 2006
Reputation: 202
Post: #2
RE: Key Script?

I think you should begin with something really simple, like this:
http://hpl2.frictionalgames.com/tutorial...tutorial_1
09-15-2010 06:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #3
RE: Key Script?

(09-15-2010 06:56 AM)jens Wrote:  I think you should begin with something really simple, like this:
http://hpl2.frictionalgames.com/tutorial...tutorial_1
Thanks for your reply, I'll check it out!
Is there anywhere I can go to learn just what all the symbols and functions in scripting mean and how to compile them into fully functional scripts?

Check out my custom stories(1)(2)!
(This post was last modified: 09-15-2010 07:33 AM by theDARKW0LF.)
09-15-2010 06:59 AM
Find all posts by this user Quote this message in a reply
grahfcard Offline
Junior Member

Posts: 12
Joined: Sep 2010
Reputation: 0
Post: #4
RE: Key Script?

I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?
09-15-2010 01:46 PM
Find all posts by this user Quote this message in a reply
DrMelon Offline
Junior Member

Posts: 3
Joined: Sep 2010
Reputation: 0
Post: #5
RE: Key Script?

(09-15-2010 01:46 PM)grahfcard Wrote:  I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?

It's a scripting language all of its own. The best place to start learning is by using the wiki and opening up scripts for the levels that already exist - they're commented properly.
Also, a list of all functions is available here:
http://hpl2.frictionalgames.com/amnesia:..._functions
09-15-2010 01:49 PM
Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 4,095
Joined: Apr 2006
Reputation: 202
Post: #6
RE: Key Script?

It's this language, http://www.angelcode.com/angelscript/

And the only official documentation I know of regarding the script part is this:
http://www.angelcode.com/angelscript/sdk...index.html
09-15-2010 01:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 4,095
Joined: Apr 2006
Reputation: 202
Post: #7
RE: Key Script?

I will try and make a simple map with some basic scripts and upload to the wiki, but not sure when I will be able to do so.
09-15-2010 01:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
thePyro13 Offline
Junior Member

Posts: 24
Joined: Sep 2010
Reputation: 0
Post: #8
RE: Key Script?

(09-15-2010 01:49 PM)DrMelon Wrote:  
(09-15-2010 01:46 PM)grahfcard Wrote:  I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?

It's a scripting language all of its own. The best place to start learning is by using the wiki and opening up scripts for the levels that already exist - they're commented properly.
Also, a list of all functions is available here:
http://hpl2.frictionalgames.com/amnesia:..._functions

Aren't they using AngelScript? You can look it up to find out what syntax you can use, loops, variables so on. You have to manipulate the game using the functions provided however.

Best place to start learning is with the script files that come with Amnesia. Just mess with the levels. Comment out all the encounters in storage. Change the encounter in the guest room to come when you pick up the crowbar. That kind of stuff.

EDIT: WOAH! Ninja jens Big Grin
09-15-2010 01:59 PM
Find all posts by this user Quote this message in a reply
sacroid Offline
Member

Posts: 88
Joined: Apr 2010
Reputation: 0
Post: #9
RE: Key Script?

(09-15-2010 01:59 PM)thePyro13 Wrote:  
(09-15-2010 01:49 PM)DrMelon Wrote:  
(09-15-2010 01:46 PM)grahfcard Wrote:  I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?

It's a scripting language all of its own. The best place to start learning is by using the wiki and opening up scripts for the levels that already exist - they're commented properly.
Also, a list of all functions is available here:
http://hpl2.frictionalgames.com/amnesia:..._functions

Aren't they using AngelScript? You can look it up to find out what syntax you can use, loops, variables so on. You have to manipulate the game using the functions provided however.

Best place to start learning is with the script files that come with Amnesia. Just mess with the levels. Comment out all the encounters in storage. Change the encounter in the guest room to come when you pick up the crowbar. That kind of stuff.

EDIT: WOAH! Ninja jens Big Grin

I've been messing arround with the original game's scripts, but I still can't understand many things! Confused I'm trying to make a monster dissapear after certain time, (despawn), but I have NO clue!

09-15-2010 02:04 PM
Find all posts by this user Quote this message in a reply
Jordo76 Offline
Member

Posts: 57
Joined: Sep 2010
Reputation: 0
Post: #10
RE: Key Script?

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 ^^
09-15-2010 02:31 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)