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!
 
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"
 
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.
 
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)
 
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.
 
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 :/
 
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.
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top