Will this GetLocalPlayer function cause desynch?

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Hi there :D

Here I am, using GetLocalPlayer for the first time to create my own function. I was hoping someone could take a look at it and let me know if it will cause a desynch, because I don't really understand the function or the concept by how it works.

Here it is:
JASS:
function HideItemFromPlayer takes item i, player p returns nothing
    if GetLocalPlayer() == p then
        call SetItemVisible(i,false)
    endif
endfunction

Basically I'm trying to hide a particular item from a particular player.

Thanks in advance! +rep is promised!
 

luorax

Invasion in Duskwood
Reaction score
67
I think it won't cause desyinc, because the handle exists for each player, but only "p" is able to see it. So noone's computer is going to think "what item? This game sucks", and will desync, they will think that "hmm, an item, but invisible. Okay, it seems to be okay"
 

Carnerox

The one and only.
Reaction score
84
I don't like it it exactly does it with items as well, but last night I was testing GetLocalPlayer() for hiding units for a certain player and it disconnected them all. It would probably not work with items either, I don't know though.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
why not to test it yourself?
Maybe he does not have someone with whom to test desyncs?

Maybe he figures more experienced mappers would already know if it does, or if it only does in certain circumstances and who could explain what and why?

I myself have not tested it, but it would probably desync in at least the following circumstances:
1. A unit is issued an order targeting the item
2. A unit in windwalk tries to walk in its vicinity (windwalked units cannot pass through items and therefore there may be local differences in pathing of the unit, leading to a desync)
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
I don't like it it exactly does it with items as well, but last night I was testing GetLocalPlayer() for hiding units for a certain player and it disconnected them all. It would probably not work with items either, I don't know though.

Yes, because hiding removes the unit from the playspace in a gameplay sense; it's a lot like removing a unit entirely. So, the game functions differently on different computers.

I would imagine hiding items would have a similar effect, since one players' game might be able to interact with the item but another players' game wouldn't.


Things that DON'T desync are generally aesthetic in their most basic nature; anything that affects how gameplay works will cause conflicts between computers.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Hi guys, thanks for all the replies :) to put the usage of this function in context: My game is based on collecting elemental orbs from killed enemies to increase your own power. If you kill an enemy and he drops an orb that you already have, it's supposed to hide that orb so you can't interact with it, or even see it. The idea behind that is so you can't 'drag' items, like in Island defense where you can drag titan items, by picking them up even though you instantly drop them, but at your current location. From what I've gathered, it looks like a bad idea to use this function though :/
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
in island defense the problem was that once a unit picked up an item it wasnt allowed to pick up that particular item was dropped instantly.
this can be abused because this way the players still can drag the item towards their position even if they cannot pick it up entirely.

to bypass this you could change the event.
instead of "item is picked up" use "unit is ordered to pick up an item" (usually a "smart" order since smart stands for everything right-click related).
when a unit is ordered to pick up an item, check if the unit is allowed to pick the item up. if not? order the unit to stop, or maybe just to walk to the items position, or whatever. this way the system cannot be abused.

by the way, in island defense their was another reason for this effect, items pathing could block the construction of buildings like walls or towers, the titan could have placed items which couldnt be picked up by builders at certain positions inside their bases to make them unable to rebuild walls and towers there.
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
When the item is picked up, its position is NOT hero's position BUT the position before it's picked up so this:
Trigger:
  • Drop Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set TempItem = (Item being manipulated)
      • Set TempPoint = (Position of TempItem)
      • Hero - Drop TempItem from (Triggering unit)
      • Item - Move TempItem to TempPoint
      • Custom script: call RemoveLocation( udg_TempPoint )

works just fine :) (you should add conditions, though)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      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