Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 12 Vote(s) - 4.58 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update coming! Brave testers needed!
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#39
RE: Update almost ready! Brave testers needed!

The math and string parsing functions are a really useful addition Smile. The lean bug also seems to be totally fixed.

Some bugs with AddAttachedPropToProp:
Spoiler below!

AddAttachedPropToProp afRotZ is still used as the position parameter. This is likely a simple typo in the script function wrapper.
void testAttachedPropToPropFixed(string base, string file)
{
    //Test Positioning
    for(float x=0.0f; x<10.0f; x+=1.0f)
    for(float y=0.0f; y<10.0f; y+=1.0f)
    for(float z=0.0f; z<10.0f; z+=1.0f)
        AddAttachedPropToProp(base,"x"+x+"y"+y+"z"+z,file,x,y,z,0,0,0);
        
    /*
     This should produce a cube of props with no rotation.
     It instead produces a wall of props (over x&y) as afPosZ does nothing.
    */
}

void testAttachedPropToPropBroken(string base, string file)
{
    //Test Positioning
    for(float x=0.0f; x<10.0f; x+=1.0f)
    for(float y=0.0f; y<10.0f; y+=1.0f)
    for(float z=0.0f; z<10.0f; z+=1.0f)
        AddAttachedPropToProp(base,"x"+x+"y"+y+"z"+z,file,x,y,0,0,0,z);
        
    /*
     This should produce a wall of props (over x&y) with different rotations.
     instead it produces a cube with z rotation along Z axis as afRotZ is also used as afPosZ
    */
}

Spoiler below!

Using AddAttachedPropToProp in conjunction with ReplaceEntity can cause the game to crash:
void OnStart()
{
    CreateEntityAtPosition("test","barrel01.ent",5,0,0);
}


const string originProp = "barrel";
void CreateEntityAtPosition(string name,string file,float x, float y, float z)
{
    //Using ZRot for ZPos due to AddAttachedPropToProp bug
    string tempPropname = "temp_" + name + "_atch";
    AddAttachedPropToProp(originProp,tempPropname,file,x,y,0,0,0,z);
    ReplaceEntity(tempPropname,"",name,file,false);
    //RemoveAttachedPropFromProp(originProp,tempPropname);
}
Interestingly, uncommenting the RemoveAttachedPropFromProp line prevents the crash. This is possibly the same issue as the attach then break bug.

Spoiler below!

Attaching multi-body props only attaches the primary body. E.g.
AddAttachedPropToProp("barrel","chest_of_drawers_nice_1","chest_of_drawers_nice.ent",0,0,0,0,0,0);
Will not attach the drawers (they will get stuck at 0,0,0).


Level editor compound export
Spoiler below!

This is the level editor bug with exporting compounds i posted late in the request topic. A simple workaround fix for now would be to temporarily break the compounds before exporting (Do whatever B on an active compound does). To recreate the bug, add any entity to an empty map, create compound and export the compound using file->export selection. Importing the object will fail. Below is a sample expobj file of the above case:
<Level>
    <MapData FogActive="false" FogColor="1 1 1 1" FogCulling="true" FogEnd="20" FogFalloffExp="1" FogStart="0" GlobalDecalMaxTris="300" Name="" SkyBoxActive="false" SkyBoxColor="1 1 1 1">
        <MapContents>
            <FileIndex_StaticObjects NumOfFiles="0" />
            <FileIndex_Entities NumOfFiles="1">
                <File Id="0" Path="entities/container/barrel01/barrel01.ent" />
            </FileIndex_Entities>
            <FileIndex_Decals NumOfFiles="0" />
            <StaticObjects />
            <Primitives />
            <Decals />
            <Entities />
            <Misc>
                <Compound Active="true" Group="0" ID="1" Name="Compound_1" Rotation="0 0 0" Scale="1 1 1" Tag="" WorldPos="3.25 0 0.5">
                    <Component ID="0" />
                </Compound>
            </Misc>
            <StaticObjectCombos />
        </MapContents>
    </MapData>
</Level>
The component ID is referencing a non-existent entity entry - the exporting process exports the compound but forgets to export the stuff inside the compound.


SetBodyMass & Interaction
Spoiler below!

Calling SetBodyMass while interacting with props has some weird results. Adjusting the mass while holding the prop results in the mass getting reset after letting go
void OnStart()
{
    SetEntityPlayerInteractCallback("barrel","InteractionCB",false);
    timer("test");
}
void InteractionCB(string &in asEntity)
{
    AddDebugMessage("Before Mass:" + GetBodyMass(asEntity + "_Body_1"),false);
    SetBodyMass(asEntity + "_Body_1",50);
}
void timer(string &in t)
{
    AddDebugMessage("Mass:" + GetBodyMass("barrel_Body_1"),false);
    AddTimer(t,1.0f,"timer");
}

Giving a prop a negative mass then trying to grab the prop will cause it to fly off really fast.

(This post was last modified: 09-26-2013, 06:07 PM by Apjjm.)
09-26-2013, 05:25 PM
Find


Messages In This Thread
Update coming! Brave testers needed! - by Patrik - 09-25-2013, 08:28 PM
RE: Update almost ready! Brave testers needed! - by Apjjm - 09-26-2013, 05:25 PM



Users browsing this thread: 11 Guest(s)