can I force a unit to shoot allies?
Moderator: Moderators
can I force a unit to shoot allies?
I mean really, I want to be able to give a command and choose my own unit as a target for attack. Can this be done reasonably or would it be a lua hack?
Re: can I force a unit to shoot allies?
... you're plotting something very strange, and I'm very interested.
Re: can I force a unit to shoot allies?
Spring.GiveOrderToUnit(unitID, CMD.ATTACK , { attackUnitID}, {}) works on allied units.
Though in my mod half the units refuse to teamkill, the other 50% have no problems with it. (probally some tag or whatever)
Though in my mod half the units refuse to teamkill, the other 50% have no problems with it. (probally some tag or whatever)
Re: can I force a unit to shoot allies?
cool.. what do you mean refuse to team kill..?
I have a unit that I want to have it go berserk and attack ALL UNITS killing and maiming anything near it.

I have a unit that I want to have it go berserk and attack ALL UNITS killing and maiming anything near it.

Last edited by smoth on 18 Nov 2011, 20:04, edited 1 time in total.
Re: can I force a unit to shoot allies?
unit gets the attack order (red line is drawn) but only follows the target and does not shot.cool.. what do you mean refuse to team kill..?
eg in xta: arm_flash can not attack allies, arm_samson can.
Maybe because of avoidFriendly=true or so.
Re: can I force a unit to shoot allies?
oh, so if it doesn't work, then it never works, not doesn't work some of the time. I am down with that G-MONEY!
Re: can I force a unit to shoot allies?
Instead of attacking the unit, try attacking the position the unit is that.
Of course that won't account for tracking a moving target, but if the attacker is supposed to have gone berzek, I suppose it's okay if it lobs a few shot to the emptiness and keeps changing target?
Of course that won't account for tracking a moving target, but if the attacker is supposed to have gone berzek, I suppose it's okay if it lobs a few shot to the emptiness and keeps changing target?
Re: can I force a unit to shoot allies?
Short of it:
Ms is possesed by a raging bitch who attacks targets relentlessly in some sort of permanent ghost PMS RAEG. Not randomly very deliberate and savage. It ripps heads off and shit.
when I say berserk I don't mean malfunctioning I mean going into "KILL EVERY, FUCKING, THING, ONE BY ONE, ALL MY HATE" mode
relevant
Ms is possesed by a raging bitch who attacks targets relentlessly in some sort of permanent ghost PMS RAEG. Not randomly very deliberate and savage. It ripps heads off and shit.
when I say berserk I don't mean malfunctioning I mean going into "KILL EVERY, FUCKING, THING, ONE BY ONE, ALL MY HATE" mode
relevant
Re: can I force a unit to shoot allies?
In my meteor map, I mde it spossible for falling meteors to spawn units, and they would either attack nearest unit or choose to ally its team.
However, the place in the code where the unit allies the player apparently came after the order to attack nearest unit (that happened automatically since units from meteors are gaia team), because even after the unit had allied the player, it would keep shooting at his units until explicitly given the stop command.
So it certainly is possible. I think flashes also did it.
However, the place in the code where the unit allies the player apparently came after the order to attack nearest unit (that happened automatically since units from meteors are gaia team), because even after the unit had allied the player, it would keep shooting at his units until explicitly given the stop command.
So it certainly is possible. I think flashes also did it.
Re: can I force a unit to shoot allies?
sounds cool!
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: can I force a unit to shoot allies?
That meteor example is a bug that's fixed in 83.0. Units transferred to a different allyTeam would not recheck the validity of their target, now they do.
I'd try Spring.SetUnitTarget, it bypasses attack commands. If that fails I don't think anything will make it attack allies so I'd try transferring it to Gaia when it goes berserk.
Alternately if you don't mind it accidentally damaging allies when normal set 'avoidFriendly = false' in it's weapondefs. With this tag attack commands on allies will work and it will aim without taking ally units into account.
I'd try Spring.SetUnitTarget, it bypasses attack commands. If that fails I don't think anything will make it attack allies so I'd try transferring it to Gaia when it goes berserk.
Alternately if you don't mind it accidentally damaging allies when normal set 'avoidFriendly = false' in it's weapondefs. With this tag attack commands on allies will work and it will aim without taking ally units into account.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: can I force a unit to shoot allies?
Have you considered having the unit go to to a gaia AI where all players are free to target, and then switching back when the event's timer is up?
Re: can I force a unit to shoot allies?
What if I am already using gaia ai for something else.. not acceptable solution...
what if it 2 players have a blue destiny unit. they will see each other as allies.. not acceptable.
what if it 2 players have a blue destiny unit. they will see each other as allies.. not acceptable.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: can I force a unit to shoot allies?
2 players? good point.
What about detecting the closest unit: so once you have a target locked, turn to a side opposite from it. Give it to the enemy players (but lock out controls). Then on each next target do a recheck to switch the team, untill bezerk is done and it is can be restored to the original player.
What about detecting the closest unit: so once you have a target locked, turn to a side opposite from it. Give it to the enemy players (but lock out controls). Then on each next target do a recheck to switch the team, untill bezerk is done and it is can be restored to the original player.
Last edited by bobthedinosaur on 24 Nov 2011, 15:04, edited 1 time in total.
Re: can I force a unit to shoot allies?
Add more NullAIs to get more gaiea teams \o/
(with the fantastic lua lobby it should be possible to automate that)
did you try any of the other ideas proposed?
(with the fantastic lua lobby it should be possible to automate that)
did you try any of the other ideas proposed?
Re: can I force a unit to shoot allies?
Not yet, I want to try it soon.
Re: can I force a unit to shoot allies?
High Soon in Suggestion City. There is only enough room for one Idea, stranger!