• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Dummy Units Count in Score?

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
Okay in my map I want the end-of-game to be accurate and reflect the amount of units owned/killed etc.

Well I am using like 200 dummy units for like every spell I have so the score counts them up as well and I end with crazy numbers in the end.

Is there any way to make them not count as units in the end of game score-screen calculations? Does the locust ability automatically do this? Many of my dummy units use the .mdl model instead... hmmm...

Edit: Just tested, nope, the locust ability does not stop the unit from being counted.
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
Okay in my map I want the end-of-game to be accurate and reflect the amount of units owned/killed etc.

Well I am using like 200 dummy units for like every spell I have so the score counts them up as well and I end with crazy numbers in the end.

Is there any way to make them not count as units in the end of game score-screen calculations? Does the locust ability automatically do this? Many of my dummy units use the .mdl model instead... hmmm...

Edit: Just tested, nope, the locust ability does not stop the unit from being counted.

You can make the dummy units a special type of unit and have the scoreboard only keep track of units that are not that special type. I would have suggested worker, but their idle work icons would appear in the bottom left :(
 
Level 12
Joined
May 9, 2009
Messages
735
Do the dummy units have to belong to players?
If not, might setting the owning player to Neutral Passive or Neutral Hostile work for you?

That's an idea, I will have to look into it if that's the only way but that will involve reworking who a lot of abilities target and can target... hmmm... It definitely won't work for my dummy units that use the resurrect ability.
 
Level 10
Joined
Feb 22, 2008
Messages
619
That's an idea, I will have to look into it if that's the only way but that will involve reworking who a lot of abilities target and can target... hmmm... It definitely won't work for my dummy units that use the resurrect ability.
What's the problem with the resurrect ability?
I can't imagine anything that a Neutral Hostile or Neutral Passive player couldn't do for a human player artificially with or without triggers.
 
Level 10
Joined
Feb 22, 2008
Messages
619
The neutral passive or hostile have the same attitude towards all the players, either passive to all or hostile to all. Either the resurrection will affect all players or non of them as there is no difference between friend or for for a neutral player.
The following action can make Neutral Hostile treat Player 1 as an ally, Neutral Passive treat Player 2 as an enemy, etc.
  • Actions
    • Player - Make Neutral Hostile treat Player 1 (Red) as an Ally with shared vision
 
Level 12
Joined
May 9, 2009
Messages
735
The following action can make Neutral Hostile treat Player 1 as an ally, Neutral Passive treat Player 2 as an enemy, etc.
  • Actions
    • Player - Make Neutral Hostile treat Player 1 (Red) as an Ally with shared vision

This looks very sketchy. There are maximum 9 players on the map. This poor neutral player will be switching his treatment towards everyone in unpredictable intervals when multiple dummy units enter the map it will be one huge mess.

And not to mention that some spell affect 'allied' units too... like the resurrection.
 
Level 10
Joined
Feb 22, 2008
Messages
619
This looks very sketchy. There are maximum 9 players on the map. This poor neutral player will be switching his treatment towards everyone in unpredictable intervals when multiple dummy units enter the map it will be one huge mess.

And not to mention that some spell affect 'allied' units too... like the resurrection.
What are the details of your system?
I'm sure it's possible to implement soundly and efficiently.

As an alternative solution; Create your own scoreboard to show when your game is "Over", optionally with some text somewhere that reads something like "The post-game scoreboard displays incorrect values due to dummy units" and ignore the post-game scoreboard altogether.
If you are a perfectionist I will sympathize with that not really being a solution at all.
 
Level 12
Joined
May 9, 2009
Messages
735
You're god damn right I am a perfectionist.

I have very many abilities that are casted through the use of dummy units. The resurrection spell is just one of them but if you take another one which is a blackfire barrage or a ice barrage based on the missile barrage spell... they can be casted quite frequently and if one casts and then the other casts while the missiles are still in the air (half a second?) the said missiles will not do the harm to the enemy as the alliances of the neutral player will change... one can even time this with his own manually casted spells to sort of block an spell.

I am concerned with these sorts of bugs because they can and will be exploited to ruin balance and gameplay, even if they may be unnoticeable in some scenarios. Making some units or spells obsolete because of a bug is what I want to avoid at all costs.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
You're god damn right I am a perfectionist.

If you're as big as a perfectionist as you make yourself out to be, then make your own engine (;

Do the dummy units have to belong to players?
If not, might setting the owning player to Neutral Passive or Neutral Hostile work for you?

Unfortunately, with this method (ignoring the fact the amount of bugs it would create), it still wouldn't display proper information in the post-game screenboard because the players would not have the proper amount of credited kills.


Like I told you before, the screenboard is hardcoded... the map is no longer running, so there is no trigger that can save you. Your BEST, and probably most useful, solution is to make your own post-game screenboard right when the game ends. An example you can look at would be DotA's post-game screenboard.
 
Level 10
Joined
Feb 22, 2008
Messages
619
I have very many abilities that are casted through the use of dummy units. The resurrection spell is just one of them but if you take another one which is a blackfire barrage or a ice barrage based on the missile barrage spell... they can be casted quite frequently and if one casts and then the other casts while the missiles are still in the air (half a second?) the said missiles will not do the harm to the enemy as the alliances of the neutral player will change... one can even time this with his own manually casted spells to sort of block an spell.
If the resurrection spell won't work naturally, make it a trigger spell with conditions.
If the damaging abilities won't work naturally, instead use triggers to manually change the health of units.
If you need help writing triggers, describe specifically what you need.
Unfortunately, with this method (ignoring the fact the amount of bugs it would create), it still wouldn't display proper information in the post-game screenboard because the players would not have the proper amount of credited kills.
I don't think changing the alliance settings of two non-players for the purpose of dummy units would be buggy unless you wrote the triggers poorly.
While it doesn't seem possible to remove credited kills, the value can still be limited and increased manually.
 
Level 12
Joined
May 9, 2009
Messages
735
That way I will have rework many many spells to attempt to replicate simple effects, create many new triggers urghhh... and still suffer from the credited kills issue. One problem solved just to create another one eh?

I am almost certain that I cannot be the first chap with this issue. I mean any altered melee map which has moderately complex spells is bound to run into this.

Maybe if I turn the dummy units into neutral passive before they expire? Or create them neutral and then give their ownership to the player? I will have to test these small slivers of hope out.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
That way I will have rework many many spells to attempt to replicate simple effects, create many new triggers urghhh... and still suffer from the credited kills issue. One problem solved just to create another one eh?

I am almost certain that I cannot be the first chap with this issue. I mean any altered melee map which has moderately complex spells is bound to run into this.

Maybe if I turn the dummy units into neutral passive before they expire? Or create them neutral and then give their ownership to the player? I will have to test these small slivers of hope out.

Maybe creating them as Neutral Passive and then changing their ownership immediately after? That SHOULDN'T credit them for creating the unit since its originally being made for Neutral Passive. It should also properly credit for kills because the ownership is theirs.
 
Level 12
Joined
May 9, 2009
Messages
735
Maybe creating them as Neutral Passive and then changing their ownership immediately after? That SHOULDN'T credit them for creating the unit since its originally being made for Neutral Passive. It should also properly credit for kills because the ownership is theirs.

I just tested it and unfortunately it doesn't work. I tested a bunch of magic towers (which create a dummy unit with every attack) massacring waves for a minute and a half. Both the kills and the units owned scores were almost the same regardless if the unit was created for neutral passive and given to the player or just created for the player.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
I just tested it and unfortunately it doesn't work. I tested a bunch of magic towers (which create a dummy unit with every attack) massacring waves for a minute and a half. Both the kills and the units owned scores were almost the same regardless if the unit was created for neutral passive and given to the player or just created for the player.

Oh thats unfortunate :( well I'm sorry then. Not sure what else I can suggest.
 
Level 10
Joined
Feb 22, 2008
Messages
619
It counts kills, right?
How about a system that keeps all units that would die at 1 health and kills them manually instead? Either with Unit - Kill or Unit - Damage Target, or even with Unit - Remove and then for non-dummies setting up some special effects and animations in the place of a real dying unit.
Setting up a system like this would have the byproduct of giving you a framework to really customize the death of every unit/unit type
 
Level 10
Joined
Feb 22, 2008
Messages
619
I am very uncertain of how this solves the issue of created dummy units being counted as units owned in the post-game scoreboard.
It wouldn't.
Why exactly can't you create the units for Neutral and do all of the different player stuff artificially with triggers and conditions based on player and unit groups? Is there a specific trigger that you can share?
 
Level 12
Joined
May 9, 2009
Messages
735
It wouldn't work. I already mentioned some spells requiring filters of 'friend','enemy','ally' and I am certain that changing around the neutral's allegiance this frequently (potentially up to 10 times in one second?) can lead to nasty consequences. Not to mention the fact that I have neutral hostile creeps on the map and use the neutral passive player as well for 'siege engine capturing system'.
 
Level 10
Joined
Feb 22, 2008
Messages
619
It wouldn't work. I already mentioned some spells requiring filters of 'friend','enemy','ally' and I am certain that changing around the neutral's allegiance this frequently (potentially up to 10 times in one second?) can lead to nasty consequences. Not to mention the fact that I have neutral hostile creeps on the map and use the neutral passive player as well for 'siege engine capturing system'.
If the resurrection spell won't work naturally, make it a trigger spell with conditions.
I mentioned the Neutral players specifically for the post-game score screen, not any kind of targeting system. If you make your spells into triggers you can ignore the frankly terrible default Warcraft targeting system altogether, using conditions instead.
 
Level 12
Joined
May 9, 2009
Messages
735
Well it's like I said before I have a spell which needs to damage and stun enemies only. Whose enemies? I need some sort of reference, a casting unit. If the this unit is neutral I will have to change up it's allegiances in the trigger as well so that the damage is applied to the correct units. This process happens very frequently as there are hundreds of units involved in massive battles many of which are casting all kinds of spells. Are you that convinced that changing the neutral player's allegiance up to 10 times in one second is good idea? This looks like whole can of worms to me.

How do you think a resurrection or a rocket barrage trigger to look like without referencing the allegiance of a particular unit?
 
Level 10
Joined
Feb 22, 2008
Messages
619
Are you that convinced that changing the neutral player's allegiance up to 10 times in one second is good idea? This looks like whole can of worms to me.
No.
I don't recommend using the Neutral players for a targeting system.



Put your interacting units in groups. A group for each player. Create a hashtable to keep track of the artificial alliances. 0 can represent whatever you want the default alliance state to be. When a player changes their alliance state with another player, you can change (x of y) in the hashtable, x being the number representing the acting player and y being the number representing the other, to any number to represent a different state of alliance.
(For example, 0 can be enemy, 1 ally, 2 ally with shared vision, etc)
Add units hit by spells to a temporary group. For each unit in this temporary group, use the hashtable to check if the casting unit is that unit's artificial ally or enemy.

With this system you could have a bunch of different units, all owned by Neutral, cast spells on each other as if they were owned by different players. You could even change the colours of the units and fiddle with some unit order triggers to artificially allow 9 players to hold different forms of alliance with each other all in units owned by only one player.
This system also allows you to make up new forms of alliance.


I brought up the Neutral player to theoretically fix the units being counted for the post-game scoreboard. Not as a targeting system.
 
Level 10
Joined
Feb 22, 2008
Messages
619
You may have found out yourself by now, but just for reference;
Hashtables are (as you probably understood) for storing and organizing large numbers of variables. You can think of a hashtable as a Cartesian plane, with the information stored at integer coordinates.

You can create one like this:
  • Actions
    • Hashtable - Create a hashtable
    • Set your_hashtable = (Last created hashtable)
You can store any and all kinds of variables in the same hashtable like this:
  • Actions
    • Hashtable - Save example_string as 0 of 0 in your_hashtable
    • Hashtable - Save Handle Of(Last created unit) as 0 of 1 in your_hashtable
    • Hashtable - Save ((Picked destructible) is alive) as 1 of 0 in your_hashtable
You can retrieve the variables stored within the hashtable with the Hashtable - Load... function:
  • Actions
    • Set new_variable = (Load 0 of 1 in your_hashtable)
 
Status
Not open for further replies.
Top