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
Script Help What's causing this pls?[SOLVED, //for some strange reason, lol]
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#1
What's causing this pls?[SOLVED, //for some strange reason, lol]

Hello once again my fellow forum members, today I just made a script for my maps and this happens when loading it, I and my friend just checked the script and have no idea exactly what is the prob that is causing this error to occur
---------------------------
FATAL ERROR
---------------------------
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon Ch1/maps/Ch02/10_Sewer.hps'!
main (68, 2) : ERR  : Expected expression value
main (72, 3) : ERR  : Expected expression value
main (76, 3) : ERR  : Expected expression value
main (80, 3) : ERR  : Expected expression value
main (90, 3) : ERR  : Expected expression value
main (97, 3) : ERR  : Expected expression value
main (101, 3) : ERR  : Expected expression value
main (105, 3) : ERR  : Expected expression value
main (112, 3) : ERR  : Expected expression value
main (118, 3) : ERR  : Expected expression value

---------------------------
OK  
---------------------------

Yeah it's a long error, if you guys can find the error then pls tell me where it is, cause I can't continue my cs with this error now. Thnx Smile

Edit: Oops sorry, just posted the thread without showing my hps

Well this is it
PHP Code: (Select All)
//-------------------------------------------------------

//GENERAL HELPERS

//This starts an event timer, with the state set to 0 (just to be sure)
void ResumeEventTimer(string &in asTimer)
{
    
SetLocalVarInt(asTimer0);
    
ResumeEventTimer(asTimer0);
}

//Resumes an event timer after a step is over.
void ResumeEventTimer(string &in asTimerfloat afTime)
{
    
AddTimer(asTimerafTimeasTimer);
}

//-------------------------------------------------------

void OnStart()
{
    
AddEntityCollideCallback("Player""AreaBreath""CollideAreaBreath"true1);
    
SetEntityPlayerInteractCallback("FakeCrank""InteractWithCrank"true);
    
SetEntityPlayerInteractCallback("LadderArea""InteractWithLadder"true);
    
SetMessage("Messages""chapter2"0);
    
GiveSanityBoostSmall();
    
AddEntityCollideCallback("Player","AreaDustEnter","CollideDustPaper",true,1);
    
AddEntityCollideCallback("Player","DieFool","CollideDieFool",false,1);
    
AddEntityCollideCallback("Player","Fall","FallEvent",true,1);
    
AddUseItemCallback("getoil""DirtyContainer""AreaGetOil""UseContainerOnOil"false);
    
AddUseItemCallback("""glass_container_oil_1""FakeCrank""OilContainerOnFakeCrank"false);
    
AddUseItemCallback("""LadderPiece1""LadderPiece_1""UseLadder1Onarea"false);
    
AddUseItemCallback("""LadderPiece2""LadderPiece_2""UseLadder2Onarea"false);
    
GiveSanityBoostSmall();
    
PlayMusic("19_puzzle_inject.ogg"false0.7f010false);
    
AddEntityCollideCallback("wood_box03_1""DamageArea_1""Impact1"false1);
    
AddEntityCollideCallback("wood_box03_1""DamageArea""Impact2"false1);
    
AddEntityCollideCallback("wood_box01_1""DamageArea""Impact2"false1);
    
AddEntityCollideCallback("wood_box01_1""DamageArea_1""Impact1"false1);
    
AddEntityCollideCallback("wood_box01_2""DamageArea_1""Impact1"false1);
    
AddEntityCollideCallback("wood_box01_2""DamageArea""Impact2"false1);
    
AddEntityCollideCallback("wood_box_small01_1""DamageArea""Impact2"false1);
    
AddEntityCollideCallback("wood_box_small01_1""DamageArea_1""Impact1"false1);
    
AddEntityCollideCallback("chair_wood02_1""DamageArea""Impact2"false1);
    
AddEntityCollideCallback("chair_wood02_1""DamageArea_1""Impact1"false1);
    
AddEntityCollideCallback("Fall_1""Player""CollideRockVSPlayer"true1);
    
SetPropHealth("castle_1"50.0f);
}
 
void FallEvent(string &in asParentstring &in asChildint alState)
{
    
ResumeEventTimer("TimerFallEvent");
    
    
StartScreenShake(0.02f0.5f0.8f2.0f);
    
PlaySoundAtEntity("rumble""general_rock_rumble_no3d.snt""Player"0.5ftrue);
}
 
void TimerFallEvent(string &in asTimer)
{
    
string sEvent asTimer;    //Using first timer name for variable, timer name and callback for the timer that loops
    
AddLocalVarInt(sEvent1);    //What step to play in the event (if sEvent is 1, case 1 is played)
    
float fEventSpeed 1.0f;    //The default time between steps in an event
    
bool bPauseAtStep false;    //Pauses after current step is done (a ResumeEventTimer would unpause)
    
    
switch(GetLocalVarInt(sEvent)){
        case 
1:
            
StartScreenShake(0.009f0.0f4.0f2.0f);
    
´        PlaySoundAtEntity("scare""explosion_rock_large""Fall_2"1false);
            
StopSound("rumble"0.2f);
            
fEventSpeed 0.1f//Set this as temporarly default time
        
break;
        case 
2:
            
StartPlayerLookAt("Fall_2"21"");
            
fEventSpeed 0.1f;
        break;
        case 
3:
            
SetEntityActive("Fall_1",true);
            
bPauseAtStep true//Pause here until the rocks hits the player
        
break;
        case 
4:
            
StopPlayerLookAt(); //Just in case
            
SetPlayerActive(false);
            
ChangePlayerStateToNormal(); //In case the player still manages to hold the ladder
            
PlaySoundAtEntity("scare""player_falldamage_med.snt""Player"0.5false);
            
PlaySoundAtEntity("scare""player_bodyfall.snt""Player"0false);
            
StartPlayerLookAt("servant_grunt_1"21""); 
            
TeleportPlayer("PlayerStartArea_3");
            
fEventSpeed 0.1f;
        break;
        case 
5:
            
//Before showing vision to player, make it look like player is lying down (legit)
            
FadePlayerRollTo(7510100);
            
MovePlayerHeadPos(-0.2f, -1.3f0100.5f);
            
SetRadialBlurStartDist(0.5f); //Blur vision too :D
            
FadeRadialBlurTo(0.1f0.01f);
        break;
        case 
6:
            
PlayGuiSound("react_breath"1.0f);
            
fEventSpeed 4.0f;
        break;
        case 
7:
            
SetMessage("Messages""hoursago"0);
            
fEventSpeed 5.0f;
        break;
        case 
8:
            
SetEntityActive("servant_grunt_1"true);
            
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0.0f"");
            
FadeIn(2);
            
//AddEffectVoice("voices", "BackHere.ogg", "Voice", "BackHere", false, "Player", 1, 1);
            
fEventSpeed 3.0f;
        break;
        case 
9:
            
FadeOut(3);
            
StartPlayerLookAt("ScriptArea_3"4.0f4.0f"");
            
PlayGuiSound("react_sigh"1.0f);
            
fEventSpeed 4.0f;
        break;
        case 
10:
            
//SetRadialBlurStartDist(1.0f);
            
FadeRadialBlurTo(00.1f);
            
StopMusic(3.00);
        
ChangeMap("11_Start_Redux","PlayerStartArea_1","22_end","");
            
//Use FadePlayerRollTo(0, 10, 60); & MovePlayerHeadPos(0, 0, 0, 1, 0.5f); when
            //you wanna tilt his head back to normal
        
break;
    }
    
    if(
GetLocalVarInt(sEvent) <= 10 && bPauseAtEvent==false)
    {
        
ResumeEventTimer(sEventfEventSpeed);
    }
}

void CollideRockVSPlayer(string &in asParentstring &in asChildint alState)
{
    
FadeOut(0.1f);
    
    
//Impact sound
    
PlaySoundAtEntity("rockcrush""impact_rock_high.snt""Player"0.0ffalse);
    
PlaySoundAtEntity("rockcrush""impact_organic_med.snt""Player"0.0ffalse);
    
    
ResumeEventTimer("TimerFallEvent"1.0f);
}

//-------------------------------------------------------
   
void UseLadder1Onarea(string &in asItemstring &in asEntity)
{
RemoveItem(asItem);
SetPropActiveAndFade("ladder_mount_2"true0.5f);
SetEntityActive("LadderPiece_2"true);
 
PlaySoundAtEntity("breaths""05_attach_ladder.ogg""ladder_mount_2"0.0ffalse);
}

void UseLadder2Onarea(string &in asItemstring &in asEntity)
{
RemoveItem(asItem);
SetPropActiveAndFade("ladder_mount_1"true0.5f);
 
SetEntityActive("LadderArea_1"true);
PlaySoundAtEntity("breaths""05_attach_ladder.ogg""ladder_mount_1"0.0ffalse);
}

void CollideAreaBreath(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("rocks""03_rock_move.snt""AreaBreath_1"0.0ffalse);
    
CreateParticleSystemAtEntity("warnps""ps_cave_monster_warn.ps""AreaBreath_1"false);
    
StartScreenShake(0.01f0.5f2.0f3.5f);
    
PlaySoundAtEntity("breaths""04_breath.snt""AreaBreath_1"0.0ffalse);
    
PlaySoundAtEntity("rocksm""03_rock_move.snt""AreaBreath_1"RandFloat(2.0f,6.0f), false);
    
CreateParticleSystemAtEntity("breathps""ps_cave_monster_breath.ps""AreaBreath_1"false);
}

void CollideDieFool(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("fallaaaaaah""11_fall""Player"0false);
    
CheckPoint ("""PlayerStartArea_2""CheckPoint03""Hints""Hint3");
    
    
FadeOut(0.5f);
    
    
AddTimer("death1"0.5f"TimerFallDeath");    
    
AddTimer("death2"1"TimerFallDeath");    
}

void TimerFallDeath(string &in asTimer)
{    
    if(
asTimer == "death1"){
        
PlaySoundAtEntity("bump1""player_bodyfall""Player"0false);
        return;
    }    
    
    
DisableDeathStartSound();
    
AddPlayerHealth(-200);
    
    
PlaySoundAtEntity("pain""player_falldamage_max""Player"0false);
    
PlaySoundAtEntity("bump2""player_bodyfall""Player"0false);
}    

void CollideDustPaper(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("Wind""general_wind_whirl""Player"2false);
     
CreateParticleSystemAtEntity("PSDoor_3""ps_dust_whirl.ps""AreaDust"false);
}

void InteractWithCrank(string &in asEntity)
{
    
SetMessage("Messages""NeedOil"0);
    
AddQuest("InteractWithCrank""Oil");
    
PlaySoundAtEntity("rocks""16_lever_stuck.ogg""FakeCrank"0.0ffalse);
}

void InteractWithLadder(string &in asEntity)
{
    
SetMessage("Messages""Ladder"0);
    
AddQuest("InteractWithLadder""Ladder");
    
PlaySoundAtEntity("rocks""18_touch_bridge1.ogg""LadderArea"0.0ffalse);
}

void UseContainerOnOil(string &in asItemstring &in asEntity)
{
    
RemoveItem(asItem);
    
AddTimer("AddContainer"1.1f"TimerAddContainer");    
    
AddTimer("StartCrouch"0.8f"TimerCrouch");    
    
AddTimer("StopCrouch"1.4f"TimerCrouch");        
    
AddTimer("AddContainer"1.6f"TimerStopLookAt");
    
    
    
    
SetLocalVarInt("FilledContainer"1);

    
SetEntityPlayerInteractCallback("AreaOil"""false);
    
    
StartPlayerLookAt("AreaLookAtContainer"33"");
}

void TimerAddContainer(string &in asTimer)
{
    
DestroyParticleSystem("ParticleSystem_42");
    
SetEntityActive("glass_container_oil_1"true);
    
    
CreateParticleSystemAtEntity("fill""ps_oil_jar""glass_container_oil_1"true);
    
    
PlaySoundAtEntity("slurp""16_fill_oil""glass_container_oil_1"0.0ffalse);
}

void TimerCrouch(string &in asTimer)
{
    if(
asTimer == "StartCrouch"){
        
SetPlayerCrouching(true);
        
PlaySoundAtEntity("crouch""player_crouch""Player"0.0ffalse);
        
PlaySoundAtEntity("slurp2""16_water_stream""glass_container_oil_1"0.3ffalse);
        return;
    }
    
    
SetPlayerCrouching(false);
    
PlaySoundAtEntity("stand""player_stand""Player"0.0ffalse);
}

void TimerStopLookAt(string &in asTimer)
{
    
StopPlayerLookAt();    
    
StopSound("slurp2"4.0f);
}

void EntityCallGlassContainer(string &in asEntitystring &in type)
{
    
DestroyParticleSystem("fill");
    
CreateParticleSystemAtEntity("oilsplah""ps_oil_splash.ps""AreaLookAtContainer"true);
    
    
SetEntityPlayerInteractCallback("AreaOil""InteractAreaOil02"false);
}

void OilContainerOnFakeCrank(string &in asItemstring &in asEntity)
{
    
SetLeverStuckState(asEntity0true);
    
RemoveItem(asItem);
    
GiveItemFromFile("DirtyContainer""glass_container.ent");
    
CompleteQuest("InteractWithCrank""Oil");
    
SetEntityActive("crank_iron_1"true);
    
CreateParticleSystemAtEntity("oilsplah""ps_oil_grease.ps""PS"true);  
        
PlaySoundAtEntity("stand""16_grease_lever.ogg""FakeCrank"0.0ffalse);
}

void MoveBridge(string &in asEntityint LeverState)
{
    if(
LeverState == 1
    {
        
PlaySoundAtEntity("unstucksound""16_bridge_unstuck""ladder"0.0ffalse);    
    
PlaySoundAtEntity("fall""16_winch_bridge""ladder"1.0ftrue);

    
AddTimer("hitground"1.0f"TimerBridgeHitGround");
    
    
StartScreenShake(0.05f0.5f0.1f0.3f);
    
    
SetMoveObjectStateExt("ladder"1.12880.5false);
    
    
GiveSanityBoostSmall();
    
PlayMusic("23_puzzle.ogg"false0.7f010false);
        
SetLeverStuckState(asEntityLeverStatefalse);
 }
 
}

void TimerBridgeHitGround(string &in asTimer)
{
    
StopSound("fall"0.3f);    
    
StartScreenShake(0.01f1.0f0.1f0.5f);
    
PlaySoundAtEntity("stucksound""18_bridge_hit""ladder"0.0ffalse);    
}

//Break through the jammed door, barrel and stone can be used to break through.

float Distance 0.25f;

void TooLight(string &in asParent string &in asChild int alState)
{
    
SetMessage("Messages""TooLight"0);
}

void Impact1(string &in asParent string &in asChild int alState)
{
    
AddTimer("ImpactTime" 1.0f "HitTime"); // This doesnt need to call anything
}

void Impact2(string &in asParentstring &in asChildint alState)
{
    
float Time = (1.05f GetTimerTimeLeft("ImpactTime")); // Get's the time taken to impact
    
float Speed = (Distance Time); // Gets the speed
    
if(Speed >= 1.8f// Minimum necessary speed
    
{
        if (
GetPropHealth("castle_1") == 50)
        {
            
SetPropHealth("castle_1"30.0f);
        }
        else
        {
            
SetPropHealth("castle_1"0.0f);
        }
    }
    else
    {
        
SetMessage("Messages""TooWeakThrown"0);
    }
}

void OnEnter()
{
    
PlayMusic("16_amb.ogg"true0.710true);
    
AutoSave();
}

void OnLeave()
{



(This post was last modified: 06-25-2014, 05:56 PM by Radical Batz.)
06-25-2014, 11:39 AM
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#2
RE: What's causing this pls?

You've got a wrong symbol at line 68.

Quote:
PHP Code: (Select All)
switch(GetLocalVarInt(sEvent)){
        case 
1:
            
StartScreenShake(0.009f0.0f4.0f2.0f);
   
´       PlaySoundAtEntity("scare""explosion_rock_large""Fall_2"1false); 

If you don't draw first, you don't get to draw at all... -The False Shepherd
06-25-2014, 11:53 AM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#3
RE: What's causing this pls?

(06-25-2014, 11:53 AM)RaideX Wrote: You've got a wrong symbol at line 68.

Quote:
PHP Code: (Select All)
switch(GetLocalVarInt(sEvent)){
        case 
1:
            
StartScreenShake(0.009f0.0f4.0f2.0f);
   
´       PlaySoundAtEntity("scare""explosion_rock_large""Fall_2"1false); 

Well thnx it doesn't get that error anymore but now it gets this new one here

PHP Code: (Select All)
---------------------------
FATAL ERROR
---------------------------
FATAL ERRORCould not load script file 'custom_stories/Lifeless_The Abandon Ch1/maps/Ch02/10_Sewer.hps'!
 
main (12837) : ERR  'bPauseAtEvent' is not declared
 main 
(1285) : ERR  Expression must be of boolean type

---------------------------
OK   
--------------------------- 

06-25-2014, 12:08 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: What's causing this pls?

The boolean parameter is called bPauseAtStep, not bPauseAtEvent.

Derp.
06-25-2014, 12:32 PM
Find




Users browsing this thread: 1 Guest(s)