Will this GetLocalPlayer function cause desynch?

LurkerAspect

Now officially a Super Lurker
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
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.
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
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=~
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
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
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 ! ---
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.
  • C Cherry.Grove:
    My boyfriend is super into Bethesda modding so I'm probably going to join him in that for a bit, then move on to making mobile/browser games.
  • C Cherry.Grove:
    I mostly just want to look at my old projects because I know I posted uploads on here somewhere.
  • C Cherry.Grove:
    My one game was basically Among Us but you sabotaged an entire medieval city simulated drastically inefficiently with dynamic NPCs :S
  • C Cherry.Grove:
    of course I never finished it x D
  • jonas jonas:
    xD
  • jonas jonas:
    I think you can still run the original game, just there's a chance your map won't work with the newer patches
  • jonas jonas:
    what development framework have you been looking at for mobile development?
  • jonas jonas:
    I'm currently creating (as a hobby) a space invaders like game for mobile using Xamarin, after starting a few larger projects that I also may not have finished :rolleyes::p
  • The Helper The Helper:
    Awesome! you should look at the Atari VCS platform it does not have a huge user base but the one it has is super active at around 11k and they have no games in there store
  • The Helper The Helper:
    basically it is linux
  • The Helper The Helper:
    OMG it is BanLord as Blackveiled on the forum
  • The Helper The Helper:
    what is up buddy
  • jonas jonas:
    thanks for the tip, that sounds cool. Never heard about the VCS before but seems like it should be a good match
  • tom_mai78101 tom_mai78101:
    The winter vacation left a toll on me. I missed staying up late and sleeping in late.
  • C Cherry.Grove:
    i haven't looked into it yet
  • C Cherry.Grove:
    If I could use something Python compatible it would save me some learning
  • C Cherry.Grove:
    But Unity might be easiest
  • C Cherry.Grove:
    looking at old posts here makes me happy. Makes me be all like "wow I was pretty smart in 2009"
  • C Cherry.Grove:
    mostly failing at life through adulthood really demotivated me for a while
  • C Cherry.Grove:
    ....what I don't get is why the fuck they would force us to permanently convert to a version of the game everyone fucking hated : \
  • C Cherry.Grove:
    Raid Shadow Legends texture pack smh
  • jonas jonas:
    Most people fail at life throughout their adulthood. Sometimes we get to learn from it. Usually it just feels like crap.
    +1
  • The Helper The Helper:
    What does not kill you makes you stronger is what they say
  • C Cherry.Grove:
    for real! :cool:

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top