• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Creating object editor data from tables

Level 8
Joined
Aug 1, 2023
Messages
34
Warcraft 3's map editor (World Edit) has a dedicated module (Object Editor [OE]), for creating game object templates that can be used during gameplay to create runtime objects (units, items, trees, etc). The OE allows map makers to modify the values of object fields in a type safe manner (an integer field cannot be set with a string value). But there are some problems with the OE. It is slow (copying/deleting/renaming objects is not instant). It uses a fixed tree structure (organizing units by race). The object fields listing is also fixed (sorted, there is ctrl+f search functionality though). The point is that the OE is not a very good editor for editing tables, but it is type safe.

This post has a small proof of concept tool (w3o-from-csv.exe) attached, that can generate object editor data (units, items, destructables, doodads, buffs/effects and upgrades, but not abilities) from '.csv' files.

For example, putting the following table in a file called my-units.csv
Code:
unitId,baseUnitId,hitpointsMaximumBase,startingStrength,movementSpeedBase
H000,Hpal,101,1,999
h001,hfoo,1500,,1

and running the w3o-from-csv tool on it:
Code:
w3o-from-csv -uf my-units.csv

would generate a 'war3map.w3u' file that has 1 hero unit and 1 normal unit in it.

tip: editing a plain '.csv' file, even in a good spreadsheet editor (LibreOffice Calc, Excel, etc), is not great. Editing a 'xlsx' file and then converting it to a 'csv', is better.

edit: this tool is no longer a proof of concept (it can now generate abilities as well), you can download it from here.
 
Last edited:
Level 8
Joined
Aug 1, 2023
Messages
34
Why not just use wurst

How would the above table translate to wurst? What tools are there for editing the data in wurst?

Putting the data in a table format allows you to edit it using powerful tools like 'LibreOffice Calc' and 'Excel'. The 'csv' format is also simple enough to parse, so that map specific tools could easily be created that check/generate/modify the data and also use it to generate script code (jass, wurst, lua, etc.), for example.
 
Top