Frictional Games Forum (read-only)
[SCRIPT] cs not working on other computer - 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] cs not working on other computer (/thread-20491.html)



cs not working on other computer - darksky - 02-25-2013

hi
i have finished my cs. and it is working fine on my computer.
now as a last test I installed amnesia + justine patch on an other computer.

but there a script is not working the same as on my computer

Code:
void boxblow(string &in asParent, string &in asChild, int alState){
    if (asChild == "script_box2"){
        SetEntityActive("wood_box02_2",true);
        AddPropImpulse("wood_box02_2", 0, -30, -30, "world");
        SetPlayerActive(false);
        AddPlayerBodyForce(0, 0, -45000, false);
        GivePlayerDamage(95, "BloodSplat", true, false);
        FadePlayerRollTo(-90, 70, 70);
        FadeOut(5);
        AddTimer("timer1",7,"changemap");
    }
}

void changemap(string &in asTimer){
    ChangePlayerStateToNormal();
    SetPlayerHealth(100);
    ChangeMap("Main1.map", "PlayerStartArea_1", "", "");
}
on my computer, the camera position is back to normal after map change.
on other computer , it's still -90°

other big problem: map changes through doors are not working.
on my computer I installed amnesia on drive E:, on other computer on drive C:
additional info: I changed the folder name of my story from "Die Fabrik" to "Ein toller Abend" on my computer before copying the cs.

i don't know why, but on other computer amnesia looks for the corresponding map .hps file in a corrupted file path which causes a game crash. the script itself is working fine on my computer.

http://i.imagebanana.com/img/rb96gj5k/error.jpg

(the door properties are correct though
Code:
<Entity Active="true" FileIndex="5" Group="0" ID="170" Name="prisondoor_4" Rotation="0 4.71239 0" Scale="1 1.25 1" Tag="" WorldPos="13 1 17">
                    <UserVariables>
                        <Var Name="CastShadows" Value="true" />
                        <Var Name="StaticPhysics" Value="false" />
                        <Var Name="IsAffectedByDecal" Value="false" />
                        <Var Name="CallbackFunc" Value="" />
                        <Var Name="ConnectedProps" Value="" />
                        <Var Name="ConnectionStateChangeCallback" Value="" />
                        <Var Name="FullGameSave" Value="false" />
                        <Var Name="PlayerLookAtCallback" Value="" />
                        <Var Name="PlayerLookAtCallbackAutoRemove" Value="false" />
                        <Var Name="PlayerInteractCallback" Value="" />
                        <Var Name="PlayerInteractCallbackAutoRemove" Value="false" />
                        <Var Name="TextEntry" Value="hub" />
                        <Var Name="StartPos" Value="StartArea_Main2" />
                        <Var Name="MapFile" Value="E:/Programme/Amnesia - The Dark Descent/redist/custom_stories/Ein toller Abend/maps/Hub.map" />
                        <Var Name="Locked" Value="true" />
                        <Var Name="LockedSound" Value="E:/Programme/Amnesia - The Dark Descent/redist/sounds/door/locked_door.snt" />
                        <Var Name="LockedTextCat" Value="" />
                        <Var Name="LockedTextEntry" Value="" />
                        <Var Name="ShowStats" Value="true" />
                    </UserVariables>
                </Entity>

because of the crash i cannot tell if the other doors are working fine or have the same problem.

HELP.


RE: cs not working on other computer - OriginalUsername - 02-25-2013

Edit: is was being stupid, nevermind


RE: cs not working on other computer - FlawlessHappiness - 02-25-2013

The script you provided does not seem like the full script, since the full script has at least 112 lines.

Could you show us the full script? Smile


RE: cs not working on other computer - darksky - 02-25-2013

the script in my post is not the script which causes the error.
just take a look at the error message. the file path is invalid.

the "wrong" script from the error message is:
Code:
void debug(const string text){
    AddDebugMessage(text,false);
}

const int mustRounds = 3;
int rounds = 0;
bool right1 = false;
bool right2 = false;

void rightround(string &in asParent, string &in asChild, int alState){
    if (asChild == "ScriptRight_1"){
        debug("right 1 , right2 == "+right2);  //  line 112
        if (!right2){
            right1 = true;
        }else{
            rounds--;
            right2 = false;
        }
    }
    if (asChild == "ScriptRight_2"){
        debug("right 2 , right1 == "+right1);  // line 121
        if (!right1){
            right2 = true;
        }else{
            rounds++;
            right1 = false;
        }
    }
    debug(rounds+" / "+mustRounds);
    if (rounds >0){
        SetEntityActive("changeWall_1",true);
        SetEntityActive("changeWall_2",false);
        if(rounds >= mustRounds){
            SetEntityActive("changeWall_3",false);
            SetEntityActive("changeDoorframe_1",true);
            SetEntityActive("changeDoorway_1",true);        
        }else{
            SetEntityActive("changeWall_3",true);
            SetEntityActive("changeDoorframe_1",false);
            SetEntityActive("changeDoorway_1",false);
        }
    }else{
        SetEntityActive("changeWall_1",false);
        SetEntityActive("changeWall_2",true);
        SetEntityActive("changeWall_3",true);
        SetEntityActive("changeDoorframe_1",false);
        SetEntityActive("changeDoorway_1",false);
    }
}

but, the whole story with all its script files is working 100% on my pc. the problem is that it does not work on the other computer.


RE: cs not working on other computer - darksky - 02-25-2013

i tried to start every map using each as the startmap.
two maps script files are causing the crashs.

the one i already mentioned above
Spoiler below!

map file Hub.map

http://i.imagebanana.com/img/rb96gj5k/error.jpg

Code:
void debug(const string text){
    AddDebugMessage(text,false);
}

const int mustRounds = 3;
int rounds = 0;
bool right1 = false;
bool right2 = false;

void rightround(string &in asParent, string &in asChild, int alState){
    if (asChild == "ScriptRight_1"){
        debug("right 1 , right2 == "+right2);  //  line 112
        if (!right2){
            right1 = true;
        }else{
            rounds--;
            right2 = false;
        }
    }
    if (asChild == "ScriptRight_2"){
        debug("right 2 , right1 == "+right1);  // line 121
        if (!right1){
            right2 = true;
        }else{
            rounds++;
            right1 = false;
        }
    }
    debug(rounds+" / "+mustRounds);
    if (rounds >0){
        SetEntityActive("changeWall_1",true);
        SetEntityActive("changeWall_2",false);
        if(rounds >= mustRounds){
            SetEntityActive("changeWall_3",false);
            SetEntityActive("changeDoorframe_1",true);
            SetEntityActive("changeDoorway_1",true);        
        }else{
            SetEntityActive("changeWall_3",true);
            SetEntityActive("changeDoorframe_1",false);
            SetEntityActive("changeDoorway_1",false);
        }
    }else{
        SetEntityActive("changeWall_1",false);
        SetEntityActive("changeWall_2",true);
        SetEntityActive("changeWall_3",true);
        SetEntityActive("changeDoorframe_1",false);
        SetEntityActive("changeDoorway_1",false);
    }
}


and this one

map file endboss.map

http://i.imagebanana.com/img/lnmqv41t/error2.jpg

the lines mentioned in this error message:
Code:
bool[] ready(2,false);  // line 100
string[] loaded(2,"");  // line 101
int hitcount = 0;

void setReady(string &in asParent, string &in asChild, int alState){
    string s = StringSub(asChild, 10, 1);
    debug("substring : "+s);
    if (s=="0"){
        ready[0] = true;
        loaded[0] = asParent;
    }else{    
        if (s=="1") {
            ready[1] = true;
            loaded[1] = asParent;
        }
    }
    debug(asParent);
    ChangePlayerStateToNormal();
    SetEntityInteractionDisabled(asParent,true);
}
string lamp;

void fire(string &in asEntity){
    string s = StringSub(asEntity, 7, 1);
    debug("substring : "+s);
    if (s == "0"){
        AddPropImpulse(loaded[0], 8.4, 10, -10, "world");
        loaded[0] = "";
    }else{
        if (s == "1"){
            AddPropImpulse(loaded[1], -7.2, 10, -10, "world");
            loaded[1] = "";
        }
    }
    lamp = asEntity;
    GiveItemFromFile("tinderbox", "tinderbox.ent");
    AddTimer("t1",0.5,"off");    
}

could it be that the script engine is broken in the other computer? or do i miss some required frameworks / etc ?