• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] {idea} [vJass] (System) CustomAttack

Status
Not open for further replies.
Yes,
I've started another system.

This is about a custom damageengine that does not only provide custom damagetables but also it will work like a charm with CustomMissile so you can connect it to not only fit your needs but also to fully replace the crappy warcraft 3 damage/attack engine so you can freeze attacks, change the attackrange/attackdamage/ whatever you think of ingame without loosing efficence.

But that's just the top.
Register callbacks to damageevents of a specific damagetype, get the damage source, whether its aura, spell, attack or system, make shields that do not only prevent units from taking damage but also freezes missiles around,...

There is much more I just wanted to throw this into the community.
Maybe you have an idea what really should be implemented?

Stay tuned for the next engine "revolution". :)
 
Level 8
Joined
Aug 6, 2008
Messages
451
You should first make some UnitProperties like OOP unit object struct thingy, with bonus system vJass scripts and GSL scripts for getting initial property values from object editor.

Because you are gonna need shitloads of data for custom attacks, and you also need to save loads of data to somewhere. Unit struct is simply the coolest way to do this.
 
Level 8
Joined
Aug 6, 2008
Messages
451
Hmm, the shitloads of data isn't that much at all, I only save stuff into (hash)tables and get the linked objects.

Thanks for your comment, I highly appreciate it.

To bad the unit data parser has not been finished yet.


Well, you at least gotta now units magic resistance and armor and armor type as well as attackers damage type, and some damage&armor types table to be able to calculate damage before resistances for ranged projectiles. You also need to know the exact attackspeed and damage point for dynamic evasion.

Object data parser is not needed, since you can easily get those initial values from object editor for your unit struct with gsl, which can also write them to the struct for you.


Also one unit struct is more simple, fast and intuitive than some hashtable databases. Simple unit.armor syntax is pretty much as cool as it gets.
 
Level 8
Joined
Aug 6, 2008
Messages
451
One struct instance per unit. One struct type for all.

Sorry if I was being unclear.


GSL is part of this GMSI thingy, which can be found for example from wc3c.net

edit. Also, Im curious. How are you going to modify attack range in game?
 
Level 8
Joined
Aug 6, 2008
Messages
451
So unit will have an attack, that cant target anything for showing attack panel in UI, and all the attack AI thingies and attack animations are triggered together with damage?

If you can get it work it will be pretty sweet I think.
 
Well, something like that.
In fact I was like:

Creating an ability that can target every vulnerable enemy (incredible high range) but the aquireation range will be set to 0 and I'll trigger the enemy is in range aggro.

Then I'll force the unit to cast the spell on target and the attack will be triggered.
This means the animationspeed will be changed, the animation will be played, and if nothing interrupts the attack it will take place and the damage event will be triggered.

However, those are only my theories.
What do you think?
 
i have a idea (i think the best way) for the close combat.
CloseCombat.jpg
easy to make and effective :)
 
Level 12
Joined
Sep 4, 2007
Messages
407
thats pretty much my idea for my map using your custom missile XD
you might even enable attack if you use a preventOrder and replace attack orders with cast missile orders. (don't forget to hide the "attack" button and replace for the ability button... or you can simply make a ability based on channel and make it without button o_O)
your custom missile system already replaces attack very well in my head. units can miss by attacking "air" and all damage is triggered. also, using your height check from custom missile you can prevent units from attacking from impossible angles, (a classic example is the archer attackin a unit in the top of a cliff and missiles that change tragetories and follow units just because the terrain have different hights.... which is VERY unrealistic).
also, with this you can make units in groung melee attack flying units if the melee unit is in higher ground making the attack extremelly realistic. basically with this you merge the biplane wcIII attack system(ground/flyng) from ground/flying to a 3D attack system, based on x, y, and z.

also, AI implemented might detect unit proximity and enable/disable melee and ranged attack when appropiate (like warhammer 40.000) Your TrollHero can finish that Blood Elf that was with 3 hp and was succesfully fleeing by throwing his axe that would normally be used to attack melee (of course that would make him completelly unarmed...).

you might even make different body part vulnerabilities according to the angle in which the target receives damage o_O if the target is a turtle, and the attack comes from behind or above it might ignore 35 of the damage and also receive 5 armor for the rest that passes throuhg that.

Damage from cutting attacks might leave units bleeding without the use of custom abilities and dummy units, a knockback system based on how much damage is caused and how much hit points the unit have (smaller units have less hitpoints). If a unit is excessivelly strong and attack with it's muscles or a blunting weapon, small creatures tend to be knockbacked (even if their armor blocks most of the damage).

injuried units might cause less damage and move slower.

the armor system might be ponctual instead of using that weird algorithm (i HATE WCIII armor system), every armor blocks 1 damage, min damage = 1.

arows might be stuck in the unit leaving in crippled (thats easy to do, and i DON'T mean attachments) until the unit is healed (time in which the arrow comes off)

Normal units might have inventories and their stats are affected by the items it is carring. i don't mean armor and attack damage. I mean attack range, damage prevention from the angle the shield is, armor for body, armor for the head (an arrow in the head might be letal, better use a helmet).

you can make slow attack animations for a crippled unit with perfect syncrony with the attack rate.

Trolls will finally have a melee sound for their attacks.

normal units with critical hits that make units bleed. Weird angle attacks inflict less damage and are slower. A guy with a spear migh hit a jumping unit when a guy with a sword can't. weapons might brake if used against hard armor people.

Flying units that land or get close to ground to melee attack ground units (and also become vunerable to ground attacks). And that WITHOUT a single ability, just order it to attack, the trigger will deal with the height change =)

(ok i'm a bit of dreamer, but i hope this helps with the ideas.)
 
Last edited:
Level 8
Joined
Aug 6, 2008
Messages
451
Sounds awesome. ( Although armor should be able to block all damage, but maybe with some armor breaking stuff, dont know )


Anyways, Im starting to like this more and more. If its easily customizzible, you can do almost anything with it. Those attack and aqquire target AI thingies are most important. I wanna see some code.

Time to post smiley: :thumbs_up:
 
Level 12
Joined
Sep 4, 2007
Messages
407
Since improving your missile system have effects in making this system i don't mind seing this get started as long as the missile system gets improvements XD

I don't think you need to post, just tell us what you think you are going to make in the system =)
 
JASS:
library test initializer init requires CustomAttack

	globals
		private unit priest = null
		private unit ghul	= null
	endglobals
	
	private function initAttackData takes nothing returns nothing
		local CustomAttack ca = CustomAttack.create('hmpr')	// Create an attack for the priest
		
		set ca.dmg = 7 // base dmg
		set ca.dmgDiceAmount = 1 // One dice
		set ca.dmgDiceMax = 2 // Max number
		set ca.hasMissile = true // Whether the attack has a missile or not
		set ca.damageType = DAMAGE_TYPE_MAGIC // Damagetype
		
		set ca.missile.sfx = ""
		set ca.missile.height = 50
		set ca.missile.moveSpeed = 500
		set ca.missile.turnSpeed = 1.
		// Whatever you want
		/* 
		set ca.missile.xyArc = 0.22	// 22% Arc on xy-level
		set ca.alpha		 = 155 // 50% visible
		*/
	endfunction
	
	private function init takes nothing returns nothing
		// Create some example units
		set priest = CreateUnit(Player(0), 'hmpr', 0, 0, 0)
		set ghul = CreateUnit(Player(PLAYER_NEUTRAL_ENEMY), 'ughl', 0, 0, 0)
		
		// Initialize all attack values
		call initAttackData()
		
		// Attacks the ghul using the attackdata 
		// of the priest, which is loaded automatically
		call CustomAttack.new(priest, ghul)
	endfunction
endlibrary
A little example code how to recreate the priest attack with my engine.
 
Level 12
Joined
May 21, 2009
Messages
994
About the hero damage, hero get extra damage from strength, agility or intelligence all after what their primary attribute is. At the advanced gameplay constants there is a line called "Damage per attribute" it is 1.0 or something. You should make a global that has the same name. All other gameplay constants that influences attacking and or damaging from attacks should be a configurable global as well. With the right formula it is easy to calculate hero damage.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Maybe you have an idea what really should be implemented?

Let me see. 3 things. Don't know if I 100% get what you're trying to make in this system but you might find this useful.

1) Give players the opportunity to make units have multiple attacks they can switch between. Typical example: Unit has a sword. Uses a custom spell that has that command in the trigger for the spell and his attack chances to ranged with arrow missiles. Might be useful if players would have this opportunity.

2) Give players the opportunity to chose if the ranged attacks from targets collapse upon contact with targets or only collapse if they hit the target the missile was fired for. 3 units stand in a line and you shoot the 3rd one. Does it hit the 1st one or does it ignore the 1st and 2nd one and only hit the 3rd one? Or does it hit them all?!:O

3) Maybe give players the opportunity to make ranged hits 'following' their target until they hit, or fall on the ground the target was when the shot was fired.

Maybe this makes it too complicated and tooooo big. But well... You might find this interesting to try to implement as well, because I got the feeling you're doing something incredibly difficult anyway. So why not make it even harder!:grin:
 
1) Give players the opportunity to make units have multiple attacks they can switch between. Typical example: Unit has a sword. Uses a custom spell that has that command in the trigger for the spell and his attack chances to ranged with arrow missiles. Might be useful if players would have this opportunity.
This is really nice. You can do it right now.

2) Give players the opportunity to chose if the ranged attacks from targets collapse upon contact with targets or only collapse if they hit the target the missile was fired for. 3 units stand in a line and you shoot the 3rd one. Does it hit the 1st one or does it ignore the 1st and 2nd one and only hit the 3rd one? Or does it hit them all?!:O
You can do that with one line.

3) Maybe give players the opportunity to make ranged hits 'following' their target until they hit, or fall on the ground the target was when the shot was fired.
You can do that with one line as well.

Maybe this makes it too complicated and tooooo big. But well... You might find this interesting to try to implement as well, because I got the feeling you're doing something incredibly difficult anyway. So why not make it even harder!
Thanks for the feedback, they are all good, any more ideas?
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
I maybe know something cool.

What about the possibility to change number of attacks.
Let's say a unit's number of attacks is 3. His long atk cooldown is 2.00 and his short atk cooldown is 0.3. That means he attacks 3 times in 0.9 seconds, then waits 2 seconds and attacks 3 times in 0.9 seconds again. This makes it possible for, per example, RPG makers that have duel wielding units to have their hero have 2 different attacks.

EDIT: and maybe something that allows you to use a damage system so DAMAGE_TYPE_MAGIC can be replaced by a custom damage type made by a system.
 
EDIT: and maybe something that allows you to use a damage system so DAMAGE_TYPE_MAGIC can be replaced by a custom damage type made by a system.
Already(/Nearly) possible.

What about the possibility to change number of attacks.
Let's say a unit's number of attacks is 3. His long atk cooldown is 2.00 and his short atk cooldown is 0.3. That means he attacks 3 times in 0.9 seconds, then waits 2 seconds and attacks 3 times in 0.9 seconds again. This makes it possible for, per example, RPG makers that have duel wielding units to have their hero have 2 different attacks.
That would be possile too, yes. (With some changings)
 
Level 8
Joined
Aug 6, 2008
Messages
451
In old good Starcraft you could actually build attacks someway like that. ( If I remember correctly )


You should be able to build your attack of many little attacks. To create something like Valkyrie in SC, shoots many rockets and stuff. Also ultralisk had 2 attacks in one, if I remember correctly.

Also your attack system could support some over time damage beam, like those new protoss weapons in sc2.
 
Also your attack system could support some over time damage beam, like those new protoss weapons in sc2.
You can create a link (register) every attackevent, from attackstart, attackdamage up to attackfinish.

A small update.
Here is a little preview, so you can see that a passive projectile slow aura is already working (full MUI).
 

Attachments

  • CA.jpg
    CA.jpg
    348.4 KB · Views: 124
Status
Not open for further replies.
Top