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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Give Sanity Boost help D:
31tashi Offline
Junior Member

Posts: 7
Threads: 2
Joined: Dec 2012
Reputation: 0
#1
Give Sanity Boost help D:

Sooo... I've been scripting for a while now but i can't seem to figure out one of my problems. I used the sanity boost script on a door you open with a crowbar... And i also have a give sanity boost on when you pull a lever of mine, but the boost Never appears. It seems like the boost only can appear once... can i change that? :c
Script:
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "prison_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_3", "CollideAreaBreakDoor", true, 1);
SetEntityConnectionStateChangeCallback("lever", "func_shelf");geCallback("lever", "func_shelf");
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("prison_1", false, true);
AddPropImpulse("prison_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("prison_1", true);
SetSwingDoorClosed("prison_1", false, false);
SetMoveObjectState("prison_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
AddBodyForce("prison_1", 0, 0, 900, "world");
SetEntityActive("crowbarlives", true);
}

void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
AddTimer("", 10, "func_shelf2");
GiveSanityBoost();
SetMoveObjectState("shelf",1.0f);
SetMessage("Messages", "Popup2", 0);
SetLeverStuckState("lever", 1, true);
return;
}
}

So I am really not sure how to make it appear a second time... The func_shelf sanity thing worked before i added in the new crowbar door, but now it doesn't.
(This post was last modified: 01-01-2013, 08:27 PM by 31tashi.)
01-01-2013, 08:04 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Give Sanity Boost help D:

My guess is:
The boost only happens once because you lost some sanity...

The boost does not happen when you have full sanity.

Trying is the first step to success.
01-01-2013, 10:26 AM
Find
str4wberrypanic Offline
Member

Posts: 241
Threads: 24
Joined: Jul 2012
Reputation: 8
#3
RE: Give Sanity Boost help D:

Stay in the dark to lose some sanity, then see if it works.

01-01-2013, 04:36 PM
Find
31tashi Offline
Junior Member

Posts: 7
Threads: 2
Joined: Dec 2012
Reputation: 0
#4
RE: Give Sanity Boost help D:

Yeah it did work... n.n Thanks guys c:
01-01-2013, 08:26 PM
Find




Users browsing this thread: 2 Guest(s)