(01-09-2011, 10:53 PM)HumiliatioN Wrote: What is the problem? Can you not interact with the crowbar once it is in the door? Is the crowbar showing up at all?
I cant interact and its not showing at all. :/
Do you have a "crowbar_joint" which is not active on your door in the Level Editor? Because the code does the following:
Spoiler below!
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "prison_section_1", "UsedCrowbarOnDoor", true); <-- This makes UsedCrowbarOnDoor run if crowbar_1 is used on prison_section_1
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1); <-- Once crowbar_joint_1 hits ScriptArea_1 it runs CollideAreaBreakDoor
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false); <-- Plays a sound
SetEntityActive("crowbar_joint_1", true); <-- Makes crowbar_joint_1 active. There must be a non-active crowbar_joint_1 in the map for this to work
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);<-- Sanity Boost
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);<-- Plays Music
SetSwingDoorLocked("prison_section_1", false, true);<-- Unlocks the door
SetMoveObjectState("prison_section_1", 1);<-- Moves the door into state 1 (Open I think (This didn't work in mine but it is more aesthetic and won't interfere with gameplay))
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);<-- Plays a sound
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);<-- Creates a particle effect at entity AreaBreakEffect
SetEntityActive("crowbar_joint_1", false);<-- makes the crowbar_joint_1 not active
SetLocalVarInt("Door", 1);<-- Sets the Variable Door to 1
}
The problems might be that you don't have a crowbar_joint_1 (which should be not active) at prison_section_1, and you might not have all of the necessary scripting areas.
The problems might be that you don't have a crowbar_joint_1 (which should be not active) at prison_section_1, and you might not have all of the necessary scripting areas.
Oh, I Forgot that thanks... But now its only opens and there is that Area effect but not that when you must turn that crowbar to open.. Only Soundeffect and particle then its open not that Crowbar animation i mean
(01-09-2011, 11:38 PM)HumiliatioN Wrote: The problems might be that you don't have a crowbar_joint_1 (which should be not active) at prison_section_1, and you might not have all of the necessary scripting areas.
Oh, I Forgot that thanks... But now its only opens and there is that Area effect but not that when you must turn that crowbar to open.. Only Soundeffect and particle then its open not that Crowbar animation i mean
I think your problem is that you have your area directly on the crowbar
It should look (somewhat) like this:
Spoiler below!
Notice that the crowbar_joint_1 is not in the ScriptArea but can be moved into it
I think yours looks like this:
Spoiler below!
See that the crowbar is in the ScriptArea and will automatically fire AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
Now I am trying this aswell, but there is one thing that is a bit unclear.
Where do I create the joint?, Is the joint also a script area or what is it and how do I create it?
Cant find joint creation on the level editor, so it must be something else that i just move into position and call a joint?