A textmacro issue

Rllulium

New Member
Reaction score
10
I've ran into an annoying little problem. The following:
JASS:
    //! textmacro Test takes PLAYER, NR
    call SelectUnitForPlayerSingle( gg_unit_n202_00$NR$, Player($PLAYER$) )
    call SetCameraTargetControllerNoZForPlayer( Player($PLAYER$), gg_unit_n202_00$NR$ , 0, 0, false )
//! endtextmacro
//! runtextmacro Test("0","23")

does not do anything, where as:
JASS:
call SelectUnitForPlayerSingle( gg_unit_n202_0023, Player(0) )
call SetCameraTargetControllerNoZForPlayer( Player(0), gg_unit_n202_0023 , 0, 0, false )

does. They compile to the same code, so I have no idea why.
 

Rushhour

New Member
Reaction score
46
I'm not sure this is your problem, but you should know that these direct unit-variables like "gg_unit_n202_0023" are first created when clicking on the unit from a GUI trigger (for example Remove unit- and selecting the unit with the mouse oneself)
Even if you see the end-"number" of the unit when you put the mouse on it the variable isnt yet created^^
 

Rllulium

New Member
Reaction score
10
I'm not sure this is your problem, but you should know that these direct unit-variables like "gg_unit_n202_0023" are first created when clicking on the unit from a GUI trigger (for example Remove unit- and selecting the unit with the mouse oneself)
Even if you see the end-"number" of the unit when you put the mouse on it the variable isnt yet created^^

Actually, they seem to automaticlly create themselves when the map is closed and reopened.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Actually, they seem to automaticlly create themselves when the map is closed and reopened.
Hard to believe.
Last time i checked it worked like Rushhour said.

Maybe you closed the map without save it and the gui action was there ?
 

Rllulium

New Member
Reaction score
10
Hard to believe.
Last time i checked it worked like Rushhour said.

Maybe you closed the map without save it and the gui action was there ?

More specificlly, I write the code that contains the variables, I close the map, I reopen it, I save it and then there are no compile errors and the code functions properly. But yeah, it doesn't exactly generate the variables for GUI use.
 

Anachron

New Member
Reaction score
53
Why do you create units in world editor then? Create them on map initialisation, and it will fix your problem.

Can you also please write the textmacro call?
 

Rllulium

New Member
Reaction score
10
Why do you create units in world editor then? Create them on map initialisation, and it will fix your problem.

Can you also please write the textmacro call?

This is not really an issue that has to be resolved anymore, as I decided to just write the code instead of using the macro. I was mostly fishing for some sort of confirmation of whether preplaced units cannot be called in textmacros.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top