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

Applying upgrades instantly

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
Heya people, i've got a cute little map called
StarCraft Zone Control.
The marines used in the map can be upgraded, both weapons and armor.
How can i make the upgrades apply instantly when the upgrade is done, current upgrades are only applied to the newly spawned units.

(the units are created, not trained)
Thanks in advance,
Angelusz
 
Level 9
Joined
Sep 8, 2004
Messages
633
Well, i made custom upgrades, how:
Took normal damage upgrade, copied it, and started editing it to fit it to my map.

The upgrades are gun upgrades which increase damage of the marines by 1 per upgrade, max lvl = 50.

I did something else for armor, every upgrade the marines get +1 armor, and one level of enforced armor.
(enforced armor = hardened skin, blocking damage)
enforced armor lvl blocks 1 damage, lvl 2 2 damage and so on, that + 1 armor lvl.
The minimum damage = 0, but, there's a % chance that the damage will be blocked, so it's not 100% reliable.
(the higher you upgrade armor, the higher the % gets.)

The marines are spawned by triggers, as simply as possible:
Code:
Event: a bunker is made at location X
Then: 
Set location X owner = Owner of triggering unit
Trigger - turn on spawn units location X

Event: Every 4 seconds of the game
Then: Unit - create 1 marine for (Location X owner)

Event: Bunker dies
Then: Turn off spawn ...

That is not the exact code, but it's something similar to that (a bit more complicated.)[/code]
 
Status
Not open for further replies.
Top