GetLocalPlayer in order to hide unit

BlueMirage

Trust, but doubt.
Reaction score
39
GetLocalPlayer in order to "hide" unit

In my map, I have 12 specific shops of the same type. I need them to be able to sell 3 different items depending on the state of the unit that is buying from it. However, since different units should only be able to buy different stuff, I think I can't use the same shop.

So I've been thinking, maybe I create 3 shops ontop of eachother with no pathing, and use GetLocalPlayer() to either make the building invisible by giving it insane fly height a la Crow Form (possible at all with buildings?) or by just manipulating the item table locally.

Is this possible?
 

Nestharus

o-o
Reaction score
84
either ugly shadow or desync

SetUnitX/SetUnitY locally is better

put invis ones outside of playable area or w/e
 

Jedi

New Member
Reaction score
63
Hide will desync as far as I know, maybe you can try change vertex color or scale.
 

Nestharus

o-o
Reaction score
84
Using the method I just told you won't desync.

Well, actually when the shop sells the item, I'm not sure ; D.


If it desyncs on sell, then your only option is through height, which will give a fugly shadow : D.
 

BlueMirage

Trust, but doubt.
Reaction score
39
"Hiding" a unit will desync, that much I know.
Height changes shadows? Good to know.
Well, it's a building so it hardly needs one. Changing height seems like a plausible idea.

What about changing the actual item table? I think there's an action for that...

Also, setting their X/Y outside of the map seems like a bad idea, since it's referenced in other triggers.

I might as well explain what it does.

It's a "shop" that acts as the control unit of a base. I have 12 captureable bases in my map, and the shop acts as a way to capture / uncapture by selling (for free) triggered items.
The shop has 3 variants. It can either be a base you own, a base your opponents own or a base that no team owns.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I highly think that it would desync, even if we care about such things like enter/leave region event fire, GroupEnumUnitsInRange and so one (talking about the SetUnitX/Y way).

Because if on Player1's pc the hero X can buy in the Shop A but not on Player2's pc, then it's a different case, and when this hero buy on Player1's pc it would desync with Player2.
Same for the hide thing.

So i think the only good way is to make a dummy object and replace it with the good one on buying event.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
When it is interacted with, it will most likely desync. AFAIK, the best way is vertex coloring and set unit scale to minimum. (to get rid of the shadow) But even then it is probably still dangerous.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
When it is interacted with, it will most likely desync. AFAIK, the best way is vertex coloring and set unit scale to minimum. (to get rid of the shadow) But even then it is probably still dangerous.
But the unit would still be able to buy in this shop, no ?
At least with hotkeys i think.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Set Unit Z then?
Z doesn't matter in the range of an unit, wc3 is a pseudo 3D game in many things, like the range.
And anyway let's imagine the height of an unit does matter for the possibility of buy an item or not (which is absolutely wrong), it would desync like i said before.

But i'm not totally sure about the desync, you can try the SetUnitXY thing, or even the hide stuff to be sure.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Hmm..
For Z-height + Range..

Pythagoras' Theorem on Pythagoras' Theorem?

01) Get the distance between shop and patron using Pythagoras' Theorem.
02) Get the Z-height of the shop
03) SquareRoot((Z-Height of shop)^2 + (Distance between)^2)

I duno, lol
That way, you can pretty much get the proper range (in pixels or whatever unit of measurement WC3 uses)
 

Nestharus

o-o
Reaction score
84
Yea, for SetUnitX/Y, as i said before, I wasn't sure if it would desync or not when the shop would sell an item. I do know if that you were to do that with a unit and the unit got a move order, you'd get an immediate desync.

So as you see, it might not desync on a sell order. Hold Position and Stop did not desync the game with the units when the unit had a different x/y position for each player in the game.


Actually you might be able to pull it off... if you were to sell an item and then give the item to a unit or set item x/y for all of the players, I bet it will work. The item will initially be desynced, but it'll sync up afterwards ; D.

in pixels or whatever unit of measurement WC3 uses

Warcraft 3 is measured in pixels. Of this I am 100% certain. Why? Tiles are 128x128 pixel images. When they go into wc3, they fit over a 128x128 spot. This means that images and what not are measured in pixels.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Seriously, Pythagore won't save us here, unless he come back to life and edit the wc3 engine.
 

Nestharus

o-o
Reaction score
84
Oh yea, here's another possibility. Have it so when you select a shop, it auto selects the appropriate shop for the player. Shops are somewhere far off or w/e. When the player buys an item, it'll auto put that item on to the local shop's selected unit ; D.
 

BlueMirage

Trust, but doubt.
Reaction score
39
Oh yea, here's another possibility. Have it so when you select a shop, it auto selects the appropriate shop for the player. Shops are somewhere far off or w/e. When the player buys an item, it'll auto put that item on to the local shop's selected unit ; D.
This seems like a good idea, as it will not require local triggering at all. Only problem is that the event "Unit Selection" is somewhat slow if I remember correctly, but it should not be a problem really.

But you guys are sure that setting Z locally is not an option? From my understanding, it has no direct impact on the game and thus it should not desync, but maybe it does?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
It shouldn't desync but it also simply shouldn't work as intended, because it would still be clickable, and anyway the shop would still select the hero.
 

BlueMirage

Trust, but doubt.
Reaction score
39
A unit with 20000 Z offset can't be clicked.
Even if it selects the hero, it would not matter since the hero cannot buy from it since it cannot select it, correct?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
A unit with 20000 Z offset can't be clicked.
Ok, if you say it.

Even if it selects the hero, it would not matter since the hero cannot buy from it since it cannot select it, correct?
Wrong i think, because of hotkeys, or you can remove/disable in some way hotkeys ?

EDIT : Ok you can delete an hotkey for an item inside the object editor, nevermind.
But i'm wondering now an hero can "be selected by a shop" only one at a time, right ?
 

BlueMirage

Trust, but doubt.
Reaction score
39
Only one unit that one player controls at a time. There is no issue as long as each unit is controlled by a different player.
Wrong i think, because of hotkeys, or you can remove/disable in some way hotkeys ?
The hotkeys of a hero can in no way affect those of a shop.

Well, I've gotten some good answer so far, so I'll just say that I'm satisfied. Thanks for the ideas everyone!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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