How to - Use the Object Merger

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
I've been doing this since NewGen came out :p good to know that other people are using it. :thup:
 

Azlier

Old World Ghost
Reaction score
461
>Do we have to delete the lines of code after we create the objects?
You should. Otherwise it will create new objects every time you save, lengthening save time by an annoying amount and overwriting existing ones.

>I've been doing this since NewGen came out
Why didn't YOU write the tutorial, then? I wrote it the day after I learned how to use the Object Merger. :p
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
I didn't want people to blame me for crashing their maps. Me and Builder Bob where probably the only ones who where aware of it's feature.
 

Romek

Super Moderator
Reaction score
963
> Me and Builder Bob where probably the only ones who where aware of it's feature.
I've been aware of this for a very long time too... :rolleyes:

It'd be useful to mention that existing objects are overwritten by new ones with the same ID.
 

Light Alkmst

New Member
Reaction score
20
Codes

For the field codes as used on the first page, I can't find them. I know about the codes from Ctrl + D, and I know they're different. For whatever reason, when I ran NewGen on the school computers, they would display those codes. On my computer at home, it doesn't show up. How can I turn these codes on?
 

Azlier

Old World Ghost
Reaction score
461
:confused:

I see no option to turn that on or off. I'm assuming you're using NewGen, of course. But, I don't think I could turn those off if I tried.
 

Light Alkmst

New Member
Reaction score
20
That's not good...

Can you just give me the codes for these then?

Unit Base Damage
Unit Base Armor
Unit Max HP
 

Builder Bob

Live free or don't
Reaction score
249
For the field codes as used on the first page, I can't find them. I know about the codes from Ctrl + D, and I know they're different. For whatever reason, when I ran NewGen on the school computers, they would display those codes. On my computer at home, it doesn't show up. How can I turn these codes on?

From the main window in the Warcraft 3 World Editor
-> Grimore -> Enable object editor hack

Make sure it's checked, then restart the editor.
 

Light Alkmst

New Member
Reaction score
20
Ok, I've got another problem here. I've tried using the Object Merger in a text macro, but I'm have some trouble...

JASS:

library Sparta initializer Absolute
    //! textmacro SPARTANS takes NUMBER, DAMAGE, ARMOR, NEXT, SPAWNS
    //! external ObjectMerger w3u n001 S$NUMBER$ anam "Spartan $NUMBER$" ua1b $DAMAGE$ udef $ARMOR$ uhpm $NUMBER$
    private function Filt$NUMBER$ takes nothing returns boolean
        return GetUnitTypeId(GetTriggerUnit()) == 'S$NUMBER$'
    endfunction
    
    private function Conditions$NUMBER$ takes nothing returns boolean
        return GetUnitTypeId(GetTriggerUnit()) == 'S$NUMBER$'
    endfunction
    
    private function Actions$NUMBER$ takes nothing returns nothing
        local group g = CreateGroup()
        local integer c = 0
        
        call GroupEnumUnitsInRect(g, GetWorldBounds(), Condition(function Filt$NUMBER$))
        if (FirstOfGroup(g) == null) then
            loop
                exitwhen c == $SPAWNS$
                call IssuePointOrder(CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'S$NEXT$', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit())), "attack", 0., 0.)
                set c = c + 1
            endloop
        endif
        
        call DestroyGroup(g)
        set g = null
    endfunction
    
    private function Init$NUMBER$ takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH)
        call TriggerAddCondition(t, Condition(function Conditions$NUMBER$))
        call TriggerAddAction(t, function Actions$NUMBER$)
    endfunction
    //! endtextmacro
    //! runtextmacro SPARTANS("001", "1", "1", "002", "1")
    //! runtextmacro SPARTANS("002", "1", "1", "003", "1")
    //! runtextmacro SPARTANS("003", "1", "1", "004", "1")
    //! runtextmacro SPARTANS("004", "1", "1", "005", "1")
    //! runtextmacro SPARTANS("005", "1", "1", "006", "1")
    //! runtextmacro SPARTANS("006", "1", "1", "010", "1")
    //! runtextmacro SPARTANS("010", "1", "1", "001", "1")
    
    private function Absolute takes nothing returns nothing
        call Init001()
        call Init002()
        call Init003()
        call Init004()
        call Init005()
        call Init006()
        call Init010()
    endfunction
endlibrary


It says that anam is not a valid field for Object Merger...

EDIT: I think I got it. anam should be unam

EDIT: EDIT: It compiles and runs fine now, but the created units are heroes...I don't want that...
 

Builder Bob

Live free or don't
Reaction score
249
Code:
//! external ObjectMerger w3u [B]n001[/B] S$NUMBER$ anam "Spartan $NUMBER$" ua1b $DAMAGE$ udef $ARMOR$ uhpm $NUMBER$

EDIT: EDIT: It compiles and runs fine now, but the created units are heroes...I don't want that...

n001 is the base unit you're using for all those other units. If n001 is a hero, then all other units based on it will also be heroes. Change the base unit to another raw code.

By the way. You don't have to run the object merger code every time you save. Just save once, then restart the editor. The unit will be in your object editor now. Comment out the line, so it won't run the next time you save.
 

Azlier

Old World Ghost
Reaction score
461
Uncapitalize the S in the desired rawcode. Units with capitalized letters as the first character in their raw codes like to be heroes.
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
When I save my map it tells me:

External not found in config fileé "ObjectMerger"

Please tell me what's the problem.
 

Azlier

Old World Ghost
Reaction score
461
>Please tell me what's the problem.

I wouldn't know, sorry.
 

WaterElement

New Member
Reaction score
0
It's a good tutorial, I guess, though I managed to work it all out for myself after looking at the BonusMod textmacros for about 20 minutes anyway. The level thing did confuse me for a while though, and this tutorial could have helped a lot then.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top