The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Crowbar script!
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#1
Problem with Crowbar script!

I was trying to use a crowbar to open a door, and it didn't work. It said that it cannot be used when I used the crowbar on the door. The entities involved are: "cellar_wood01_slow_2" , "crowbar_1". The scriptareas that are involved are: "BreakDoor" , "AreaUseCrowbar" , "AreaBreakEffect". In the scriptarea "AreaUseCrowbar", ItemInteraction is checked.

void OnStart()
{
PreloadSound("general_chain_rattle_single.snt");
AddEntityCollideCallback("Player" , "ScriptArea_2" , "PlaySound01" , false , 1);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "BarrelFall" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_3" , "MonsterFunc1" , true , -1);
AddUseItemCallback("" , "HatchKey" , "HatchDoor" , "UsedKeyOnDoor" , true);
}
void BarrelFall(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("barrel01_20" , true);
}
void PlaySound01(string &in asParent , string &in asChild , int alState)
{
PlaySoundAtEntity("ChainSound" , "general_chain_rattle_single.snt" , "chain_pipe03_1" , 0 , true);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt2" , true);
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_1", 5.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_5", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_7", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_8", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_9", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_10", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_11", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_12", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_13", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_14", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_15", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_16", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_17", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_18", 0.0f, "");
AddEnemyPatrolNode("servant_grunt2", "PathNodeArea_19", 0.0f, "");
}
void UsedKeyOnDoor(string &in asItem , string &in asEntity)
{
SetSwingDoorLocked(asEntity , false , true);
SetLevelDoorLocked(asEntity , false);
PlaySoundAtEntity("UnlockSound" , "unlock_door.snt" , asEntity , 0.0f , false);
RemoveItem(asItem);
}
-------------------------------------------------------------------
void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer(asEntity, 0.2, "TimerSwitchShovel");
PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);

//Remove callback incase player never touched door
SetEntityPlayerInteractCallback("cellar_wood01_slow_2", "", true);
SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true);

RemoveItem(asItem);
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", asTimer, 0, false);

SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoostSmall();

PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);

SetSwingDoorLocked("cellar_wood01_slow_2", false, false);
SetSwingDoorDisableAutoClose("cellar_wood01_slow_2", true);
SetSwingDoorClosed("cellar_wood01_slow_2", false,false);

PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
AddPropImpulse("cellar_wood01_slow_2", -3, 0, 0, "world");

SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);

AddTimer("pushdoor", 0.1, "TimerPushDoor");
AddTimer("voice2", 1, "TimerDanielVoices");

AddDebugMessage("Break door!", false);
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("cellar_wood01_slow_2", -1, 2, -4, "world");
AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}

void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("cellar_wood01_slow_2", false);
}
void OnEnter()
{
}
void OnLeave()
{
}
--------------------------------------------------------------------

Added script in section above.

10-17-2010, 05:08 PM
Find


Messages In This Thread
Problem with Crowbar script! - by Kyle - 10-17-2010, 05:08 PM
RE: Problem with Crowbar script! - by Kyle - 10-17-2010, 10:22 PM
RE: Problem with Crowbar script! - by theDARKW0LF - 10-18-2010, 01:38 AM
RE: Problem with Crowbar script! - by Datenshi92 - 10-18-2010, 01:48 AM
RE: Problem with Crowbar script! - by Kyle - 10-18-2010, 01:58 AM
RE: Problem with Crowbar script! - by Kyle - 10-18-2010, 11:10 AM
RE: Problem with Crowbar script! - by jens - 10-18-2010, 11:17 AM
RE: Problem with Crowbar script! - by Kyle - 10-18-2010, 11:45 AM
RE: Problem with Crowbar script! - by Kyle - 10-18-2010, 09:23 PM



Users browsing this thread: 1 Guest(s)