Scripting unit/behaviour/weapon/etc. data is possible

Discussion in 'Starcraft 2 (SC2) Editor Help' started by Vestras, May 8, 2010.

  1. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Yes, that's right. Clicking isn't necessary for that either. (Some of you might know already though)
    Some of you might also know that I'm developing a WC3/SC2 IDE (Integrated Development Environment) called Moonlite.
    Now, I don't know how you guys feel about object editing in the GE, but I for one don't like how I am forced to constantly click (like GUI) around.
    However, I have good news for those of you who feel the same as me:
    Since the way objects are defined in maps is through Xml, it's possible to actually "script" a map's objects instead of clicking. I'm planning to make Moonlite support this.

    But, yes, there is a but, I need your help. Since the formats of the WE was rather tricky and never actually the same (there was always some random thing that modified the format into being something else that I had to write code for), I need your help to find out how the format looks so I can write a .xsd document (a file that describes how Xml files should "look", look it up) for the code completion of Moonlite.

    In order to extract the data files, you will have to use an MPQ extractor. The files are located at this path: "Base.SC2Data\GameData\". Here you will find an array of files, and I want you to post the contents of all other files than the "WaterData.xml" file.

    Here are some data I've extracted, just to give you an idea of how it'd work:
    BehaviorData.xml:
    Code:
    <?xml version="1.0" encoding="us-ascii"?>
    <Catalog>
        <CBehaviorBuff id="Explode">
            <InfoFlags index="Hidden" value="1"/>
            <EditorCategories value="Race:Terran,AbilityorEffectType:Units"/>
            <RemoveValidatorArray value="CliffLevelEqualOrLesser2"/>
            <FinalEffect value="MarauderSet"/>
            <ExpireEffect value="MarauderSet"/>
        </CBehaviorBuff>
    </Catalog>
    
    MoverData.xml:
    Code:
    <?xml version="1.0" encoding="us-ascii"?>
    <Catalog>
        <CMoverMissile id="MarauderWeapon">
            <MotionPhases index="0">
                <Driver value="Ballistic"/>
                <Acceleration value="0"/>
                <MinSpeed value="10"/>
                <MaxSpeed value="10"/>
                <IgnoresTerrain value="1"/>
                <ParabolaClearance value="-1"/>
                <YawPitchRoll value="5568.75"/>
                <PowerslideAngle value="358.9892"/>
                <AttachReacquireDeflection value="358.9892"/>
                <FlightTime value="-1"/>
            </MotionPhases>
        </CMoverMissile>
    </Catalog>
    
    UnitData.xml:
    Code:
    <?xml version="1.0" encoding="us-ascii"?>
    <Catalog>
        <CUnit id="Marauder">
            <Response value="Flee"/>
            <LifeRegenRate value="125"/>
        </CUnit>
        <CUnit id="MarauderLMWeapon">
            <BehaviorArray Link="Explode"/>
        </CUnit>
    </Catalog>
    
    ValidatorData.xml:
    Code:
    <?xml version="1.0" encoding="us-ascii"?>
    <Catalog>
        <CValidatorLocationCompareCliffLevel id="CliffLevelEqualOrLesser2">
            <WhichLocation Value="SourceUnit"/>
            <OtherLocation Value="OriginPoint"/>
            <Compare value="LE"/>
        </CValidatorLocationCompareCliffLevel>
    </Catalog>
    
    WeaponData.xml:
    Code:
    <?xml version="1.0" encoding="us-ascii"?>
    <Catalog>
        <CWeaponLegacy id="Marauder">
            <Range value="10"/>
        </CWeaponLegacy>
    </Catalog>
    
    Get to it :)

    EDIT: I'll upload the schemes to my website for editing when I get a little further, then you guys can contribute as we proceed.
    EDIT 2: I wrote a .xsd generator tool. It generates .xsd files from .xml files, so now I don't have to write them anymore. I uploaded it to this post. (Hint: type "help" without quotes)
     

    Attached Files:

  2. overload119

    overload119 New Member

    Ratings:
    +5 / 0 / -0
    I am patiently waiting for your IDE.

    Is it going to be injectable into Galaxy editor. Don't tell me we have to alt-tab, and CnP all the time :(

    Code completion, and that thing TESH had where it outlines the methods? In that area, put a little description of what it does too? Please, please!

    In regards to your post, I don't really get what you want from us. Is it the data files? Why don't you just extract them yourself, it isn't hard =/.

    I actually seem to have this lying around back from when I was making maps manually, it might have what you want.
     

    Attached Files:

  3. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Oh, yes, yes, yes! Give me more! This is exactly what I need! The thing I need the most is someone who made an actual, functional map. (Something that is in a complete, presentable state)

    The reason I can't do this myself is because I have a lot of work to do on Moonlite (xsd reading, making an xml editor, code completion, etc.) I simply don't have time to make maps.

    It's not going to be integrated with the GE, and if you use all the features of Moonlite (scripting, object editing and importing files), the only thing (AFAIK) you'll need the GE for is terrain, map info and preplaced objects. Also, why would you CnP? Moonlite is integrated with the GE ;)

    Outlines methods? What do you mean? Description of what? I don't understand :p
     
  4. Sevion

    Sevion The DIY Ninja

    Ratings:
    +423 / 0 / -0
    When he says integrated, I think he means he wants to know if it'll be like NewGen was.
     
  5. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    I know. That was what I was replying to :p
     
  6. Weep

    Weep Godspeed to the sound of the pounding

    Ratings:
    +400 / 0 / -0
    There's going to be a Mac version of Moonlite, right? ;)

    Or at least, it'll run in WINE, right? :eek:

    [/hijack]
     
  7. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Well, it could, if only Mono and WINE fully supported all Win32 APIs. Unfortunately they don't at the time, so no. Get yourself a copy of Windows 7 and install it to your Mac :thup:
     
  8. overload119

    overload119 New Member

    Ratings:
    +5 / 0 / -0
    This is what I mean by little tooltips that pop up when you put the first brackets in, it'll show.
     

    Attached Files:

  9. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Oh, yes, it does. It has that and a live preview of the native/BJ you're using's code.
     
  10. overload119

    overload119 New Member

    Ratings:
    +5 / 0 / -0
    Awesome, when is it coming out :)?
     
  11. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    The full version? Probably a couple weeks after Starcraft 2. Not promising anything though, there might be more tweaks than I think.
    I was actually planning to release an open beta last week, but I decided I wanted to implement full Galaxy functionality now that the GE is out. Currently I'm implementing the object editing and then I need to integrate Andromeda with it. (Andromeda is going to be used by Moonlite a lot, Gex and I are working together on making Andromeda the background syntax checker, compiler, and code completion parser provider)
     
  12. Renendaru

    Renendaru (Evol)ution is nothing without love.

    Ratings:
    +309 / 0 / -0
    So... Just assuming, as I don't fully understand yet, but you want us to extract the Base.Sc2Data archive in the Sc2 Beta folder... Is that right?
     
  13. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Nope, in maps that are edited you will find the Base.SC2Data folder, which contains a GameData folder. Inside that folder, there are a lot of xml files, I want you to zip them and upload them in a post here. :)
     
  14. Renendaru

    Renendaru (Evol)ution is nothing without love.

    Ratings:
    +309 / 0 / -0
    Is this what you needed? Wasn't sure...

    Edit: Nevermind, this should be it.
     

    Attached Files:

    • Gah.zip
      File size:
      5.4 KB
      Views:
      132
  15. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Bump!
     
  16. punwisp

    punwisp New Member

    Ratings:
    +34 / 0 / -0
    I'm liking this so far, including the talk of a simpler Object Editor and I guess, more features on the terraining?

    And what kind of map do you need? A finished map in general? If thats what you want, I have a 4 player FFA map fully terrained and set up. After a bit of description and crap like that it will be set.
     
  17. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Not terraining features, that will have to be done via the GE. (Implementing a 3D editor is too much for me :p)
    Yes, I'll gladly take that map.

    Also, Gex told me that he had an idea of a language for creating objects, like his GMSI. I don't know whether I should support that or generic Xml. His version seems more efficient.
    What do you guys think?
     
  18. Lyerae

    Lyerae I keep popping up on this site from time to time.

    Ratings:
    +105 / 0 / -0
    XML would be easier, I think.
     
  19. Vestras

    Vestras Retired

    Ratings:
    +249 / 0 / -0
    Difficulty isn't a problem. I think in the end everyone would rather have an efficient language than an inefficient language. Let's put it in perspective: would rather you rather type/CnP ~5000 lines of Xml or have a ~20 line script to generate/modify the object(s)?
     
  20. phyrex1an

    phyrex1an Staff Member and irregular helper Staff Member

    Ratings:
    +446 / 0 / -0
    Ofc, with xml you have xls. But, I'm going to quote myself here:

    Don't go make the same mistake please. Make the language that generate the xml the same as the one that generates the galaxy. Make them integrated into each other. eg, for the setup function of your triggered AI you'll also be able to create new unit types. Running this code through your preprocessor would produce both the xml data for the units as well as the AI galaxy code.
     

Share This Page