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

Spawn Units with upgrades on buildings

Status
Not open for further replies.
Level 3
Joined
Apr 2, 2013
Messages
25
He Everybody,


my last thread was a kinda vague, so i made a new more specific one..

My idea was to let units spawn by timer by adding an upgrade to a building which the player can click for a mineral cost.

For exemple:

You got a barrack. The barrack has got an upgrade button which cost 100 minerals and you only can do once, which will spawn a marine every 30 sec..

What i got now is this:


I made a Global Var:

Timer: New Timer
x = timer Marine P1


Trigger (Name: Acting timer after upgrade):

Event - UI - player 1 presses train marine.
Local var -
Conditions -
Actions - Start 'var = timer marine P1' as a repeating timer that will expire in 30.0 sec of game time



Next trigger (Name: Spawn):

Event: Timer - When timer marine P1 expires
Local var -
Conditions -
Actions - Create 1 Marine for Player 1 at (location of my barrack) using default facing.


What happens now, if I test document. When i train a marine, there will be a spawn of a marine every 30 secs.. Yes i am happy that works.. But..

I want to do this with an upgrade which will do nothing, cuz now i train a marine what i dont want.. The triggers will spawn the marine and i dont want a marine when u press train marine.. I know its logical that will happen, cuz its the ability i chose.. I only made this to check if my triggers were working, and they work..

But now for the question i have. I tried to make en upgrade button for the barracks which do nothing, because my triggers will do the spawnings, but unfortunate it doesnt work.. I tried with data to make a new upgrade, but cant figure it out how i can make an upgrade which will do nothing.. The only thing i want the upgrade will do is let the button be actually an option at me barrack, plus it costs a specific amount of minerals and take sum time when its completed... For some reason when i make an upgrade button, which doensnt have any ability or effect attached to it.. The button isnt there on me barracks.. Even when i change the ability buttons from the barrack to my own upgrade..

So can someone help me out how to make an new upgrade button which will work but do not have an ability nor effect and can be clicked once!!!, but can be triggered by me triggers when researched in the game..


I would be gratefull



Kind regards,

me
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Create a instant cast no target dummy ability and use that to fire the trigger. The dummy ability has no effect and is only there for a press-able button.

If you have problems hiding it after it has been used once, then consider making it give the unit a charge (any kind of charge unique to that unit). You can then use a requirement on the ability to hide the command card icon after it has been used once by hiding if the charge is present. Do not worry about cost, StarCraft II abilities can cost resources and will display in the command card tooltips.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
For single level abilities they are part of the button (button catalog is used to create and edit buttons) used to represent the ability in the command card. For multi-level abilities the first level is part of the button used to represent the ability in the command card while other levels are specified in the appropriate field of the multi-level ability itself.
 
Level 3
Joined
Apr 2, 2013
Messages
25
Hmmm.. I finally have a upgrade with a cost, with progross time.. The only thing i still cant do is to hide after used.. I cant figure what you mean with the charge thing and such.. Someone got an easy answer to this?? ^^
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
You could prevent it being recast by using charges. Either deplete the only single charge or give the only allowed charge and it will not be able to be recast after that. This does not hide the button but is easiest to do.

Hiding the button is more difficult. Charges would be perfect except there are no requirement nodes to get the charge quantity (only unit charge quantity such as interceptors). This means you are forced to use a behaviour (buff is simplest) to do the button hiding. When the skill is cast, you use an add behaviour effect to add the behaviour to the casting unit. The behaviour is an invisible dummy that has an infinite duration (permanent). Your requirement for the ability then can test the presence of this ability for when to show the button (show when behaviour is not present on the unit).
 
Status
Not open for further replies.
Top