• 🏆 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!

[General] [Object Merger] Pure coded Object Editor Data

Status
Not open for further replies.

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
Not directly, no; but you can always export/import object data files directly, so if you don't want LUA generated objects in your map, just export your "clean" object editor data before you run the objectmerger script and test your map, then re-import the cleaned object data.

Also, if you don't restart Newgen after running objectmerger and comment out all LUA script, then save again with the script commented out, the LUA generated objects are gone:

-> Enable objectmerger
-> Save
-> Test map
-> Disable objectmerger (without restarting editor before)
-> Save again
... map is back to blank state.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Not directly, no; but you can always export/import object data files directly, so if you don't want LUA generated objects in your map, just export your "clean" object editor data before you run the objectmerger script and test your map, then re-import the cleaned object data.
I meant to hide the generated objects not the "clean" objects. Also, it was merely for convenience why I asked so that Object Editor is cleaner hence easier to work with. If I need to export/import every test map, then I'd rather work with disorganized Object Editor. Generated Objects were not meant to be edited that's why I want to hide it.

So how did Buff Libraries do their thing? Do they instruct the users to comment out a textmacro'ed Object Merger once it finished generating its objects.
 
Level 13
Joined
Nov 7, 2014
Messages
571
You could open a blank map, generate the abilities (and/or any other object data) there, and then
using WE, export the ability data (and/or the other object data) to a file called
war3campaign.w3a (for ability data, war3campaign.w3u for units, etc.) and then import
these files to your actual map (you have to remove the war3mapimported\ path from the full path).

The data inside those war3campaign.w3a|u|etc. files doesn't seem to show up in the editor and it seems to be usable in-game. It doesn't load any faster, but this technique seems useful for exactly this purpose, i.e keeping the WE clean from script generated object data that is unlikely to be edited from inside the editor.

I don't know how this interacts with map optimizing tools (Widgetizer, etc.), though.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
You could open a blank map, generate the abilities (and/or any other object data) there, and then
using WE, export the ability data (and/or the other object data) to a file called
war3campaign.w3a (for ability data, war3campaign.w3u for units, etc.) and then import
these files to your actual map (you have to remove the war3mapimported\ path from the full path).

If I do that, it will overwrite the abilities in the Object Editor, after all, objects in Object Editor will be compiled to the w3a file, but since I imported a w3a file to the original path, it will take priority and the map will end up using that instead of the abilities in Object Editor.
 
Level 13
Joined
Nov 7, 2014
Messages
571
If I do that, it will overwrite the abilities in the Object Editor, after all, objects in Object Editor will be compiled to the w3a file, but since I imported a w3a file to the original path, it will take priority and the map will end up using that instead of the abilities in Object Editor.

You import the war3campaign.w3a|u| etc. files via the Import Manager (F12) not using the Import Ability|Unit|etc. Settings option in the editor.
The map's object data are stored in war3map.w3a|u| etc. and this is war3campaign.w3a|u etc. so there is no overwriting?

If it's just about organizing the object editor, not speeding it up (as generated objects will eventually slow down the OE), then the easiest solution is giving the generated objects an unused OE category (or race) to have them all in a single folder.
This is a good idea as well.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
@Aniki
If you import it, it will be overwritten

Seems like there's no other way other than using another Folder to dump all generated abilities.

Follow up questions, what are the available API for the lua script extension.

1. Can I read values (like anam) from a certain object?
2. Can I check if an object already exist?

I'll +rep you all later.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
To extend upon what others said:

1) No, reading is not possible.
2) Afaik, this is also not possible. But is that really a problem? Just define a series of unused rawcodes for your objects. With 256^4 possibilities, there should be plenty of unused space. I mostly order my LUA generated stuff by giving them a unique ID in the first two letters of the rawcode:

'AS00'-'ASZZ'
'AT00'-'ATZZ'
...
you get the idea.

There is literally no chance ever for this to collide with the manually created object data, since the asigned default rawcode gets incremented from A000, which means you would need over 65.536 abilities to ever reach "S" as the second character.

And if you are really worried about collision, use a symbol instead of a regular char, as these will never be asigned automaticly: 'A#00' - A#ZZ'
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
The reason why I wanna check if the object exists or not is, to create a lua script that will only generate the object if the object does not exist yet so I don't have to disable/comment out the script after generating the object, but at the same time, it won't take a lot of time each save in executing external commands.

Anyways, thanks guys for the response. Thread is still open for someone who has revolutionary information.
 
Status
Not open for further replies.
Top