Page 1 of 1

Map file parsing...

Posted: Sat Nov 05, 2011 11:49 pm
by BrakeDanceJ
Hey guys,

I am writing some scripts to read through maps. I have been able to dump the objects/actors in the top section of the map...

Code: Select all

  [8] => Array
        (
            [0] => 62
            [1] => 6
            [2] => OldLocation
        )

    [9] => Array
        (
            [0] => 110
            [1] => 1
            [2] => Scale
        )

    [10] => Array
        (
            [0] => 101
            [1] => 6
            [2] => Brush
        )

    [11] => Array
        (
            [0] => 104
            [1] => 1
            [2] => Light
        )

    [12] => Array
        (
            [0] => 116
            [1] => 1
            [2] => Outer
        )

    [13] => Array
        (
            [0] => 114
            [1] => 3
            [2] => PostScale
        )

    [14] => Array
        (
            [0] => 101
            [1] => 6
            [2] => MainScale
        )

    [15] => Array
        (
            [0] => 101
            [1] => 6
            [2] => CsgOper
        )

    [16] => Array
        (
            [0] => 114
            [1] => 6
            [2] => Rotator
        )

    [17] => Array
        (
            [0] => 114
            [1] => 2
            [2] => Rotation
        )

    [18] => Array
        (
            [0] => 110
            [1] => 1
            [2] => Top
        )

    [19] => Array
        (
            [0] => 112
            [1] => 6
            [2] => Base
        )

    [20] => Array
        (
            [0] => 101
            [1] => 1
            [2] => PlayerStart
        )

    [21] => Array
        (
            [0] => 116
            [1] => 1
            [2] => Clip
        )

    [22] => Array
        (
            [0] => 112
            [1] => 1
            [2] => RocketCan
        )

    [23] => Array
        (
            [0] => 110
            [1] => 1
            [2] => Health
        )

    [24] => Array
        (
            [0] => 104
            [1] => 1
            [2] => ShowFlags
        )

    [25] => Array
        (
            [0] => 115
            [1] => 6
            [2] => ShellBox
        )

    [26] => Array
        (
            [0] => 120
            [1] => 1
            [2] => ASMDAmmo
        )

    [27] => Array
        (
            [0] => 111
            [1] => 1
            [2] => RifleAmmo
        )

    [28] => Array
        (
            [0] => 111
            [1] => 1
            [2] => FootRegion
        )

    [29] => Array
        (
            [0] => 110
            [1] => 6
            [2] => HeadRegion
        )

    [30] => Array
        (
            [0] => 110
            [1] => 6
            [2] => bAdmin
        )

    [31] => Array
        (
            [0] => 110
            [1] => 6
            [2] => Player
        )

    [32] => Array
        (
            [0] => 114
            [1] => 6
            [2] => RendMap
        )

    [33] => Array
        (
            [0] => 112
            [1] => 6
            [2] => StingerAmmo
        )

    [34] => Array
        (
            [0] => 111
            [1] => 1
            [2] => TorchFlame
        )

    [35] => Array
        (
            [0] => 101
            [1] => 1
            [2] => bHiddenEd
        )

    [36] => Array
        (
            [0] => 100
            [1] => 6
            [2] => DrawScale
        )

    [37] => Array
        (
            [0] => 101
            [1] => 1
            [2] => WaterZone
        )

    [38] => Array
        (
            [0] => 101
            [1] => 1
            [2] => PolyFlags
        )

    [39] => Array
        (
            [0] => 115
            [1] => 6
            [2] => PrePivot
        )

    [40] => Array
        (
            [0] => 116
            [1] => 6
            [2] => FlakBox
        )

    [41] => Array
        (
            [0] => 120
            [1] => 1
            [2] => URL
        )

    [42] => Array
        (
            [0] => 76
            [1] => 1
            [2] => Rifle
        )

    [43] => Array
        (
            [0] => 101
            [1] => 1
            [2] => Eightball
        )

    [44] => Array
        (
            [0] => 108
            [1] => 1
            [2] => T2
        )

    [45] => Array
        (
            [0] => 50
            [1] => 1
            [2] => Stinger
        )

    [46] => Array
        (
            [0] => 114
            [1] => 1
            [2] => ASMD
        )

    [47] => Array
        (
            [0] => 68
            [1] => 1
            [2] => OrthoZoom
        )

    [48] => Array
        (
            [0] => 109
            [1] => 6
            [2] => Misc1
        )

    [49] => Array
        (
            [0] => 49
            [1] => 6
            [2] => Song
        )

    [50] => Array
        (
            [0] => 103
            [1] => 1
            [2] => bHidden
        )

    [51] => Array
        (
            [0] => 110
            [1] => 6
            [2] => Minigun
        )

    [52] => Array
        (
            [0] => 110
            [1] => 1
            [2] => bDynamicLight
        )

    [53] => Array
        (
            [0] => 116
            [1] => 6
            [2] => LevelInfo
        )

    [54] => Array
        (
            [0] => 111
            [1] => 1
            [2] => Author
        )

    [55] => Array
        (
            [0] => 114
            [1] => 1
            [2] => TimeSeconds
        )

    [56] => Array
        (
            [0] => 115
            [1] => 1
            [2] => IdealPlayerCount
        )

    [57] => Array
        (
            [0] => 116
            [1] => 1
            [2] => LevelEnterText
        )

    [58] => Array
        (
            [0] => 116
            [1] => 1
            [2] => DefaultGameType
        )

    [59] => Array
        (
            [0] => 101
            [1] => 1
            [2] => AIProfile

But where are the values stored for each in the file? For example, player count? Also, how am I detecting what the external file references are (e.g. textures)?.. I am able to find their names in my array, but how can I tell if they're external texture package names, or just something internal like "Rifle"?

Re: Map file parsing...

Posted: Sun Nov 06, 2011 2:25 am
by []KAOS[]Casey
Looks like you're reading the list of names on the packages nametable. Doing this for fun, or is there a reason you want to do this for?

Re: Map file parsing...

Posted: Sun Nov 06, 2011 9:24 am
by Smirftsch
A deeper look into an example map can be done with UTPT, I think this should answer already a lot of questions. http://www.acordero.org
There is also a delphi library for UT on this page which probably contains a lot of answers, even if not using delphi. Personally I never tried to access these informations "from the outside", so can't answer that question without looking myself...

Re: Map file parsing...

Posted: Sun Nov 06, 2011 3:39 pm
by Marzanna
BrakeDanceJ, http://wiki.beyondunreal.com may answer many questions.
Also utcms, openut, umr and ushock sources can help a lot.

Re: Map file parsing...

Posted: Sun Nov 06, 2011 8:55 pm
by BrakeDanceJ
A deeper look into an example map can be done with UTPT, I think this should answer already a lot of questions. http://www.acordero.org
There is also a delphi library for UT on this page which probably contains a lot of answers, even if not using delphi. Personally I never tried to access these informations "from the outside", so can't answer that question without looking myself...
Has to be in PHP, but I'll look over the code. Thanks!  ;)
Looks like you're reading the list of names on the packages nametable. Doing this for fun, or is there a reason you want to do this for?
Mhmm.  ;)

BrakeDanceJ, http://wiki.beyondunreal.com may answer many questions.
Also utcms, openut, umr and ushock sources can help a lot.
Thanks. I'll be pouring through code for a while  :)