Frictional Games Forum (read-only)
[SCRIPT] Custom story error that I can't solve!? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Custom story error that I can't solve!? (/thread-24493.html)

Pages: 1 2


RE: Custom story error that I can't solve!? - Tiger - 02-01-2014

The "(76, 54)" shows which line the fault in your code is. If you don't already, use notepad++ or something similar so you can see the numbers of lines you have.


RE: Custom story error that I can't solve!? - PutraenusAlivius - 02-01-2014

(02-01-2014, 12:16 AM)Tiger Wrote: The "(76, 54)" shows which line the fault in your code is. If you don't already, use notepad++ or something similar so you can see the numbers of lines you have.

It actually depends on the said error. Usually if it's a typo or no callback or something it would actually show where's the mistake, but if it's a missing (/{ then it would show the end of the code.


RE: Custom story error that I can't solve!? - Radical Batz - 02-01-2014

Well this is how it is

Code:
void OnStart()
{
AddEntityCollideCallback("Handle", "AreaConnect", "AttachLever", true, 1);
wakeUp();
}

void wakeUp()
{
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(10); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(0, 2);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.5, 2);
SetPlayerCrouching(true); // Simulates being on the ground
PlayMusic("18_amb.ogg", true, 1, 4, 1, true);
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
SetPlayerLampOil(45);
GiveSanityDamage(80, false);
GivePlayerDamage(30 , "false" , false, false);
SetPlayerMoveSpeedMul(0.58f);
SetPlayerRunSpeedMul(0);
//SetPlayerLookSpeedMul(0.5);
AddUseItemCallback("", "HollowNeedle", "CellDoor", "UseHollowNeedleOnDoor", true);
}

void UseHollowNeedleOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("CellDoor", false, true);
PlaySoundAtEntity("", "unlock_door.ogg", asEntity, 0, false);
GiveSanityBoostSmall();
RemoveItem(asItem);
}

void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("CellGuardGrunt", true);
AddEnemyPatrolNode("CellGuardGrunt", "Node_1",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_4",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_6",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_10",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_15",0.001f, "");
AddEnemyPatrolNode("CellGuardGrunt", "Node_18",0.001f, "");
}


void AttachLever(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("Lever", true);

    SetEntityActive(asParent, false);
    SetEntityActive("Mount", false);

}

void UnlockDoor(string &in asEntity, int LeverState)
{
    if(LeverState == 1)
    {
        SetSwingDoorLocked("Open", false, true);
        GiveSanityBoostSmall();
        PlaySoundAtEntity("", "unlock_door.ogg", "Open", 0, false);
        SetLeverStuckState(asEntity, LeverState, bool abEffects);
    }
}


void CollideDeadPeople(string &in asParent, string &in asChild, int alState)
{
    GiveSanityDamage(10, true);
    
    PlayMusic("27_event_bang.ogg", false, 1.0, 0, 20, false);
}

and this is the error it's getting me now

FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Lifeless_The Abandon.hps'!
main (76, 55) : ERR : Expected '('

But I can't seem to find anything wrong in that line of the script.
pls tell me if any of you guys do


RE: Custom story error that I can't solve!? - Romulator - 02-01-2014

PHP Code:
void UnlockDoor(string &in asEntityint LeverState)
{
    if(
LeverState == 1
    {
        
SetSwingDoorLocked("Open"falsetrue);
        
GiveSanityBoostSmall();
        
PlaySoundAtEntity("""unlock_door.ogg""Open"0false);
        
SetLeverStuckState(asEntityLeverStatebool abEffects);
    }


Here is your problem. Your SetLeverStuckState has bool abEffects as an effect. Bool means that it must be true or false. Change that to this:

PHP Code:
void UnlockDoor(string &in asEntityint LeverState)
{
    if(
LeverState == 1
    {
        
SetSwingDoorLocked("Open"falsetrue);
        
GiveSanityBoostSmall();
        
PlaySoundAtEntity("""unlock_door.ogg""Open"0false);
        
SetLeverStuckState(asEntityLeverStatefalse);
    }




RE: Custom story error that I can't solve!? - Radical Batz - 02-01-2014

Thanks a bunch it worked Big Grin, the code works fine