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

Allowing a unit loaded in a vehicle to attack.

Status
Not open for further replies.
Level 4
Joined
Apr 27, 2009
Messages
94
The question is fairly simple, yet I haven't found a way to do it.
What I am trying to achieve is to create a vehicle which can function as a bunker for infantry where units can shoot from.
As you know simply loading a unit into a vehicle doesnt allow it to attack.

Any suggestions appreciated.
 
Level 4
Joined
Nov 7, 2009
Messages
83
I think this might help you, just see what I modified on units and abilities and I think it will give you some clue.
 

Attachments

  • Help.w3x
    16.1 KB · Views: 37
Level 4
Joined
Apr 27, 2009
Messages
94
I think this might help you, just see what I modified on units and abilities and I think it will give you some clue.

Thanks, I checked it out.
However, with this strategy, you just shoot an ordinary burrow arrow at the target.
What I basically want, is that all loaded units, continue to attack as they normally would.
Does anyone know if this is even possible with the WC3 engine?
 
Level 18
Joined
Mar 7, 2005
Messages
824
this isn't possible as far as I know..

But you can try to create some dummy units for each loaded unit. You load a bowman and you can see that one unit is loaded, via triggers create a dummy unit for your archer with the same stats, but a) it's very tiny, so you can't see it, or b) use a dummy model, which means no model.. that dummy unit will attack other units, while your bowman is loaded..

Another solution might be Multishot, create some multishot ability and hide it with a spellbook, the only problem here is, that you can't control the damage of various units.
 
Level 4
Joined
Apr 27, 2009
Messages
94
this isn't possible as far as I know..

But you can try to create some dummy units for each loaded unit. You load a bowman and you can see that one unit is loaded, via triggers create a dummy unit for your archer with the same stats, but a) it's very tiny, so you can't see it, or b) use a dummy model, which means no model.. that dummy unit will attack other units, while your bowman is loaded..

Another solution might be Multishot, create some multishot ability and hide it with a spellbook, the only problem here is, that you can't control the damage of various units.

Using dummies might be a solution, however, how can i force those dummies to stay near the transport vehicle and at the same time have them attack surrounding enemy units? Secondly, how can i make it MUI so it won't cause any issues when there are multiple transport vehicles?
 
Level 18
Joined
Mar 7, 2005
Messages
824
Hmm how about using "order to attack-move to transport vehicle" every x seconds, you can't see the dummies, but if they have ranged attack they will do damage, and follow the transporter.. But might be a bit buggy.

Maybe you can directly attach them on the transporter, or maybe use some phoenix-ability for the dummies. So you can attach them on the transporter while they shot via the phoenix-ability
 
Level 4
Joined
Apr 27, 2009
Messages
94
Hmm how about using "order to attack-move to transport vehicle" every x seconds, you can't see the dummies, but if they have ranged attack they will do damage, and follow the transporter.. But might be a bit buggy.

Maybe you can directly attach them on the transporter, or maybe use some phoenix-ability for the dummies. So you can attach them on the transporter while they shot via the phoenix-ability

Not exactly sure what this phoenix fire would do, afaik it's an immolation like spell.

Would you be so kind to make an example map for me and attach it? I will + rep ofcourse.
 
Level 15
Joined
Aug 31, 2009
Messages
778
Pheonix Fire is an exceptionally useful ability for this.

Pheonix Fire basically fires projectiles at random nearby enemies with customisable damage per shot, fire rates and range. It then applies a buff, making units affected by this buff take (optional) damage over time and preventing any more hits from Pheonix Fire based abilities. Obviously, we don't want that last effect, so set the duration of the buff to 0.01 seconds, to minimise this effect (don't set to 0! Or that means the buff lasts forever!).

Make it so that when a unit enters the bunker, the bunker gains a modified Pheonix Fire ability that corresponds to the unit type that entered the bunker, and then remove that ability when the unit exits. There should be no issue in adding many pheonix fire abilities to the same unit (just as long as the duration of each one is 0.01 sec) so that it fires a multitude of different projectiles with different damages etc.
 
Level 4
Joined
Apr 27, 2009
Messages
94
Alright I've grasped the concept, many thanks.
The only disadvantage is that you cant adjust what kind of attack it is, pierce/magic etc. But thats just something i'll have to live with.

EDit: this causes another difficulty, if 2 units of the same type, enter the bunker, only 1 phoenix fire ability will be added to the bunker since they dont appear to stack, any adequate way to solve this?
 
Level 15
Joined
Aug 31, 2009
Messages
778
You could add multiple levels of the ability, and if a unit enters the bunker and the bunker already has the ability, then increase the level to (Current Level + 1).

Once a unit leaves, reduce the level by 1, and if the level is currently 1, remove the ability.

And of course, make the extra levels of the skills shoot twice as fast, to simulate the effect of twice as many units inside attacking.
Example:
Rank 1: 1.5sec cooldown.
Rank 2: 0.75sec cooldown.
Rank 3: 0.5sec cooldown.
etc.
 
Level 4
Joined
Apr 27, 2009
Messages
94
Alright, a few more difficulties arose unfortunately.
What I have done is, make the first rank of phoenix fire ability do nothing by setting it's range to 0.
Upon loading a unit, the level of the phoenix fire increases only 1 time, even though there are 9 levels for that ability, thus the attack speed always remains the same. Why this happens is beyond me, considering it does work the first time.

Secondly, how can i make a functionable trigger that decreases the level of phoenix fire when a unit leaves the vehicle, as far as i know there is no event for that.
The only way i can think of to achieve that is to set the ability level of phoenix fire to 0 when unload all is used, but when you unload a single unit, it doesnt seem to me that an ability is used.

Anyhow, i've quickly made a map where i copy pasted the phoenix fire ability the way i edited it, and made a trigger so hopefully someone could assist me with it.

For the sake of simplicity i used standard models.

View attachment phoenixtestmap.w3x
 
Level 4
Joined
Apr 27, 2009
Messages
94
I've come up with a way that might possibly work, however i do not know how to execute it exactly.

What i thought of is to remove the unit, when it enters the transporting vehicle, since that way it will not be possible to unload a unit without using a spell.

Now what i dont know is, how to save all loading units to a specific vehicle.

I assume this is doable with hashtables, but unfortunately i am not capable of making them.
the only thing i could personally do is add those entering units to a unit group variable. but then it wouldnt work when there's more than 1 transporting vehicle.

Any help appreciated + repped :3
 
Level 9
Joined
May 30, 2008
Messages
430
The idea with the dummy units suit your need the best (if your units don't have inventory and they are going inside a bunker) just create same dummy units that apply the same upgrades/dmg and when a unit enter the bunker create one dummy outside of it so the dummy will attack
 
Level 15
Joined
Aug 31, 2009
Messages
778
But the dummy would have to be constantly moved to its rightful transport vehicle over and over again to make the projectiles actually come from the correct position. Detecting which dummy goes with which transport would also require hashtables. And moving a unit rapidly causes it to "stop" and not attack. Not only that, but when do you remove the dummy? You'd like to remove it when the unit exits the transport (somehow) but you can't really detect that.
 
Status
Not open for further replies.
Top