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
Wind Scare script problem!
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#1
Wind Scare script problem!

Why this is not working?

{
AddEntityCollideCallback("Player", "Event_Start_Collide_Area", "StartEvent", true, 1);
}

void StartEvent(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntityExt("awedsasf", "ps_dust_push_15.ps", "Particle_Spawn", false, 1.0f, 0.1f, 0.1f, 1, false, 1, 1, 1, 1);
AddTimer("asdtgeoqtfgd", 1.0f, "LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if{GetLocalVarInt("Stage") < 10) AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");
}

"main (225,2): ERR : Unexpected end of file.

Damn! Help needed please!

“Life is a game, play it”
07-20-2011, 12:28 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#2
RE: Wind Scare script problem!

(07-20-2011, 12:28 PM)HumiliatioN Wrote: Why this is not working?

{
AddEntityCollideCallback("Player", "Event_Start_Collide_Area", "StartEvent", true, 1);
}

void StartEvent(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntityExt("awedsasf", "ps_dust_push_15.ps", "Particle_Spawn", false, 1.0f, 0.1f, 0.1f, 1, false, 1, 1, 1, 1);
AddTimer("asdtgeoqtfgd", 1.0f, "LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if{GetLocalVarInt("Stage") < 10) AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");
}

"main (225,2): ERR : Unexpected end of file.

Damn! Help needed please!

There is a { instead of a ( at if{GetLocalVarInt("Stage").

if(GetLocalVarInt("Stage") < 10). Hopefully that is line 225.

Insanity. Static.
07-20-2011, 12:44 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#3
RE: Wind Scare script problem!

(07-20-2011, 12:44 PM)Juby Wrote:
(07-20-2011, 12:28 PM)HumiliatioN Wrote: Why this is not working?

{
AddEntityCollideCallback("Player", "Event_Start_Collide_Area", "StartEvent", true, 1);
}

void StartEvent(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntityExt("awedsasf", "ps_dust_push_15.ps", "Particle_Spawn", false, 1.0f, 0.1f, 0.1f, 1, false, 1, 1, 1, 1);
AddTimer("asdtgeoqtfgd", 1.0f, "LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if{GetLocalVarInt("Stage") < 10) AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");
}

"main (225,2): ERR : Unexpected end of file.

Damn! Help needed please!

There is a { instead of a ( at if{GetLocalVarInt("Stage").

if(GetLocalVarInt("Stage") < 10). Hopefully that is line 225.

Nope. Not working.

“Life is a game, play it”
07-20-2011, 12:56 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#4
RE: Wind Scare script problem!

if{(GetLocalVarInt("Stage") < 10) AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");

maybe this works?
07-20-2011, 12:59 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#5
RE: Wind Scare script problem!

(07-20-2011, 12:59 PM)MrCookieh Wrote: if{(GetLocalVarInt("Stage") < 10) AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");

maybe this works?

No. Sad

“Life is a game, play it”
07-20-2011, 01:07 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#6
RE: Wind Scare script problem!

Post the entire script. We need to see where the error (line 225) is.
07-20-2011, 01:20 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#7
RE: Wind Scare script problem!

(07-20-2011, 01:20 PM)Roenlond Wrote: Post the entire script. We need to see where the error (line 225) is.

There you go:

void OnStart()

{
StopSound("Sound_1", 0);
SetPlayerLampOil(0);
//if(ScriptDebugOn())
//
// GiveItemFromFile("lantern", "lantern.ent");
// for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
// SetPlayerLampOil(0);
//
// AddEntityCollideBacks
AddEntityCollideCallback("Player", "Felldown", "Teleport1", true, 1);
AddEntityCollideCallback("Player", "LightsOff", "HallwayLightsOff", true, 1);
SetEntityPlayerInteractCallback("Pick_lock_tool", "Insane_scare", true);
AddUseItemCallback("", "Pick_lock_tool", "Needle_door", "UsedItemOnDoor", true);
AddUseItemCallback("", "crowbar_1", "work_desk_door_2", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "Crowbar_break", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "BlockComplete", "BlockedQuest", true, 1);
AddEntityCollideCallback("Player", "Event_Start_Collide_Area", "StartEvent", true, 1);
}

// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
FadePlayerRollTo(80.0f, 80.0f, 100.0f);
FadeOut(2.45f);
GiveSanityDamage(50, true);
AddTimer("tele", 3, "Teleport");
FadePlayerFOVMulTo(0.35f, 1);
StartEffectFlash(0.2f, 1.0f, 1.0f);
SetPlayerActive(false);
SetPlayerCrouching(false);
}

void Teleport(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
AddTimer("trig1", 8.0f, "beginStory2");
}

void beginStory2(string &in asTimer){
FadeIn(3);
PlayGuiSound("react_scare", 1.0f);
ChangePlayerStateToNormal();
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
PlayMusic("16_amb", false, 3, 3, 10, true);
AddTimer("trig1", 8.0f, "beginStory3");
}

void beginStory3(string &in asTimer){
SetPlayerCrouching(true);
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
SetPlayerMoveSpeedMul(1.0f);
PlayGuiSound("react_breath_slow", 0.7f);
GiveSanityBoostSmall();
}

void Insane_scare(string &in asEntity)
{
SetEntityActive("insane_portrait", true);
SetEntityActive("LightsOff", true);
CreateParticleSystemAtEntity("PSDustPainting", "ps_ghost_release.ps", "insane_portrait", false);
StartPlayerLookAt("insane_portrait", 10, 100, "");
PlaySoundAtEntity("snd_scare", "react_scare.snt", "Player", 0.0, false);
GiveSanityDamage(10, true);
FadeImageTrailTo(3, 1);
FadeSepiaColorTo(5, 1);
FadePlayerFOVMulTo(0.7, 0.05);

AddTimer("insane_portraitON", 0.5f, "TimerInsPortrait");
}

void TimerInsPortrait(string &in asTimer)
{

if (asTimer == "insane_portraitOFF")
{
SetEntityActive("insane_portrait", false);
DestroyParticleSystem("PSDustPainting");
FadeIn(1);
StopPlayerLookAt();
AddTimer("timerReset", 1.0f, "TimerResetPlayer");
}
else
{
FadeOut(1);
AddTimer("insane_portraitOFF", 1.5f, "TimerInsPortrait");
}
}

void HallwayLightsOff(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);

PlayMusic("27_event_bang", false, 1, 1, 1, true);


StartPlayerLookAt("2", 2, 2, "");
StartEffectFlash(0.1, 0.05,0.15);
GiveSanityDamage(20, true);

AddTimer("LightOff1", 2.0f, "LightOffTimer1"); //1st hallway
AddTimer("LightOff2", 5.0f, "LightOffTimer2");
AddTimer("LightOff3", 6.0f, "LightOffTimer3");

AddTimer("StopLook", 4.5f, "StopLookTimer");

AddTimer("StartLook1", 4.6f, "StartLookTimer1");

AddTimer("StopLook", 4.5f, "StopLookTimer");

AddTimer("StopMusic", 18.6f, "StopMusicTimer");

}

void LightOffTimer1(string &in asTimer)
{
SetLampLit("1", false, true);
}

void LightOffTimer2(string &in asTimer)
{
SetLampLit("2", false, true);
}

void LightOffTimer3(string &in asTimer)
{
SetLampLit("3", false, true);
SetPlayerActive(true);
}

void StopLookTimer(string &in asTimer)
{
StopPlayerLookAt();
}

void StopMusicTimer(string &in asTimer)
{
StopMusic(0.5f, 1);
}

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

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("work_desk_door_2", false, true);
SetMoveObjectState("work_desk_door_2", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
CompleteQuest("DeskDoor", "DeskDoor");
}

void InteractDeskDoor(string &in asEntity)
{
AddQuest("DeskDoor", "DeskDoor");
}

void InteractBlockedDoor(string &in asEntity)
{
AddQuest("Blocked", "Blocked");
}

void BlockedQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("Blocked", "Blocked");
}

void Locked0(string &in asEntity)
{
SetMessage("Message", "Locked", 0);
}

void UsedItemOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", "Needle_door", 0, false);
RemoveItem(asItem);
}

void StartEvent(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntityExt("awedsasf", "ps_dust_push_15.ps", "Particle_Spawn", false, 1.0f, 0.1f, 0.1f, 1, false, 1, 1, 1, 1);
AddTimer("asdtgeoqtfgd", 1.0f, "LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if{(GetLocalVarInt("Stage") < 10) AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");


void OnEnter()
{
}

void OnLeave()
{
}


“Life is a game, play it”
07-20-2011, 01:44 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#8
RE: Wind Scare script problem!

Try this:
void OnStart()

{
StopSound("Sound_1", 0);
SetPlayerLampOil(0);
//if(ScriptDebugOn())
//
// GiveItemFromFile("lantern", "lantern.ent");
// for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
// SetPlayerLampOil(0);
//
// AddEntityCollideBacks
AddEntityCollideCallback("Player", "Felldown", "Teleport1", true, 1);
AddEntityCollideCallback("Player", "LightsOff", "HallwayLightsOff", true, 1);
SetEntityPlayerInteractCallback("Pick_lock_tool", "Insane_scare", true);
AddUseItemCallback("", "Pick_lock_tool", "Needle_door", "UsedItemOnDoor", true);
AddUseItemCallback("", "crowbar_1", "work_desk_door_2", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "Crowbar_break", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "BlockComplete", "BlockedQuest", true, 1);
AddEntityCollideCallback("Player", "Event_Start_Collide_Area", "StartEvent", true, 1);
}

// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
FadePlayerRollTo(80.0f, 80.0f, 100.0f);
FadeOut(2.45f);
GiveSanityDamage(50, true);
AddTimer("tele", 3, "Teleport");
FadePlayerFOVMulTo(0.35f, 1);
StartEffectFlash(0.2f, 1.0f, 1.0f);
SetPlayerActive(false);
SetPlayerCrouching(false);
}

void Teleport(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
AddTimer("trig1", 8.0f, "beginStory2");
}

void beginStory2(string &in asTimer){
FadeIn(3);
PlayGuiSound("react_scare", 1.0f);
ChangePlayerStateToNormal();
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
PlayMusic("16_amb", false, 3, 3, 10, true);
AddTimer("trig1", 8.0f, "beginStory3");
}

void beginStory3(string &in asTimer){
SetPlayerCrouching(true);
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
SetPlayerMoveSpeedMul(1.0f);
PlayGuiSound("react_breath_slow", 0.7f);
GiveSanityBoostSmall();
}

void Insane_scare(string &in asEntity)
{
SetEntityActive("insane_portrait", true);
SetEntityActive("LightsOff", true);
CreateParticleSystemAtEntity("PSDustPainting", "ps_ghost_release.ps", "insane_portrait", false);
StartPlayerLookAt("insane_portrait", 10, 100, "");
PlaySoundAtEntity("snd_scare", "react_scare.snt", "Player", 0.0, false);
GiveSanityDamage(10, true);
FadeImageTrailTo(3, 1);
FadeSepiaColorTo(5, 1);
FadePlayerFOVMulTo(0.7, 0.05);

AddTimer("insane_portraitON", 0.5f, "TimerInsPortrait");
}

void TimerInsPortrait(string &in asTimer)
{

if (asTimer == "insane_portraitOFF")
{
SetEntityActive("insane_portrait", false);
DestroyParticleSystem("PSDustPainting");
FadeIn(1);
StopPlayerLookAt();
AddTimer("timerReset", 1.0f, "TimerResetPlayer");
}
else
{
FadeOut(1);
AddTimer("insane_portraitOFF", 1.5f, "TimerInsPortrait");
}
}

void HallwayLightsOff(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);

PlayMusic("27_event_bang", false, 1, 1, 1, true);


StartPlayerLookAt("2", 2, 2, "");
StartEffectFlash(0.1, 0.05,0.15);
GiveSanityDamage(20, true);

AddTimer("LightOff1", 2.0f, "LightOffTimer1"); //1st hallway
AddTimer("LightOff2", 5.0f, "LightOffTimer2");
AddTimer("LightOff3", 6.0f, "LightOffTimer3");

AddTimer("StopLook", 4.5f, "StopLookTimer");

AddTimer("StartLook1", 4.6f, "StartLookTimer1");

AddTimer("StopLook", 4.5f, "StopLookTimer");

AddTimer("StopMusic", 18.6f, "StopMusicTimer");

}

void LightOffTimer1(string &in asTimer)
{
SetLampLit("1", false, true);
}

void LightOffTimer2(string &in asTimer)
{
SetLampLit("2", false, true);
}

void LightOffTimer3(string &in asTimer)
{
SetLampLit("3", false, true);
SetPlayerActive(true);
}

void StopLookTimer(string &in asTimer)
{
StopPlayerLookAt();
}

void StopMusicTimer(string &in asTimer)
{
StopMusic(0.5f, 1);
}

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

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("work_desk_door_2", false, true);
SetMoveObjectState("work_desk_door_2", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
CompleteQuest("DeskDoor", "DeskDoor");
}

void InteractDeskDoor(string &in asEntity)
{
AddQuest("DeskDoor", "DeskDoor");
}

void InteractBlockedDoor(string &in asEntity)
{
AddQuest("Blocked", "Blocked");
}

void BlockedQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("Blocked", "Blocked");
}

void Locked0(string &in asEntity)
{
SetMessage("Message", "Locked", 0);
}

void UsedItemOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", "Needle_door", 0, false);
RemoveItem(asItem);
}

void StartEvent(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntityExt("awedsasf", "ps_dust_push_15.ps", "Particle_Spawn", false, 1.0f, 0.1f, 0.1f, 1, false, 1, 1, 1, 1);
AddTimer("asdtgeoqtfgd", 1.0f, "LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if{(GetLocalVarInt("Stage") < 10)
AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");
}


void OnEnter()
{
}

void OnLeave()
{
}
07-20-2011, 01:50 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#9
RE: Wind Scare script problem!

(07-20-2011, 01:50 PM)Roenlond Wrote: Try this:
void OnStart()

{
StopSound("Sound_1", 0);
SetPlayerLampOil(0);
//if(ScriptDebugOn())
//
// GiveItemFromFile("lantern", "lantern.ent");
// for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
// SetPlayerLampOil(0);
//
// AddEntityCollideBacks
AddEntityCollideCallback("Player", "Felldown", "Teleport1", true, 1);
AddEntityCollideCallback("Player", "LightsOff", "HallwayLightsOff", true, 1);
SetEntityPlayerInteractCallback("Pick_lock_tool", "Insane_scare", true);
AddUseItemCallback("", "Pick_lock_tool", "Needle_door", "UsedItemOnDoor", true);
AddUseItemCallback("", "crowbar_1", "work_desk_door_2", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "Crowbar_break", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "BlockComplete", "BlockedQuest", true, 1);
AddEntityCollideCallback("Player", "Event_Start_Collide_Area", "StartEvent", true, 1);
}

// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
FadePlayerRollTo(80.0f, 80.0f, 100.0f);
FadeOut(2.45f);
GiveSanityDamage(50, true);
AddTimer("tele", 3, "Teleport");
FadePlayerFOVMulTo(0.35f, 1);
StartEffectFlash(0.2f, 1.0f, 1.0f);
SetPlayerActive(false);
SetPlayerCrouching(false);
}

void Teleport(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
AddTimer("trig1", 8.0f, "beginStory2");
}

void beginStory2(string &in asTimer){
FadeIn(3);
PlayGuiSound("react_scare", 1.0f);
ChangePlayerStateToNormal();
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
PlayMusic("16_amb", false, 3, 3, 10, true);
AddTimer("trig1", 8.0f, "beginStory3");
}

void beginStory3(string &in asTimer){
SetPlayerCrouching(true);
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
SetPlayerMoveSpeedMul(1.0f);
PlayGuiSound("react_breath_slow", 0.7f);
GiveSanityBoostSmall();
}

void Insane_scare(string &in asEntity)
{
SetEntityActive("insane_portrait", true);
SetEntityActive("LightsOff", true);
CreateParticleSystemAtEntity("PSDustPainting", "ps_ghost_release.ps", "insane_portrait", false);
StartPlayerLookAt("insane_portrait", 10, 100, "");
PlaySoundAtEntity("snd_scare", "react_scare.snt", "Player", 0.0, false);
GiveSanityDamage(10, true);
FadeImageTrailTo(3, 1);
FadeSepiaColorTo(5, 1);
FadePlayerFOVMulTo(0.7, 0.05);

AddTimer("insane_portraitON", 0.5f, "TimerInsPortrait");
}

void TimerInsPortrait(string &in asTimer)
{

if (asTimer == "insane_portraitOFF")
{
SetEntityActive("insane_portrait", false);
DestroyParticleSystem("PSDustPainting");
FadeIn(1);
StopPlayerLookAt();
AddTimer("timerReset", 1.0f, "TimerResetPlayer");
}
else
{
FadeOut(1);
AddTimer("insane_portraitOFF", 1.5f, "TimerInsPortrait");
}
}

void HallwayLightsOff(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);

PlayMusic("27_event_bang", false, 1, 1, 1, true);


StartPlayerLookAt("2", 2, 2, "");
StartEffectFlash(0.1, 0.05,0.15);
GiveSanityDamage(20, true);

AddTimer("LightOff1", 2.0f, "LightOffTimer1"); //1st hallway
AddTimer("LightOff2", 5.0f, "LightOffTimer2");
AddTimer("LightOff3", 6.0f, "LightOffTimer3");

AddTimer("StopLook", 4.5f, "StopLookTimer");

AddTimer("StartLook1", 4.6f, "StartLookTimer1");

AddTimer("StopLook", 4.5f, "StopLookTimer");

AddTimer("StopMusic", 18.6f, "StopMusicTimer");

}

void LightOffTimer1(string &in asTimer)
{
SetLampLit("1", false, true);
}

void LightOffTimer2(string &in asTimer)
{
SetLampLit("2", false, true);
}

void LightOffTimer3(string &in asTimer)
{
SetLampLit("3", false, true);
SetPlayerActive(true);
}

void StopLookTimer(string &in asTimer)
{
StopPlayerLookAt();
}

void StopMusicTimer(string &in asTimer)
{
StopMusic(0.5f, 1);
}

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

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("work_desk_door_2", false, true);
SetMoveObjectState("work_desk_door_2", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
CompleteQuest("DeskDoor", "DeskDoor");
}

void InteractDeskDoor(string &in asEntity)
{
AddQuest("DeskDoor", "DeskDoor");
}

void InteractBlockedDoor(string &in asEntity)
{
AddQuest("Blocked", "Blocked");
}

void BlockedQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("Blocked", "Blocked");
}

void Locked0(string &in asEntity)
{
SetMessage("Message", "Locked", 0);
}

void UsedItemOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", "Needle_door", 0, false);
RemoveItem(asItem);
}

void StartEvent(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntityExt("awedsasf", "ps_dust_push_15.ps", "Particle_Spawn", false, 1.0f, 0.1f, 0.1f, 1, false, 1, 1, 1, 1);
AddTimer("asdtgeoqtfgd", 1.0f, "LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if{(GetLocalVarInt("Stage") < 10)
AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");
}


void OnEnter()
{
}

void OnLeave()
{
}

Still not working. No idea where the problem is?

“Life is a game, play it”
07-20-2011, 01:57 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#10
RE: Wind Scare script problem!

you forgot two } at the end.

replace your whole void LoopyTimerCounting with this:

void LoopyTimerCounting(string &in asTimer)
{AddLocalVarInt("Stage", 1);
float fEventSpeed = 0.5f;
switch(GetLocalVarInt("Stage"))
{ case 1:
SetSwingDoorClosed("WindDoor", false, false);
SetSwingDoorDisableAutoClose("WindDoor", true;
AddPropForce("WindDoor", 0, 0, 230.0f, "world");
FadeInSound("Sound_1", 2.0f, true);
break;
}
if(GetLocalVarInt("Stage") < 10){ AddTimer("thisloopsthetimer", fEventSpeed, "LoopyTimerCounting");}
}
07-20-2011, 02:13 PM
Find




Users browsing this thread: 1 Guest(s)