• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Make a spell cost supply?

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I try to make when a player use the ability "Calldown: Mule", that player need to have 1 supply free for the unit that is being spawned. If you don´t, you can´t cast the spell.

Anyone knows?
 
Last edited:
Level 10
Joined
Nov 5, 2008
Messages
536
Use a "Player Compare Food Available" Validator on the effect directly connected to the ability. Should that effect fail, the ability will also fail - printing the validator's error on the screen for the violating player.

I have added the validator to the "Calldown Create Mule - effect" that is a part of the Calldown Mule ability. I added it in the Validator field of that effect, (of course). I´ve tried different values in the "Compare" and "Value" fields of the validator. It won´t work as intended.

I have added -1 supply to the MULE, plus a casting cost in minerals to the ability. (That was easy. ^^)


How do I get the validator to deny players from Calldown Mule unless they have 1 free food available?

For example, Player A has 65 minerals and 19/20 supply. Calldown Mule costs 5 minerals. He uses the ability once, so he get 20/20 supply and 60 minerals left. He can´t use it more until he free up his supply.

Ps. I won´t use this for MULES, I just need the system to work so I can use it for other units.


Ps2. I need to learn more about different kind of validators T_T
 
Last edited:
Level 11
Joined
Jul 20, 2004
Messages
2,760
I did understand the first time what you have in mind, and the solution is in fact as simple as I mentioned. The effect attached to the Calldown Mule ability is Calldown Mule (Create Unit). If you add to its list of validators the type of validator I mentioned (validating for CASTING PLAYER's Food GREATER THAN 0). I attached a sample map.
 

Attachments

  • TestMule.SC2Map
    13.8 KB · Views: 72
Status
Not open for further replies.
Top