Frictional Games Forum

Full Version: Giving items like dynamite, pickaxe, hammer, etc, tutorial
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed that black plague includes dynamite, i searched from the .hps files.

So, let's start by opening level01_cells.hps, when you have it opened (in text editor), search for:

CreateTimer("ventmessage1", 0.2f, "VentMessage01",false);

That above code is executed everytime you try to open the vent in the beginning with your hands (and it gives you the message that you can't, etc), so if we add a line under it:

GiveItem("dynamite01","item_dynamite.ent", -1);

You would get dynamite everytime you try to open the vent with your hands, of course the more you add the above line, the more you get when you try to open the vent.

So if you want to get items i suggest you add them to a place what is executed more than one time (eg picking up a coin isn't good, you only do it once).

Here's the item list i've discovered, not sure if it's the full:

Code:
item_battery.ent
item_notebook.ent
items_flare.ent
items_flare_thrown.ent
item_dynamite.ent
item_dynamite_thrown.ent
item_meat.ent
item_glowstick.ent
item_gask_mask.ent
item_keycard.ent
lab_chemical_jar_acetone.ent
lab_chemical_jar_bromine.ent
lab_chemical_jar_chlorine.ent
lab_chemical_jar_iodine.ent
lab_chemical_jar_nitrogen.ent
lab_chemical_jar_sulphur.ent
items_substance_container.ent
items_substance_container_full.ent
items_substance_container_static.ent
items_substance_container_static_full.ent
item_syringe.ent
item_syringe_chemical.ent
item_syringe_blood.ent
item_syringe_clean.ent
item_sodacan.ent
item_circuit_card_blue.ent
item_circuit_card_blue_dyn.ent
item_circuit_card_red.ent
item_circuit_card_red_dyn.ent
item_circuit_card_green.ent
item_circuit_card_green_dyn.ent
item_coin.ent
item_coin_flat.ent
item_coin_static.ent
item_emergency_wrist_band.ent
item_flamethrower.ent
item_flashlight.ent
item_hand.ent
item_head.ent
item_iron_bar.ent
item_lighter.ent
item_medical_alkohol.ent
item_notebook.ent
item_painkillers.ent
item_saw.ent
item_saw_dyn.ent
item_shelter_cd.ent
item_sodacan_noitem.ent
item_swanson_key.ent
items_artefact.ent
items_artefact_statue.ent
items_cassette.ent
items_cassette_recorder.ent
items_chemicalx.ent
items_cloth.ent
items_cloth02.ent
items_computermanual.ent
items_cryo_manual.ent
items_spray_can.ent


So if i'd want an artefact (items_artefact.ent) then it would be like this:

GiveItem("artefact","items_artefact.ent", -1);

To split it down, i think it's like this:

Giveitem("nametheitemwhateveryouwant","itemcodehere", -1);

I don't know what the -1 stands for :/

Pickaxe and hammer tutorial:

Q: I saw one of your videos, how did you get hammer? And can you get the pickaxe too?

A: Yes, you can get both of them. I simply copied the penumbra overture's redist folder to black plagues folder (WARNING: DON'T OVERWRITE ANY FILES) and then i added these lines to my level01_cells.hps file:

Code:
GiveItem("hammer","item_hammer.ent", -1);
GiveItem("pickaxe","items_pickaxe.ent", -1);


Under:

Code:
void PlayerInteractVentDoor01(string asEntity)
{
    if(asEntity == "ventdoor01")
    {
        CreateTimer("ventmessage1", 0.2f, "VentMessage01",false);


So now it should look like:

Code:
void PlayerInteractVentDoor01(string asEntity)
{
    if(asEntity == "ventdoor01")
    {
        CreateTimer("ventmessage1", 0.2f, "VentMessage01",false);
GiveItem("hammer","item_hammer.ent", -1);
GiveItem("pickaxe","items_pickaxe.ent", -1);


Now, when you go to the vent in the beginning, and when you try to open it with your hands you will receive hammer and pickaxe.

Note: backup your black plague redist folder, as you may in accident overwrite your files.

Thank you! This is interesting and usefull for me! Smile
Hmm, after changing string nothing really happened, with that _dynamite_ and with hammer etc/ the same story. Thats what happened, i try to open the vent, it says i cant do it with my hands, then i press Tab to check if i have dynamite etc. in my inventory and the game just abortes without saving current progress. What did i do wrong?
You may have forgotten the icon; I know when I added the 'Hatch Tool' from the tech demo, it crashed until I added the portrait.
Pardon, im not too good at those things. Where shud i add that icon (what i mean is there is already an icon of dynamite in _Penumbra Black Plague\redist\graphics\inventory_ directory)
Hei... the pickaxe appears on my inventory.. but I can't use it

I'm only can do is hold it in hand.. but I can't beat on the monsters "/
hmmm, wen i put in the dynamite script, like it appears almost like in HPL viewer, except u can take damge etc.
I tried to use picaxe in the BP, but no luck. I have NO idea what program i must use to mod the file. Hmm.. well at least now i know that i'am not the right person to mod the Penumbra. I rather not try these things again!
right click>open with..>Offline program> notepad or wordpad
However... I tried every program what i found in my computer, but everytime i have message "you are not allowed" etc.. I use vista, but i don't know what diffrences it makes. Easy to you to do these things, but i'am not born at the computer, if you know what i meanWinkToungue
Pages: 1 2
Reference URL's