Frictional Games Forum (read-only)

Full Version: Script help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have quite the situation for anyone willing to help Big Grin

I want to have this system for unlocking a door, heres my idea:

-the door is locked and the padlock has rusted

-First, you need to get the rust of the lock, and you go about doing that by getting a glass_container_1 and using that to pick up a poison_gland_1 (by pick up, i mean double clicking the glass_container_1 in your inventory and then clicking on the poison_gland_1) combining the 2 into an item glass_container_mix_done_1 (have it spawn in your inventory). Then using the glass_container_mix_done_1 to unrust the lock and remove the glass_container_mix_done_1 from inventory. THEN finally unlock the door with key_study_1 and zam ur in.

Please help, if you get some working script for me I will put you in my credits Big Grin
From what I hear, you'll need to make your custom story into a full conversion for custom combinations of items. I could be wrong though and you'll just need to make an inventory.hps. Use Amnesia's inventory.hps for reference.
You can script in locally too.

This script should do what you want. Copy and paste it, but make sure your names and such are correct!

Code:
AddUseItemCallback("glass_container_on_poison_gland", "glass_container_1", "poison_gland_1", "GlassContainerFunc", true);

void GlassContainerFunc
{
    GiveItemFromFile("acid_mix", *put your custom acid item here*);
    //more cool stuff here
}

* Create a custom item entity and use that in the GiveItemFromFile function.
Sad sorry im really new to scripting. Where would I put these lines of code? I have the custom_story_settings.cfg and the extra_english.cfg but i have no clue where level script would go Big Grin i have looked around and I didnt find out how
Big Grin
Big Grin
In your maps folder, create a text file and match its name to the name of its respective map file. It must be saved as a .hps file. In this file you put your script Smile
(05-19-2011, 12:07 AM)SLAMnesia Wrote: [ -> ]Sad sorry im really new to scripting. Where would I put these lines of code? I have the custom_story_settings.cfg and the extra_english.cfg but i have no clue where level script would go Big Grin i have looked around and I didnt find out how
Big Grin

Hey, Start with watching the video tutorials and read the wiki
http://wiki.frictionalgames.com/hpl2/tut...tutorial_1

And try to begin with something easy as use key_1 on door_1 to make it unlocked. the tutorials show how to do that here
http://www.frictionalgames.com/forum/thread-7608.html
it's 11 very helpful video tutorials. Get coffee ready and start watching videos and reading about it, it won't be easy to begin with Big Grin