• 🏆 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!

[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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,208
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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,208
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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,208
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.
 
Level 8
Joined
Aug 13, 2018
Messages
338
Untitled.png

What is I must enter at blue place?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,208
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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,208
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.
 
Level 13
Joined
May 10, 2009
Messages
868
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

  • Is Unit Moving with events.w3x
    30.6 KB · Views: 25
Status
Not open for further replies.
Top