Frictional Games Forum (read-only)
Key Script? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Key Script? (/thread-4364.html)

Pages: 1 2 3


Key Script? - theDARKW0LF - 09-15-2010

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


RE: Key Script? - jens - 09-15-2010

I think you should begin with something really simple, like this:
http://hpl2.frictionalgames.com/tutorials:amnesia_script:tutorial_1


RE: Key Script? - theDARKW0LF - 09-15-2010

(09-15-2010, 06:56 AM)jens Wrote: I think you should begin with something really simple, like this:
http://hpl2.frictionalgames.com/tutorials:amnesia_script: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?


RE: Key Script? - grahfcard - 09-15-2010

I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?


RE: Key Script? - DrMelon - 09-15-2010

(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:script_functions


RE: Key Script? - jens - 09-15-2010

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/docs/manual/index.html


RE: Key Script? - jens - 09-15-2010

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.


RE: Key Script? - thePyro13 - 09-15-2010

(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:script_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


RE: Key Script? - sacroid - 09-15-2010

(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:script_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! :S I'm trying to make a monster dissapear after certain time, (despawn), but I have NO clue!


RE: Key Script? - Jordo76 - 09-15-2010

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 :
Code:
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 ^^