Object Positioning

Results 1 to 4 of 4
  1. #1
    Valued Member xadet3 is offline
    MemberRank
    Sep 2006 Join Date
    Norwich, EnglandLocation
    108Posts

    Object Positioning

    Hi,

    I was wondering if anyone could help me with how to calculate object and sfx positions? This is my first time playing around with Flyff files and I've never played the game so I'm pretty clueless.

    This is what it is so far (red is for objects, blue for sfx, ignore the terrain texture I haven't figured out tiling fully yet)



    using the code

    Code:
    for (int j = 0; j < objectCount; j++)
    {
        int type = fh.Read<int>();
    
        switch (type)
        {
            case 0:
                {
                    fh.Read<float>();
                    fh.Read<float>();
                    fh.Read<float>();
                    fh.Read<float>();
    
                    Vector3 position = new Vector3()
                    {
                        X = fh.Read<float>(),
                        Y = fh.Read<float>(),
                        Z = fh.Read<float>()
                    };
    
                    Vector3 scale = new Vector3()
                    {
                        X = fh.Read<float>(),
                        Y = fh.Read<float>(),
                        Z = fh.Read<float>()
                    };
    
                    fh.Read<int>();
                    int modelID = fh.Read<int>();
                    fh.Read<int>();
                    fh.Read<int>();
                    fh.Read<int>();
    
                    models.Add(new Model()
                    {
                        Position = position,
                        Scale = scale,
                        ModelID = modelID
                    });
                }
                break;
        }
    }
    Any help would be greatly appreciated.

    Thanks,
    xadet


  2. #2
    Account Upgraded | Title Enabled! AccountDeleted is offline
    MemberRank
    Jul 2008 Join Date
    296Posts

    Re: Object Positioning

    Did you reverse the height maps yet?...

    I've got a bit of shit coded for map editing so far was planing on creating a full custom map editor.

    I've already written a script which goes through the heightmap and grabs all the stats like barriers and etc but been to busy to reverse the newer versions of the o3d files and figure out how the actual objects are placed...

    I've got the XYZ calculation for the maps built already as well.

  3. #3
    Alpha Member GlaphanKing is offline
    MemberRank
    Sep 2008 Join Date
    World of MorrowLocation
    2,594Posts

    Re: Object Positioning

    nice to see another editor may see the light of day. I like the map you guys made for fame btw.

  4. #4
    Valued Member xadet3 is offline
    MemberRank
    Sep 2006 Join Date
    Norwich, EnglandLocation
    108Posts

    Re: Object Positioning

    Looked into it again today and it was incredibly simple.

    If anyone's interested (although the axis will be different depending on what API you're using)

    Code:
    Position = new Vector3()
    {
        X = ((y * 128) * 4.0f) + (Position.X * 4.0f),
        Y = ((x * 128) * 4.0f) + (Position.Z * 4.0f),
        Z = Position.Y
    }



Advertisement