Mana is its fuel

shazam ham

New Member
Reaction score
0
Hokay, so... I have a tank. I gave it mana. Now what I have been trying to do is make it lose 1 mana every 1 second. When it does it can no longer move, until givin more mana. I havent the slighest idea how to do this. I havent been able to figure out how to do it. Any help would be amazing. Thank you.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
At your unit tank at mana regeneration press shift+enter using jassnewgenpack and add the value -0.01. I think it works.
Make a periodic event with a loop time of 0.5 seconds and check your tank's mana, if it goes 0 pause the unit. When your unit is paused and its mana reaches up to a value lets say 50 unpause it.
 

shazam ham

New Member
Reaction score
0
Ha that sounds easy haha. can you switch between origional worldedit and the jassnewgen? I'm not familiar with jass yet... :thdown:
 

TomTTT

New Member
Reaction score
44
This such trigger can be easily done with GUI. Just make a periodic of 1 second, and then pick all units that are tanks, and set their mana to -1. Then make a condition, if the mana is 0 pause the unit. and make another periodic, check if units mana is 50+ and its paused, and unpause it. Tell me if you need me to show an example trigger.
 

shazam ham

New Member
Reaction score
0
If you would that would be amazing. minimum is 0.00 so im dont think i understand what you mean. Thankee :D
 

TheOverWhelm

Member
Reaction score
16
You don't need Jassnewgen to use ho;ld Shift+Enter to enter negative values.
Shazam, go to the unit, highlight Mana Regeneration. Hold shift, hit enter, enter -1.
Also, JassNewGen wont mess with anything for you. It merely adds more functionality everywhere but its highlight is JASS, so no need to worry. More GUI options too.
And as Tom said, use a Periodic Event that picks tanks and if Mana == 0 then Pause the unit, perhaps add it to a group so that you can detect when its mana isn't 0 anymore
 

shazam ham

New Member
Reaction score
0
Ok kewl. Sadly it took me a bit before I understood the - 1 regeneration thing but i figured that part out. I've found the pause/unpause thing but I cant figure out how to get it to check if mana is 0. Is it a condition? Same if checking if its not 0 anymore? If so what condition do I use? I have not been able to find one.
 

TomTTT

New Member
Reaction score
44
Yup, it's a Real Comparison.
Anyway, theres an example:
Trigger:
  • Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Tank))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Equal to 0.00
            • Then - Actions
              • Unit - Pause (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of (Picked unit)) Equal to 50.00
                  • ((Picked unit) is paused) Equal to True
                • Then - Actions
                  • Unit - Unpause (Picked unit)
                • Else - Actions
      • Custom script: call DestroyGroup(udg_UnitGroup)
 

shazam ham

New Member
Reaction score
0
Wow! You did all that in actions??? Where do I find "Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Tank)), if then and else options in the actions? I appreciate all this help! I've got to figure out how to add to your guys rep ha
 

thorhunter

You can change this now in User CP.
Reaction score
32
While mana is real value, I suggest using (greater than or equal to 50) equation, since there can be various mana regeneration bonuses. Same goes for 0 value, I'm pretty sure that with slighest mana regeneration (unless negative) you wont catch the moment with trigger when it hits 0 (unless used Unit-property event, which fits better I think)
 

TomTTT

New Member
Reaction score
44
While mana is real value, I suggest using (greater than or equal to 50) equation, since there can be various mana regeneration bonuses. Same goes for 0 value, I'm pretty sure that with slighest mana regeneration (unless negative) you wont catch the moment with trigger when it hits 0 (unless used Unit-property event, which fits better I think)
Yup, but then he needs to make 2 more triggers, one for picking all tanks and putting them into the event, and second when a tank is entering the map. And a slight delay of 1 second won't make that much of a difference. The same, you can amek it every 0.25 seconds and take down only 0.25 mana at a time. or you can even 0.01.
 

TheOverWhelm

Member
Reaction score
16
I think Greater Than works better (tanks with 100 mana! o_O), also having the boolean do a "Unit is Paused == true" and Unit is Paused == false
Conditions run much faster then actions.
Not to mention the weird pause bug. -Shrug- Just a thought!
the set Unitgroup is a unit group variable.
If then else is near the beginning of the actions list.
 

shazam ham

New Member
Reaction score
0
Alright thankee guys so I ended up using
Events
time- every 1.00 seconds of game time
Conditions
(Mana of Car 0003<gen>) Equal to 0.00
Actions
Pause Car 0003<gen>

It works but the tank starts holding the passengers hostige and wont let me unload them. I tried looking for something and changed the actions to:
Actions
Unit - Order Car 0003<gen> to unload (loading unit)
Unit - Pause Car 0003<gen>
Still will not work... Even changed to pick a specific unit to unload I've got nothing. Any suggestions?
 

TheOverWhelm

Member
Reaction score
16
Loading Unit is a back one to use.
You can simply set unit speed to 0 if it doesn't attack.
In Game Constants though, you'd need to set the min speed as 0 instead of 35 though.
 

WildTurkey

Previously known as giv_me_rep
Reaction score
88
I used to use that immolation neutral hostile skill to remove -1 mana/sec and then run a seperate loop to check for current mana levels whenever the unit is ordered to move. it saves the periodic triggers..

i dont know if this is more or less efficient BUT



Event: unit is issed an order
Condition: unit is of type (your unit)
Action:
If: Moving unit) has mana > x (x will be dependant on the mana regeneration rate of your unit...)
order moving unit to stop
else: give moving unit) permanent immolation skill)

Unit stops moving:
remove immolation skill

Unit stops an ability:
ability = immolation
order unit to stop

Hope i havn't wasted any time with a bad trigger. been years since i WCIII'd
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top