• 🏆 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!

Units keep Highest Upgrade when changing Ownership

Status
Not open for further replies.
Level 1
Joined
Jan 26, 2021
Messages
6
Hello!

I am making a 4v4 Tug of War style map and I got a little problem.

So on one side 4 players can make their own units with their own upgrades. The units made will change ownership to a Computer and will attack-move to the enemy base. Works the same way with the opposite team.

The problem I am encountering is when an upgrade for x unit is acquired, it is also sent to the units that are now owned by the Computer (this is intended) BUT instead of having every player have their own unit upgrades, how this works is it will take the player with the highest level upgrade and apply that to all of that Computer's units (who includes all 4 players' made units).

How I would like this to work is that only the Red units will get Red's upgrades, only Blue's units get Blue's upgrades, only Teal's units get Teal's upgrades and so on...


I know one way of fixing this would be to have 1 Computer for every player but that is a bit too much. It would have to be a huge lobby with 16 players (8 Players and 8 Computers). Does anyone know of a fix that's easier than this?

Thank you!


EDIT: Just thought of something, would it be possible to keep ownership of units but lose their control so they would only attack-move to the enemy base? That would definitely fix the upgrades issue, but I'm open to all ideas. Thanks again!
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
EDIT: Just thought of something, would it be possible to keep ownership of units but lose their control so they would only attack-move to the enemy base? That would definitely fix the upgrades issue, but I'm open to all ideas. Thanks again!

Yes this is possible. If you want to see health bars of the units, add a ward classification in the object editor to the units, this way the unit ability screen is black and you can't order attack move, hold position, stop and so on. You can only use mouse order movement and to disable that we need a trigger.

  • Cancel orders
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Not equal to (Order(yourorder))
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Attack-Move To (Center of (Playable map area))
      • Trigger - Turn on (This trigger)
 
Level 12
Joined
Nov 3, 2013
Messages
989
If you still end up using a computer player to control the units, then don't give the upgrades to the computer player, just change one thing on the upgrades themselves.
Skärmklipp.PNG


When this field on an upgrade is set to "true", units will keep the upgrade even if they change player ownership.

This way units will only have the upgrades the player who made them originally had and it's completely unnecessary for the computer player to have any upgrade.
 
Level 1
Joined
Jan 26, 2021
Messages
6
If you still end up using a computer player to control the units, then don't give the upgrades to the computer player, just change one thing on the upgrades themselves.
View attachment 372814

When this field on an upgrade is set to "true", units will keep the upgrade even if they change player ownership.

This way units will only have the upgrades the player who made them originally had and it's completely unnecessary for the computer player to have any upgrade.
Hello Death Adder! That's exactly how I've done it. The Computer does NOT have access to any upgrading. Still, the problem is that once the units are trained they are given the highest level of x upgrade from all 4 players in that Team. That's why under the Upgrades themselves the "Stats - Transfer with Unit Ownership - True" doesn't work, because there are a total of 4 players who are getting their units transfered to that 1 Computer.




Yes this is possible. If you want to see health bars of the units, add a ward classification in the object editor to the units, this way the unit ability screen is black and you can't order attack move, hold position, stop and so on. You can only use mouse order movement and to disable that we need a trigger.

  • Cancel orders
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Not equal to (Order(yourorder))
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Attack-Move To (Center of (Playable map area))
      • Trigger - Turn on (This trigger)
Hello DoomBlade! I will try this and see if it works properly. Honestly I would've prefered to just keep the Computer if there was a way to do it with unit ownership transfer, but I'll give it a try.
 
Level 1
Joined
Jan 26, 2021
Messages
6
Yes this is possible. If you want to see health bars of the units, add a ward classification in the object editor to the units, this way the unit ability screen is black and you can't order attack move, hold position, stop and so on. You can only use mouse order movement and to disable that we need a trigger.

  • Cancel orders
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Not equal to (Order(yourorder))
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Attack-Move To (Center of (Playable map area))
      • Trigger - Turn on (This trigger)
Can Ward Classified units be healed though? I have a Paladin in my map. That would break it. (I guess I could guess Holy Light the ability to heal Wards)

Also, DoomBlade, how did you come up with your condition? I can make the (Issued order) Not equal to (Order(but I can't find the "yourorder" here)) I am guessing it's a string I need to enter manually, yes?
In fact, I don't understand what the purpose of this Condition is at all.





EDIT: So I've done it, and that's how it looks:
WC3Trigger1.PNG WC3Trigger2.PNG

Problem with that is everytime a unit is stunned by a spell (I tested it with Impale) the unit does not get stunned and will continue moving/attacking, even when it's midair from the Impale's impact. Looks silly as hell and doesn't work as intended. I really prefer if there's an alternative with the Computer owning all trained units.... Maybe you got a fix for stunning spells?
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
You need to replace "yourorder" with the orders you don't want your units to cancel. Example: order not equal to order(shockwave).

You need to list the orders you don't want to be interupted, I guess stun from impale and stormbolt etc is stunned(pause) or just pause.

To get all the order list, generally I think the orders are pretty much equal to the original spell names.

1) You can just make one trigger called X without any events and then add all the orders you want to use with a trigger: Order unit (no unit) to cast shockwave.

2) In the trigger editor click Edit and choose Convert to custom text, then you can see all the orders in a way that they need to be put into the condition block.

And as a side note you only need this trigger once. Don't make multiple triggers for different teams. Instead use the if/then/else conditions for the different teams in the same trigger.

EDIT: I also think adding a computer for each player makes no different since you would still only have 8 player slots. Having a big lobby really does not make a different imo. The player data for computers that act only as spawn bots probably won't make any difference performance wise.
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
Still, the problem is that once the units are trained they are given the highest level of x upgrade from all 4 players in that Team.
Ok so I made a map to test this, and you were pretty much right. It seems that the player actually gets the upgrades, so even when I gave units with 0 upgrades before also giving units with upgrades, those previously unupgraded units received the upgrades as well.


So your best option, if you don't have an extra computer player slot for each player, is the castlefight method like DoomBlade explained.


If this was SC2 then it would be very easy to make orders uninterruptible, but I don't think this is possible in WC3.

But maybe they did make it possible with the new natives, I'm looking at them atm and there's 2 versions of every "issue order" native, maybe the non "immediate" versions add the order to the queue as if you were holding down shift? Though these probably don't affect the player commands.
Skärmklipp.PNG



Other than that, I believe you can make units unselectable with triggers, as if they were locutested, without all the negative sideeffects from the locust ability. Though ideally you'd still be able to select them but I just don't think it's possible to have players be able to select units without being able to give orders (even in castle fight if the player spams the units will stutter).
Skärmklipp.PNG
 
Level 1
Joined
Jan 26, 2021
Messages
6
You need to replace "yourorder" with the orders you don't want your units to cancel. Example: order not equal to order(shockwave).

You need to list the orders you don't want to be interupted, I guess stun from impale and stormbolt etc is stunned(pause) or just pause.

To get all the order list, generally I think the orders are pretty much equal to the original spell names.

1) You can just make one trigger called X without any events and then add all the orders you want to use with a trigger: Order unit (no unit) to cast shockwave.

2) In the trigger editor click Edit and choose Convert to custom text, then you can see all the orders in a way that they need to be put into the condition block.

And as a side note you only need this trigger once. Don't make multiple triggers for different teams. Instead use the if/then/else conditions for the different teams in the same trigger.

EDIT: I also think adding a computer for each player makes no different since you would still only have 8 player slots. Having a big lobby really does not make a different imo. The player data for computers that act only as spawn bots probably won't make any difference performance wise.
I tried it, but never got the order for like impale or stun to work, so I redesigned my map a little bit and I am now embracing the "all units get the upgrades and not just the player's made units". So I reverted back to Team 1's units are trained and ownership is immediately changed to Team 1 Computer, and then they attack-move to Team 2 Base.

How I want to do it so players don't have to buy the same upgrades multiple times (because how it worked, you know it, it would take the highest upgrade between players and apply it to the Computer's units) is like this: I made a "Team Blacksmith" and is owned my the Team's Computer. I gave that building "invulnerable (Neutral), Shop Sharing, Allied Bldg., and Shop Purchase Item".

Now I know that works for items because I already have an building that has that ability for Heroes, but it seems it doesn't work for Upgrades, because, well, the building is still owned and controlled by the Team's Computer... Do you guys know how I could change it so everyone in said Team can control that single building so everyone can research Team units Upgrades?


Thought doing it this way would be easy... If I still don't have a solution for that one I might just have to create a Computer player for every single player in the game like I mentioned earlier.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Now I know that works for items because I already have an building that has that ability for Heroes, but it seems it doesn't work for Upgrades, because, well, the building is still owned and controlled by the Team's Computer... Do you guys know how I could change it so everyone in said Team can control that single building so everyone can research Team units Upgrades?
You could fake it by making it so when a player selects the building they instead select another dummy building (using trigger) and when they click on research upgrade you order the computer owned building to research the upgrade.
 
Level 1
Joined
Jan 26, 2021
Messages
6
You could fake it by making it so when a player selects the building they instead select another dummy building (using trigger) and when they click on research upgrade you order the computer owned building to research the upgrade.
This is a good idea, but after playing around trying to make it work I just think I don't have the triggering skills to do that...
 
Level 12
Joined
Nov 3, 2013
Messages
989
This is a good idea, but after playing around trying to make it work I just think I don't have the triggering skills to do that...
I have an old map where I used dummy shops for something else


you'd still need to do some triggering for the upgrades though


well, thinking about it the selection thing might be the easy part so let me know if you still need help


p.s. the actual map probably won't work if you open it with a post 1.30+ version of wc3 since Engineering Upgrade doesn't work as it's used to, so using it for custom hero abilities doesn't work anymore (but it's also not needed)
 

Attachments

  • Custom Hero Abilities test map.w3x
    43.5 KB · Views: 17
Level 12
Joined
Feb 5, 2018
Messages
521
There is a simpler thing you could do then.

1) Add a shared shop for the computer which sells items that does nothing. Create a tome item, change its icon to an upgrade icon and change the name to "Increase attack" or whatever. OR you could actually use any item, then it just needs to removed from the unit when he buys it.

2) Remove the abilites from the item so it has no actual effect.

3) Make sure your units have unit inventory researched and add that to the units.

  • Techtree
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Scroll of Regeneration
        • Then - Actions
          • Set VariableSet TempItem = (Item being manipulated)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Team1Dmg Less than 5
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
                  • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                  • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
            • Then - Actions
              • Item - Remove TempItem
              • Set VariableSet Team1Dmg = (Team1Dmg + 1)
              • Player - Set the current research level of Iron Forged Swords to Team1Dmg for Player 5 (Yellow)
              • Game - Display to (All players) the text: (String(Team1Dmg))
            • Else - Actions
        • Else - Actions
 
Level 12
Joined
Nov 3, 2013
Messages
989
1) Add a shared shop for the computer which sells items that does nothing. Create a tome item, change its icon to an upgrade icon and change the name to "Increase attack" or whatever. OR you could actually use any item, then it just needs to removed from the unit when he buys it.

2) Remove the abilites from the item so it has no actual effect.

3) Make sure your units have unit inventory researched and add that to the units.
I would suggest selling units instead of items, but this is a good idea. It's the same thing I did in the map I posted btw


Just keep in mind that if you actually want there to be a research time and not just a purchase, then you'd still have to do some more workarounds.
 
Level 1
Joined
Jan 26, 2021
Messages
6
There is a simpler thing you could do then.

1) Add a shared shop for the computer which sells items that does nothing. Create a tome item, change its icon to an upgrade icon and change the name to "Increase attack" or whatever. OR you could actually use any item, then it just needs to removed from the unit when he buys it.

2) Remove the abilites from the item so it has no actual effect.

3) Make sure your units have unit inventory researched and add that to the units.

  • Techtree
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Scroll of Regeneration
        • Then - Actions
          • Set VariableSet TempItem = (Item being manipulated)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Team1Dmg Less than 5
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
                  • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                  • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
            • Then - Actions
              • Item - Remove TempItem
              • Set VariableSet Team1Dmg = (Team1Dmg + 1)
              • Player - Set the current research level of Iron Forged Swords to Team1Dmg for Player 5 (Yellow)
              • Game - Display to (All players) the text: (String(Team1Dmg))
            • Else - Actions
        • Else - Actions
I like that idea a lot, but again, I'm bad with variables. I've always avoided them actually. I might try it though.


I would suggest selling units instead of items, but this is a good idea. It's the same thing I did in the map I posted btw


Just keep in mind that if you actually want there to be a research time and not just a purchase, then you'd still have to do some more workarounds.
It was really hard to understand anything from your map lol. No offense, I'm just a noob at the World Editor. BUT, I saw you used chat messages to trigger unit buying. So I might make a Blacksmith that serves no purpose other than to tell players what to type to buy upgrades (it will be a shop that sells fake items just for that purpose).
Let's say a player from Team 1 says -upgrade1 then the Melee Swords damage upgrade will research (and maybe add a "Wait 30s of game time") or -upgrade2 then it's Melee Armors defense upgrade, etc...


Anyways, I think both make sense but I don't know which one would be easiest for a noob like me. I'll play around later this week. Maybe I'll just revert to the 1 Computer/player idea, which I already have a version of.
Thank you both for replying so quickly everytime.
 
Status
Not open for further replies.
Top