Visibility Issue with multiple player

Yoshii

New Member
Reaction score
74
Im having an issue with Enabling/destroy visiblity shown via region.Heres my code.It work for solo but during a multi player game I tested using red and blue because I figured it would bug and sure enough it does.

The bug arise when player 1 enter cell 1 or cell 2 and player 2 leave region 1 or 2 thus killing the visibility that enabled and not destroying the enabler that blue enable.I cant think of a way to fix it as the destroy/disable action does not let me chose which enabler to kill.I know there is a way I have done it before but its been a long time

note: the region 1 and 2 are only shown you cannot enter the cell so any trigger would have to take that into account.I attached a picture from Map editor so you can better see

thanks for help in advance.



Trigger:
  • Cell 1 Enter
    • Events
      • Unit - A unit enters Cell 1 <gen>
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across Region 1 <gen>


Trigger:
  • Cell 1 leave
    • Events
      • Unit - A unit leaves Cell 1 <gen>
    • Conditions
    • Actions
      • Visibility - Destroy (Last created visibility modifier)

Trigger:
  • Cell 2 Enter
    • Events
      • Unit - A unit enters Cell 2 <gen>
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across Region 2 <gen>

Trigger:
  • Cell 2 Leave
    • Events
      • Unit - A unit leaves Cell 2 <gen>
    • Conditions
    • Actions
      • Visibility - Destroy (Last created visibility modifier)



http://img39.imageshack.us/i/bugndr.jpg/
 

Varine

And as the moon rises, we shall prepare for war
Reaction score
805
It doesn't take into account what player has the last visibility modifier. So when Blue's unit enters the region after a red unit, when the red unit leaves it's going to destroy the Blue's modifier because it was the last one created.
 

Yoshii

New Member
Reaction score
74
It doesn't take into account what player has the last visibility modifier. So when Blue's unit enters the region after a red unit, when the red unit leaves it's going to destroy the Blue's modifier because it was the last one created.
Ya I'm aware of that; thats why I'm asking if anyone have an idea of what to do to fix this:)
 

waaaks!

Zinctified
Reaction score
255
You need to store them into a variable because it really has no sense when calling last created visiblity modifier
Trigger:
  • Cell 1 Enter
    • Events
      • Unit - A unit enters Cell 1 <gen>
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across Region 1 <gen>
      • Set myVis = (Last created visibility modifier)


Trigger:
  • Cell 1 leave
    • Events
      • Unit - A unit leaves Cell 1 <gen>
    • Conditions
    • Actions
      • Visibility - Destroy (myVis)

Trigger:
  • Cell 2 Enter
    • Events
      • Unit - A unit enters Cell 2 <gen>
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across Region 2 <gen>
      • Set myVis2 = (Last created visibility modifier)

Trigger:
  • Cell 2 Leave
    • Events
      • Unit - A unit leaves Cell 2 <gen>
    • Conditions
    • Actions
      • Visibility - Destroy (myVis2)
 

Yoshii

New Member
Reaction score
74
thanks ROTG i thought about doing that but had thought you can only delete last created so stored woulnt work out, I had skipped over the variable and only saw last created that you could delete.

However the trigger dont work when I test but Im figuring its because since im testing and I own both red and blue with shared vision and everything.

Like for example blue enter region 1 and red enter region aswell, if red and blue leave region 1, I still get the vision from it because the game created 2 vision enabler( since i play red and blue the game create 1 for each, stored and deleted one, and the 2nd player who left "destroyed" the same enabler that was just destroyed(cuz its stored) resulting in me still gaining the vision.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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