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 cs not working on other computer
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#1
cs not working on other computer

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

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
<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.
02-25-2013, 02:33 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: cs not working on other computer

Edit: is was being stupid, nevermind
(This post was last modified: 02-25-2013, 02:44 PM by OriginalUsername.)
02-25-2013, 02:41 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: cs not working on other computer

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

Trying is the first step to success.
02-25-2013, 02:41 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#4
RE: cs not working on other computer

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:
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.
(This post was last modified: 02-25-2013, 02:55 PM by darksky.)
02-25-2013, 02:53 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#5
RE: cs not working on other computer

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

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:
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 ?
02-25-2013, 04:21 PM
Find




Users browsing this thread: 1 Guest(s)