• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Two Systems

Status
Not open for further replies.
Level 8
Joined
Aug 13, 2018
Messages
338
Hi all, I need two systems together for my new turn-based map:
1-Is it possible to deploy a system that when unit moves, its mana is burns and when the mana is equal to zero the unit can't to move. I need this as one passive ability and automatic.
2-in the map:
Chaotica: A Card Game v1.01a
units can't to attack directly and normal but have an ability with the name "Attack". When unit cast this ability on an enemy unit both units attack together, one time. (To fully understand, please ply the map) I need a system like this system with somethings to not allow to unit to attack multipe times in a simple turn.
Please forgive me because of wording.
 
1-Is it possible to deploy a system that when unit moves, its mana is burns and when the mana is equal to zero the unit can't to move. I need this as one passive ability and automatic.
One could make such a system by periodically polling such units and checking if their position changes. One can then charge mana based on the distance travelled. Once mana is 0 one can pause the unit, or remove its ability to move, etc.
units can't to attack directly and normal but have an ability with the name "Attack". When unit cast this ability on an enemy unit both units attack together, one time. (To fully understand, please ply the map) I need a system like this system with somethings to not allow to unit to attack multipe times in a simple turn.
One has to track which units have available attacks. Attacking can simulate an attack using triggers. After attacking remove the unit from having available attacks. At end of turn, or whenever, add all units back to the having available attacks.
 
If you want standard auto attack mechanics it might be possible by using controlled usage of silence. Have the unit permanently silenced by using a dummy unit with auto attack disabled, then when the ability is cast remove the silence debuff and let them attack until a unit is attacked event fires once. After a short delay to accommodate for swing time use a dummy unit to silence them again. Since attack speed does not matter in this case, set it to some value like 1 second or 4 seconds so that only 1 attack can be launched per cast.
 
You need a system to keep track of units that are moving and losing mana. When they run out of mana that system would then pause the unit. Currently you are only testing their mana when they either start or stop moving.

There is the Unit - Mana event which might work for this. However if the units can die and get removed you will need to periodically recreate the trigger to prevent leaks.
 
Untitled.png

What is I must enter at blue place?
 
The unit you want to track. If such units can be created at runtime you will need to dynamically create the event. If such units can be removed during runtime you will need to periodically recreate the trigger to prevent event leaks.

Have you checked the spell section for fuel like systems? I recall seeing many in the past but I am not sure if they have been removed or if they are still compatible with Warcraft III.
 
I do not think triggers have a concept of scope. That kind of means every trigger is implicitly public.
Actually I need to enter here "An Unit".Now, what is I must enter here?
This makes no logical sense since the event binding function requires reference to a specific unit. You could iterate through every unit on the map and create an event for them. You could also do the same in response to a unit entering playable map area. However if any of such units get removed the events created for them are not automatically removed so are prone to leaking. To remove these events the trigger needs to be periodically recreated since the events get removed on trigger destruction.

This almost certainly requires writing JASS directly to be done properly.
 
I decided to help you out with the mana detection. It should work for most cases, and is GUI friendly. Units with 0 mana pool are ignored by the triggers. Also, do not use Waits/TriggerSleepAction, unless you use locals in your triggers.

Also, I noticed that you previously were pausing units when they ran out of mana. That could be a problem for you because, by default, units can't regenerate life/mana when they are in such state. I simply made units get their propulsion window set to 0, which makes them unable of moving. Though, that's not the best solution. Maybe stun would be better in this case.

EDIT: Oh, this requires JassHelper (JNGP, WEX, or your war3 version must be on 1.30.0 or higher).
 

Attachments

Status
Not open for further replies.
Back
Top