Machine Gun Hlp

Mmage

New Member
Reaction score
7
Hi,as you probobly know im working on a marine map. and in this map i have a building (based off of orc burrow) that a hero may go into and shoot stuff.

heres my problem(s).

1: i want it so that, when damage is taken, that amount of damage is fowarded to the hero inside of the nest, keeping the machine gun's hp at max.

2: How do i make it so that the machine gun nest dosent attack when no1 is in it without using any extra abilitys on the hero.

3: How would i let any allyed hero use the machine gun nest wihtout giving Full unit control to all of the players units?

more questions added later. Thx for your time.
 
I

IKilledKEnny

Guest
What do you mean by nest? The building?

1. Didn't understand.

2. If you based the building on Orc Burrow it would be automaticlly act like that.

3. Impossible with GUI you might be able in JASS unit local unit.
 
L

lordpredator

Guest
why don´t you make the machine gun invulnerable and control it from the outside, "rescue unit"... it solves all of the 3 problems, when the contorler unit is killed or go away from the gun, change the owner to "neutral passive" so the tower will not attack. You can make it to look as if the unit is inside the gun... making a gun with no collition size and big enough to cover the hero.
 

Mmage

New Member
Reaction score
7
OK in 1 i mean

If the machine gun takes damage, how would i do it to make the hero or unit inside the gun take the damage instead?
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
First of all, use Ryoko's vehicle loader thing, (search the forums)


this is freehand, so use as a guideline
make a unit array variable known as MG_User or something like that, and modify ryoko's code to set the entering unit equal to that variable with the player number of the owner as the array index.
And create a variable that can hold a percentage (not sure which type to use, maybe real, and make it an array)
Code:
Events
   a unit is attacked
Conditions
   type of (attacked unit) is equal to (machine gun)
Actions
   set (Percent_Variable)[(player number of (owner of (attacked unit)))] = (100 - (percentage of health of MG_User[(player number of (owner of (attacked unit)))]))
   set (percentage of health of (MG_User[(player number of (owner of (attacked unit)))])) = ((percentage of health of (MG_User[(player number of (owner of (attacked unit)))])) - (Percent_Variable))
   set (percentage of health of (attacked unit)) = 100

or.... something like that.....
[/CODE]
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top