• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Destuctables for 1 player

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
I want to create a destructable of type Pathing Blocker that only 1 player can see the pathing blocker has custom model so it can be seen in game but i just want the one player to use it i assume you would use get local player but hiding/showing in this would cause desyncs wouldnt it? any help would be appreciated thanks.
 
Yes, I believe that if you were to hide it, it would locally change the pathing, so pathfinding me be screwed up and cause a desync when units run in that area.

There may be a chance of getting it to work, but I need to know whether you want only one player to see the destructible or do you only want one player to be affected by the destructible?

If it is the first one, then I believe you can create a duplicate destructible with the same pathing texture as the other destructible but no model. Then you can locally set the id before you create the destructible.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Purge, you're the one that made a tutorial about GetLocalPlayer and how to avoid its desync, right ?

Then I suppose this method will not desync the game, right ?
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ut = No unit-type
      • Custom script: if GetLocalPlayer() == Player(0) then
      • Set ut = PathingBlocker
      • Custom script: endif
      • Unit - Create 1 PathingBlocker for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
It creates handle for all Players in the map, only Player 1 can actually see the unit because it is set to a correct path, other Players would have a No unit-type path.
Remember, Player(0) is Player 1 in GUI.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Destructable - Show/Hide does not affect pathing nor visibility, as you can read from the grey hint in GUI.

You could also do the pathing via trigger or with another invisible entity.

@defskull: If the unit type is null, it won't create a unit. Also if you want this to work, the units should have same gameplay values.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Lol forgot about GetLocalPlayer, it only affect that Player only, in this case, only Player 1 will "feel" the collision of units there, while other Player just treat as if there is nothing created on that location.

So in this case, just abandon GetLocalPlayer as a solution to this problem, it would never work.

How about giving the unit permanent invisibility ?

This way, the unit only visible to the Player, but still retain its collision size to other unit that passes through that location.

To increase/decrease the unit's collision size (the pathing block for that area), simply adjust the Pathing - Collision Size in Object Editor.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
defskull. Please do not hijack other people's threads. You are changing the subject over to helping yourself instead of Blazing_Legion. There is no reason for this. Send Purge a direct message or create your own thread.

376031-my-brain-is-full-of-fk


Whaatt ???
 
Destructable - Show/Hide does not affect pathing nor visibility, as you can read from the grey hint in GUI.

Perfect! I didn't know that. Then that means blazing_legion can use it locally without any desyncs.

@defskull: He wanted to hide a destructable, not a unit. ;) Unless I misunderstood you. But yeah you can use permanent invisibility for something like that if you want.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Lol when I saw the word "custom model", I thought it was a unit, yeah he wanted to create "Destructible" that is only visible to certain Player.

Here's a test map, try it.

Note that the Destructible only shown for Player 2.

Don't worry, it won't make the game desync because a simple action of Show/Hide does not create any handle, thus it is perfectly safe to be used.

Remember, if you want to adjust which Player is able to see the Destructible, simply change the Player(X) value.

In Custom script (JASS), Player (0) is Player 1 Red
While Player(1) is Player 2 Blue, and so on.
 

Attachments

  • test11.w3x
    12.3 KB · Views: 31
Level 26
Joined
Aug 18, 2009
Messages
4,097
You could even use a unit to add a pathing or maybe make it act as a destructable.

Don't worry, it won't make the game desync because a simple action of Show/Hide does not create any handle, thus it is perfectly safe to be used.

That is not the criteria. Even without creating objects, you cannot just render a destructable invulnerable on a single client since it will execute and broadcast different data when you try to interact with it in a manner that is not possible/altered because of the invulnerability.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
OR, if you're afraid of desync, just create Destructibles at that location, and Hide it (hide for all Players)

And then, at the same location, create a unit (a dummy unit) there to indicate there is a pathing blocker exist at that location.

As I said, you can add Permanent Invisibility to that dummy unit to only appear for the player owning the dummy unit.

As for pathing block, it is not done by the dummy, but by the hidden destructible.

So the method is;
1. Create Destructible
2. Hide it
3. Create dummy invisible unit for certain Player that is able to see it

Make sure the Permanent Invisibility is added via Object Editor.
 
Status
Not open for further replies.
Top