Creating units locally

luorax

Invasion in Duskwood
Reaction score
67
I've already opened a thread about this like a month ago or two, but I did not get any response, so I'm back.

The question is: Does creating a unit with "none" pathing map cause desyncs? Because AFAIK it causes desyncs because of the pathing differences. But what happens if the unit is unpathable?

Some in-depth info: my upcoming AoS map uses a hero as shop. Its portrait is under your hero's icon. But my map also uses the "shared advanced unit control" trick to show the team icons at the left side. Sadly even the icons of the shops appear there, which looks weird (obviously).

So what should I do?
A,
JASS:

function foo takes player p returns nothing
    if GetLocalPlayer()==p then
        call CreateUnit(p,'SHOP',0.,0.,0.)
    endif
endfunction


B,
JASS:

function foo takes player p returns nothing
    local integer id='SHO2' //CnP the unit type but the portrait icon is turned off
    if GetLocalPlayer()==p then
        set id='SHOP'
    endif
    call CreateUnit(p,id,0.,0.,0.)
endfunction


EDIT: added a screnshoot.
 

Attachments

  • WC3ScrnShot_081811_153412_01.jpg
    WC3ScrnShot_081811_153412_01.jpg
    480.8 KB · Views: 172

inevit4ble

Well-Known Member
Reaction score
38
You want only your(player's) shop to appear on left whilst all players shops show?
 

luorax

Invasion in Duskwood
Reaction score
67
@inevit4ble: Exactly. But wait, I've added a screenshot.

@dudeim: I've not tested it before, that's why I'm asking.
I know that if the unit that's created on only one computer causes desyncs if tries to interact with something else. But this unit is just a dummy, has no pathing map, model, or anything like that.
 

luorax

Invasion in Duskwood
Reaction score
67
I can not now as my mate has internet connection problems. That's why I had to open this thread.
But I'll test it as soon as he becomes available again.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
of course it will cause desyncs. at least in the moment your hero buys anything from the shop, because then (if not already desynched before) the item will only be sold at one computer and not at the others.

i would say your best chance is to get rid of the "shared advanced unit control". As far as i understood you want to use it in order to see the hitpoints of your allies, is this correct? if so, you could spawn dummy heroes for every player representing the allies of that player and periodically match the hitpoints and mana of the dummies with their corresponding original heroes.
 

luorax

Invasion in Duskwood
Reaction score
67
The shop doesn't sell anything. I'm using dummy abilities (because I have to level them up/down to change their tooltips, depending on the recipe compontents the hero has) with no effect or anything like that.
Also, what about the "B" version? I think I really have to test it.

And lastly, about spawning dummy units: It'd be okay but AFAIK there's no way to separae their icon. There would be no distance between the shop icon and the first ally. I think I'll have to figure out a new way to show the health of allies or to select the icon...

P.S.: I just realised that my statboard is bugged - forgot to change the Attack Damage part to the new wrapper "GetUnitDamage" function :p
 

luorax

Invasion in Duskwood
Reaction score
67
Well, I decided to use the "Worker" classification, and to be honest, it looks even better. It's closer to the interface and that way I can easily hide it (by hiding the interface icon).

Thanks for the responses tho'.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top