- Joined
- Jan 17, 2010
- Messages
- 6,110
Spell as basic attackSpell as basic attack
by -Kobas-
Requirements
* Basic knowledge of the Object Editor
* Basic knowledge of the Trigger Editor
* Poor knowledge in variables.
* A moment of your time (Around 5 min).
Introduction
This new cool way to create hash and slash games without removing units attack from UI
Yes hero will still have displayed attack damage and any bonuses that goes with it (Items, abilities etc...)
Let's start!
Usually this kind of games just removed attack damage from hero and used large number of all kind of array variables to store data (damage, damage type and such things).
How to do it easier way.
- 1st of all do next, pick your hero (Paladin for example) and just remove the attack icon - the only one you can remove; go to Combat - Attack 1 - Show UI and set it to False. If your unit uses both attack types, then do the same for the Combat - Attack 2 - Show UI field.
- 2nd. Create new ability (example: Channel, set it to unit ability, make it visible and set path x,y(3,0), rename it to attack and set cooldown to dunno, 1 sec, also edit spell animation to attack)
- 3rd. Create this like trigger:
Variable [(Random unit from (Units within 128.00 of p))] can be edited to anything you want
- Attack
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Attack
- Actions
- Wait 0.00 seconds
- Set p = (Position of (Triggering unit))
- Unit - Order (Triggering unit) to Attack Once (Random unit from (Units within 128.00 of p))
- Custom script: call RemoveLocation (udg_p)
Good: You can use mouse to target enemy units
Bad: Small delay before attack (because of wait, but it won't work without it.)
How to do it more professional.
- 1st. Once again hide attack UI.
- 2nd. Duplicate your unit
- 3rd. Set targets for real one to "wards" or anything you don't use!
- 4th. Open Game Interface panel and instead of message text (Can't attack target or whatever you set for attack target) set " " (space).
- 5th. Create your duplicate unit somewhere on map, add locust ability to it and change owner. Each time when you pick/drop item, learn spell or whatever, do same with dummy unit, then order that unit to attack once another dummy unit (10000 hp and regeneration, 0 armor, for armor and damage type try to use some unused type in your map, just edit values in gameplay constant so this damage actually deal 100% to target unit) and then just save damage taken into variable.
- 6th. Create new trigger that will deal this new saved damage to random unit/s when you cast spell.
Variable [(Random unit from (Units within 128.00 of p))] can be edited to anything you want
- Attack
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Attack
- Actions
- Wait 0.00 seconds
- Set p = (Position of (Triggering unit))
- Unit - Cause (Triggering unit) to damage (Random unit from (Units within128 .00 of p)), dealing X damage of attack type Normal and damage type Normal
- Custom script: call RemoveLocation (udg_p)
Variable [X] is your hero saved damage.
You can use variables to change attack and damage type as well.
Good: Unit won't attack nearby enemy units without order.
Bad: Small delay
Author's notes:
Don't forget special effects, floating text and such things.
I will try to finish test map, this is so far tested idea only, it works I just need to polish it a little.
Last edited: