Frictional Games Forum (read-only)
[SCRIPT] Crowbars!! - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Crowbars!! (/thread-12863.html)

Pages: 1 2


Crowbars!! - Zjurc - 01-25-2012

Yes, crowbars. Guys, once again I need your help Tongue
The problem: Crowbar joint, dyn AND the script area are fully set. Door is fully set. Script set(and probably working, no crashes). Crowbar (item) placed on the ground. Everything great, right? Big Grin

But no, Mr. HPS decided to abuse me and shows me an error 'Cannot use item this way!' when i use the crowbar on the door.

I have looked through the forum (around 30 pages) and no luck. There was one guy who had the same problem and he magically fixed it by himself. Other threads were like 'Solved, delete this!' (which I extremely don't like, because just browsing through this forum and reading old threads helped me countless times)

So, I have no choice but to post it and hopefully solve it quickly.

Here's the script: (Its not the full script, of course.)

Thank you in advance Shy
Quote: AddUseItemCallback("", "crowbar", "crowbardoor", "CrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "door_script_1", "crowbarfunc", true, 1);
}

void CrowbarOnDoor(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
}


void crowbarfunc(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("crowbardoor", 0.0f);
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);
}
PS: I've included an image from the level editor on how I've set the crowbars and the area. I just thought it might be helpful.


RE: Crowbars!! - flamez3 - 01-26-2012

Not every door in the game can be broken (if I'm wrong sorry : P). If you want to you can download scroobs castle remake and look at the hub map .hps. I did the crowbar and it worked fine for me. You really just need to name everything right. From the crowbar to the door.

And, what is not working? Can you put it in the door?


RE: Crowbars!! - Zjurc - 01-26-2012

for the strangest reason, everything is named properly and simply does not work Sad
your theory of only some doors can be breakable is really good! I already tried two doors: the usual wooden poor looking-like, and standard Prison door. sorry im on mobile atm so i cant provide detailed info :p i am aware that mansion door can be broken, but i need a dungeon-looking door


RE: Crowbars!! - flamez3 - 01-26-2012

What doesn't work?


RE: Crowbars!! - Zjurc - 01-26-2012

i just pickup the crowbar as usual... approach the door, try to use the crowbar ON the door... then message appears 'Cannot use the item this way!'
I suspect that the script, for some reason, does not actually recognize the door needs to be connected and smashed with the crowbar.


RE: Crowbars!! - flamez3 - 01-26-2012

Try uploading the whole Custom story and let me check it out myself?


RE: Crowbars!! - Zjurc - 01-26-2012

as much as i appreciate your help, i cannot upload the whole custom story (its almost complete) i will though just upload the map that actually has the crowbar. that will be enough?
PS: dont feel offended, i just never trusted people a lot
(i am still on my mobile phone, and will upload the maps when i get home.. so in about two hours)


RE: Crowbars!! - flamez3 - 01-26-2012

It's okay, I understand. Upload them when your ready and I'll get back to you.


RE: Crowbars!! - Zjurc - 01-26-2012

Here you go: http://www.mediafire.com/?76cs0qod7hboccw
the door that requires the crowbar is just up ahead. I've placed the crowbar right in front of it, too.

Cheers!


RE: Crowbars!! - flamez3 - 01-26-2012

Ermm. machineroom.hps doesnt have the script inside it? Where did you save the script you are using?