- Joined
- Jan 30, 2013
- Messages
- 12,757
A custom attack system, this is... ambitious 
(2 ratings)
EVENT_ATTACK_DESTROY
DestroyEventAttack()
Indeedthis is... ambitious![]()
I haven't updated to patch 1.29 yet, because of slow and limited data accessnew natives
It is an alternative system to handle units' attacks. If you look at the test map, you can see that the footman's ranged attacks have multiple special effects used for its projectile (Something you can't do with the game's default attack system).I dont quite get what it does..
EVENT_ATTACK_DESTROY
DestroyEventAttack()
You mean even with something like(Potential bug) In the Evasion System, even if you were to set evasion up a notch, it might still affect the unit. Experienced with buildings. Is this intentional?
call SetUnitEvasion(target, 2.00)
, the target still has a chance of getting hit? Haven't tested it with buildings indeed so I'm gonna check it out.Right. Will be fixed next update.When pausing the game, a unit whose attack is disabled will have the attack ability display a green icon. (Workaround is to export the disabled icon and treat it as an active icon.)
A major contributor to this might be the spamming of units for every ranged attack's missile (2 dummies per missile in fact). I hope I can update to 1.29+ soon to get rid of the need for dummies. As for using timer systems I'll just try to optimize my internal timer usage instead.This takes up a bit more of resource than the internal attack system, and with more units, the performance drops quite a lot (nigh exponential). (Perhaps your MasterTimer library can come into play or Nes' Timer library)
@AGD, I'm on patch 1.29.2, and get syntax error, because a functionv1.0e
- Made compatible for patches 1.29+
BlzGetUnitZ
is used which I don't have.native BlzGetLocalUnitZ takes unit whichUnit returns real
. I can't seem to find your used function inside patch notes.Thanks. I used BPower's Missile lib at the beginning, but it doesn't support arcing movements for homing missiles and then there also comes the natives from the new patch which rendered the dummy method obsolete so I was forced to write an internal one. I wonder if there's any chance @BPower 's gonna update his lib.. would be nice =). If not, I'm not sure I can write a full projectile system.Man this looks cool AF. I will check this out soon and see what kind of crazy stuff you've added.
I dig the use of the new natives. I've barely seen any resources using them.
One thing I recommend is to split the projectile resource into its own library. I might, for example, not want to overhaul the entire attack engine of the game and prefer to use just custom projectiles.
call SetWidgetLife(target, GetWidgetLife(target) - attack.damage + 0.001)
/*
* If the damage is negative, it's still needed to deal damage to the target to maintain the desired
* behavior of an attacked target (ex: units with 'build' ability should retreat from the attacker)
*/
call UnitDamageTarget(u, target, 0.001, true, ranged, attack.attacktype, attack.damagetype, attack.weapontype)
function DealDamage
, or the original source unit did it? I'm not sure if it would be useful for user, like operating at an event with unit type of the source, which would not exist anymore. Maybe UnitTypeId information makes sense, too, to save as member of source attacker? - the user could still check for source's GetUnitTypeId if needed, I guess, to check if he needs to read it.Table(KEY).
could be table = KEY
-> table.
but yeh haha..^^attackOrderType
could be a struct for tiny bit more readability. (in sense of an enum)'ncop'
could be on top config private function TargetUnitFilter takes unit attacker, unit target returns boolean
return attacker != target and/*
*/ UnitAlive(target) and/*
*/ GetUnitAbilityLevel(target, 'Aloc') == 0 and/*
*/ (IsUnitVisible(target, GetOwningPlayer(attacker)) or GetUnitTypeId(attacker) == 0) and/*
*/ not IsUnitType(target, UNIT_TYPE_ETHEREAL) and/*
*/ not BlzIsUnitInvulnerable(target)
endfunction
BlzIsUnitInvulnerable
works very wrong, and no attack was properly launched, and always canceled at some point -- auto acquire didn't work, too. With removing the invulnerable check, all seems to work, and demo is running, too. In patch notes 1.30 I then found "[World Editor] BlzIsUnitInvulnerable returns the correct boolean value" . I might do this but it will be only after the other basic features are already stable.If I was able to write Table, which was also mostly a spin-off at the beginning, then you can spin off your own projectile handler.
What you could consider doing is trying to imitate BPower's API, which would give it the same syntax (thus easier to integrate for users already on his missile system).
I think this is because of the dummy ability I used which is based off channel. I tested it and for some reason, even if you set both the casting time of the channel ability and the unit to 0, the spell will still have a short casting time. Anyway, I'll check that technique using attack with 0 damage.Also the re-targeting is awful. I issue an Attack or Smart order and the BM takes almost a second or two to get the hint. Your engine should intrinsically know his attack cooldown is ready and that the missile should launch at the same time.
Will addFor the demo, you should implement a barrier-type thing which showcases how the attack projectiles work.
Lastly, maybe give the BloodMage a melee attack without the orbs, to show off that it can switch seamlessly as you put it.
One can know if the damage source is the dummy by checking ifIs there a a way to know if the dummy dealt damage infunction DealDamage
, or the original source unit did it? I'm not sure if it would be useful for user, like operating at an event with unit type of the source, which would not exist anymore. Maybe UnitTypeId information makes sense, too, to save as member of source attacker? - the user could still check for source's GetUnitTypeId if needed, I guess, to check if he needs to read it.
GetUnitTypeId(attack.source) == 0
is true. However, there is currently no way of knowing the unitId of the removed unit source. I'll add it as I also think it's necessary.The targetX/Y is intended for storing values of the target point when attacking a point. Before reaching to the target point, the unit may auto-acquire enemy targets on its way and therefore by doing that, it would overwrite the targetX/Y values and the users will no longer have access to the original target point.Even if a widget is targeted, maybe targetX/Y could be assigned to widgetX/Y then, instead of 0? (still a value, but wrong value) But sure user could read it out of widget natives.
The speed of the missile will not be affected by teleport but it does abruptly change its height and orientation though. The sudden change in orientation of fine I guess but the sudden change in height is really a problem.. Thanks for pointing this out. Will find a way for this.A last remark, or just note.. but not sure myself how to handle it the best. When a unit teleports away ,for example, then the projectile follows to the target's new position, and it might look some ugly because the projectile might abruptly turn, change the curve looks, and change speed in extreme. Not sure if users should be notified about such extreme position changes, being able to cancel the peojectile flight, or what ever.. but yeh, maybe you had some thought about it already. Just as note.
I see.The targetX/Y is intended for storing values of the target point when attacking a point. Before reaching to the target point, the unit may auto-acquire enemy targets on its way and therefore by doing that, it would overwrite the targetX/Y values and the users will no longer have access to the original target point.
Ok, I probably falsly thought one can define like a max duration for the missile, so changing distance in large scale might have big efffect. In theory it would be probably a bit strange if a missile follows the unit though the whole map after a teleport and hits the enemy after 30 seconds.. or idk.The speed of the missile will not be affected by teleport but it does abruptly change its height and orientation though.
There's a thread for suggesting new natives to Blizzard. GetUnitArmor/DamageType (and hopefully Set) would be a huge plus. SetUnitProjectileSpeed would be cool, but an event which fires when a unit launches their projectile would be better, followed by the projectile being accessible as a Special Effect type (would probably need more complex natives for that though, such as start/stop projectile movement, set Target X/Y/widget)Yeah I guess I don't have a choice but to drop support for 1.29.
Regarding the attack with 0 damage, my problem right now is that there's no way to dynamically change the missile speed of a unit via natives. Which means that you need to predetermine all the unittypes that you want to register to the system since you have to edit their projectile speed at the object editor. I need think of a workaround to dynamically set the projectile speed between normal speed and being instant. Any help with this would be nice =).
Not sure I understand how it is related, could you elaborate? Also, what do you mean with changing projectile speed is not possible - you do set its motion viaRegarding the attack with 0 damage, my problem right now is that there's no way to dynamically change the missile speed of a unit via natives.
call BlzSetSpecialEffectPosition(sfx, x, y, z)
, don't you?Sadly no, it can only be used in patches 1.30+.Can it be used for 1.26?
That's a shame. Amazing system. It would work perfect for my Yasuo wall type spells and Chronospheres.Sadly no, it can only be used in patches 1.30+.
Here, I found something similar that works on 1.26 Burst Laser v3.1. Does it mean it is possible to create on 1.26?Sadly no, it can only be used in patches 1.30+.
For a shield that only blocks damage, yes you can do it (Damage Engine would suffice). But for stopping the movement of projectiles, you have to use a custom attack system that uses a custom projectile (just like this lib) in order to do that.Another question is if I want a shield that block ranged auto-attack, is there a way to do it on 1.26? Similar question regarding the time stop spells that stop ranged auto-attacks.
Here, I found something similar that works on 1.26 Burst Laser v3.1. Does it mean it is possible to create on 1.26?
The earliest patch supported was up to 1.29 only (I lost the copy), but the current version of this system can be recreated to work for 1.26 too. However, as others have pointed out above, the agro, target acquisition, attack animation, backswing, damage point, etc. is different and inferior compared to the built-in attack system of the game, since this system literally rebuilt these things from scratch.I noticed there was an older version that supported older patches, how far did that work below 1.29 and also would anyone still have it?
Well, by the shield, I meant similar to the Yasuo's wall. So, if there is a shield (or wind wall) between the attacker and attacked unit, the attacker's ranged attack gets blocked by the shield (disappear when encountering the shield).For a shield that only blocks damage, yes you can do it (Damage Engine would suffice). But for stopping the movement of projectiles, you have to use a custom attack system that uses a custom projectile (just like this lib) in order to do that.
The earliest patch supported was up to 1.29 only (I lost the copy), but the current version of this system can be recreated to work for 1.26 too. However, as others have pointed out above, the agro, target acquisition, attack animation, backswing, damage point, etc. is different and inferior compared to the built-in attack system of the game, since this system literally rebuilt these things from scratch.
In order to make this system work seamlessly with the built-in attack system of the game instead, one has to recreate this using patch 1.31.1 or above. I already have a pretty good idea how to do it by utilizing the natives introduced in the newer patches but right now I still don't have much time to do these things without other distractions.
Will be looking forward to the new system. I think I can make it work for 1.26 with the memory hack. Why don't you use Relativistic Missiles for that?For a shield that only blocks damage, yes you can do it (Damage Engine would suffice). But for stopping the movement of projectiles, you have to use a custom attack system that uses a custom projectile (just like this lib) in order to do that.
The earliest patch supported was up to 1.29 only (I lost the copy), but the current version of this system can be recreated to work for 1.26 too. However, as others have pointed out above, the agro, target acquisition, attack animation, backswing, damage point, etc. is different and inferior compared to the built-in attack system of the game, since this system literally rebuilt these things from scratch.
In order to make this system work seamlessly with the built-in attack system of the game instead, one has to recreate this using patch 1.31.1 or above. I already have a pretty good idea how to do it by utilizing the natives introduced in the newer patches but right now I still don't have much time to do these things without other distractions.