Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

PlayInfo.AddSetting and arrays?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PlayInfo.AddSetting and arrays?

    I have the following bit of code in my mutator:
    Code:
        PlayInfo.AddSetting(default.RulesGroup, "XSVehicleClassName0", default.ReplacementLabelText0, 0, 1, "Select", VehicleOptions);
        PlayInfo.AddSetting(default.RulesGroup, "XSVehicleClassName1", default.ReplacementLabelText1, 0, 1, "Select", VehicleOptions);
        PlayInfo.AddSetting(default.RulesGroup, "XSVehicleClassName2", default.ReplacementLabelText2, 0, 1, "Select", VehicleOptions);
    It works, but it's not really maintenance friendly. I'd like it to be more like so:
    Code:
        for(i = 0; i < default.XSVehicleClassName.length; i++)
        {
            PlayInfo.AddSetting(default.RulesGroup, "XSVehicleClassName(" $ i $ ")", default.ReplacementLabelText[i], 0, 1, "Select", VehicleOptions);
        }
    But that won't work, because the resulting "XSVehicleClassName(0)" is not recognized as a valid property.

    Anybody know how I can use PlayInfo.AddSetting to set array properties?

  • #2
    You can't, specially not when using the standard display thingies (e.g. webadmin's default rules and the ingame settings widget).

    In my UsUnit project I started on a proper PlayInfo to HTML converter thingy for which I did add support for arrays (not completely finished though).

    Comment


    • #3
      Getting the compiler to recognize that the PropName contains an array name with index is the problem. I'm not sure if that's related to the "display thingies", unless you mean the display thingy can't parse the index part.

      Comment


      • #4
        It's not the compiler that is complaining, it's the code of PlayInfo.

        But still SomeArray is a property, SomeArray[0] is not a property. And you can only add properties.

        The code of PlayInfo contains some initial support for arrays and structs but it was never finished (and on top of that there are a few bugs that make it even worse).

        Comment


        • #5
          That makes sense. Guess I'll have to stick to the "ugly" way then. :sour:

          Thanks for the explanation!

          Comment

          Working...
          X