• 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.

[Solved] Question to DestroyForce

Level 8
Joined
Jul 22, 2015
Messages
141
I already read this Thing That Leaks. But still confused me, When i testing my map with two people (with sandboxie emulator), I supposed to make player can't see damage text when area fogged, the Player 1 can't see floating text when they are on fogged as i wanted, but the problem Player 2 can see the floating text even unit are fogged. I use this trigger is what supposed to destroy player group to prevent leak. What was i wrong?
  • Set DamagedForce = (All players matching ((DamageEventTarget is fogged to (Matching player)) Equal to True))
  • Floating Text - Hide (Last created floating text) for DamagedForce
  • Custom script: call DestroyForce(udg_DamagedForce)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,929
This has nothing to do with memory leaks, you're doing everything correctly.

The problem:
the Player 1 can't see floating text when they are on fogged as i wanted, the problem Player 2 can see the floating text even unit are fogged
It's tough to say without seeing the full trigger but If I had to guess:

1) That (is fogged to) function is bugged or doesn't work as expected.
2) You're forgetting about Shared Vision, Visibility Modifiers, Dummy units with vision, etc. Something makes the unit unfogged for P2.

Try using the (is visible to) function instead.
  • Set DamagedForce = (All players matching ((DamageEventTarget is visible to (Matching player)) Equal to False))
 
Last edited:
Level 13
Joined
Feb 5, 2018
Messages
568
The easiest way to do this is to create the floating text and hide it and then show it to the designed players you want.

  • Set VariableSet XDamagePlayerNumber = (Player number of (Triggering player))
  • Floating Text - Hide (Last created floating text) for (All players)
  • Floating Text - Show (Last created floating text) for (Player group((Player(XDamagePlayerNumber))))
On a side not you probably want some limit when the damage is shown. Since applied buffs still show as a 0 damage number on a unit.
 
Level 8
Joined
Jul 22, 2015
Messages
141
This has nothing to do with memory leaks, you're doing everything correctly.

The problem:

It's tough to say without seeing the full trigger but If I had to guess:

1) That (is fogged to) function is bugged or doesn't work as expected.
2) You're forgetting about Shared Vision, Visibility Modifiers, Dummy units with vision, etc. Something makes the unit unfogged for P2.

Try using the (is visible to) function instead.
  • Set DamagedForce = (All players matching ((DamageEventTarget is visible to (Matching player)) Equal to False))
1. Hmmm perhaps.. maybe i try one of you suggested
2. No, i already all set on when all player can't see each other even allied player, until they meet each other of line of sight of their units.

also Is it safe if i use DestroyForce trigger?
 
Level 8
Joined
Jul 22, 2015
Messages
141
The easiest way to do this is to create the floating text and hide it and then show it to the designed players you want.

  • Set VariableSet XDamagePlayerNumber = (Player number of (Triggering player))
  • Floating Text - Hide (Last created floating text) for (All players)
  • Floating Text - Show (Last created floating text) for (Player group((Player(XDamagePlayerNumber))))
On a side not you probably want some limit when the damage is shown. Since applied buffs still show as a 0 damage number on a unit.
maybe i will try this one too. thanks!
also thanks for @Uncle for suggestion
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,929
1. Hmmm perhaps.. maybe i try one of you suggested
It's a very easy change, there's no reason not to try it.
also Is it safe if i use DestroyForce trigger?
Yes, I said you're using it correctly. That's how you get rid of a Player Group (Force) memory leak. Here's some pictures to better explain it:


This Action creates a Player Group object:
  • Set DamagedForce = (All players matching ((DamageEventTarget is fogged to (Matching player)) Equal to True))
You can think of this object like a bag that you can only put Players inside of:

ex4.png
ex3.png
ex2.png

You use this bag to make it easier and more convenient to interact with all of the Players inside of it.

Here's an example of using your bag:
  • Floating Text - Hide (Last created floating text) for DamagedForce
But when you're finished using the bag you need to throw it away:
  • Custom script: call DestroyForce(udg_DamagedForce)
ex5.png

Destroying or Removing the bag will get rid of the memory leak. This is a good thing!

It tells the game that it can forget about the bag, removing it from your computer's memory.
You can think of it like emptying your recycle bin when you want to get rid of deleted files.
1748885720240.png


Note: A Player Group is also called a Force, they mean the same thing here.
 
Last edited:
Top