LogicAndTrick / sledge-formats

C# parsers and formats for Half-Life 1 and related engines.
MIT License
71 stars 10 forks source link

Can't access fgd behaviour dictionary in S2 #25

Open xPaw opened 1 year ago

xPaw commented 1 year ago
@PointClass
    base( Targetname, Parentname, CanBeClientOnly, Light2Inputs )
    omnilight()
    metadata
    {
        entity_tool_name = "Omni Light"
        entity_tool_tip = "Omni directional light source"
        entity_tool_group = "Lighting"
        entity_tool_sortname = "lights2"
        default_pitch = 90.0
    }
    iconsprite
    {
        image = "materials/editor/light_omni.vmat"
        tintKey = "color"
    }
= light_omni2 : "A sphere or tube shaped light"

In this example, class.Behaviour for iconsprite has no values, and the actual values are in class.Dictionaries, but as far as I can tell there is no way to know which dictionary to access for this behaviour since I don't know which dictionary index it is.

LogicAndTrick commented 1 year ago

I might have to review how the library separates dictionaries and behaviours, since it seems that S2 treats them somewhat the same. But dictionaries have a Name field that you can use, to see which property the dictionary is associated with:

image

xPaw commented 1 year ago

Indeed I can look at the name, VS annoyingly hid it and only displayed the values.