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

ObjectMerger Channelability

Status
Not open for further replies.
Level 26
Joined
Aug 18, 2009
Messages
4,097
Hi,
I want to create ANcl-based abilities via ObjectMerger (that is included in JNGP) and there are the two special fields Ncl2 (targetType) and Ncl3 (options) on Channel. Both are integer fields in raw but in GUI one displays a combo box, the other multiple checkboxes (bitflagging).

Ncl3 should be set to Visible and Unique Casting for example, which would be the integer 17.

However, when using the ObjectMerger like
JASS:
makechange(current, "Ncl3", 1, 17)

it takes some ordinal number in ascii of the given input, 14129 would be the result here.

So I thought I had to reverse the process. This tutorial stated "\xxx" would do the trick and I also found string.char(<number>). Both methods seemed to work, the object editor displayed the right values then. Now, it did not work ingame and I have opened the w3a with a hex editor. That revealed that the ObjectMerger indicated Ncl2/Ncl3 as string fields and stored the values as strings, so no miracle the object editor seemed to show things properly.

Anyone got an idea how to tell the ObjectMerger that these two fields are integers? Any input made it considering them strings for now.

Thanks in advance.
 
Level 8
Joined
Nov 25, 2003
Messages
208
Hello WaterKnight.
From what i remember the tool uses the AbilityMetaData.slk file to determine the data type of the field.
So a possible workaround would be having a modified slk in your local folder - it would have the side effect of not showing the dropdown / checkboxes in the ability editor i guess.

The only proper fix would be fixing the ObjectMerger function that determines the data type. But atm I don't have a computer properly set up to compile and test it.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Thanks for your reply.

I've made it like you suggested and looked up the AbilityMetaData.slk. Although, according to the chart near the end of this post, the hex editor displays Ncl2/Ncl3 normally as ints, in the slk, Ncl2 is defined as channelType and Ncl3 as bool, so I guess both are just integer wrappers but you have something like

Code:
if type == "int" then value = 0
elseif type == "real" then value = 1
elseif type == "unreal" then value = 2
else value = 3

in ObjectMerger, defaulting exotic things like channelType to string.

Overwriting the slk with these two fields as ints works, ObjectMerger plays along.

In case you want to update ObjectMerger sometime, I can additionally say that the function "setobjecttype" is executed very slowly for me.

Maybe, else, the AbilityMetaData.slk could also be automatically replaced and put back for each time saving via lua script.
 
Level 8
Joined
Nov 25, 2003
Messages
208
I just remembered that this problem sounded familiar and that I had already fixed it a long time ago. There's a hotfix in the following thread: http://www.wc3c.net/showthread.php?t=90661&highlight=grimext
There might have been more updates after that so it's probably best to use the one from the latest NewGen release: http://www.wc3c.net/showthread.php?t=90999&highlight=grimext

Some delay in "setobjecttype" is due to the loading of the appropriate MetaData.slk and Data.slk, maybe that's what you're experiencing.
It's done in setobjecttype because for example if you only want to work with abilities, you won't need the item / unit / upgrade files etc. loaded.
Otherwise you'd have to wait longer at startup of the tool.

I might just reinstall War3 and MinGW some time this week.
I'm kind of in programming mood and I was thinking about re-doing Widgetizer in C/C++ properly.
 
Status
Not open for further replies.
Top