Mana is its fuel

shazam ham

New Member
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.
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
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
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.
 
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
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
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
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.
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
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.
 
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
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?
 
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
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.
  • Varine Varine:
    What a fucking disaster. Are all of the Texas people okay? I see TH is, are we the only two?
  • Varine Varine:
    How have the other states held up? I just got power back so I have no idea what's going on, we didn't get warning
  • Varine Varine:
    Why the fuck didn't they fix this ten years ago when it happened?
  • Blackveiled Blackveiled:
    I'm in it with you and TH as well. My power has been in and out, and I have a ruptured pipe that I need to fix, shouldn't be too bad to fix myself.
  • Varine Varine:
    I hope you're staying warm! Apparently the supply is coming up so hopefully we can get back to normal power soon, mine has been on for six hours now.
  • M Mulciberxp:
    My power has been off most of the last 2 days. We had a generator installed 3 years ago though, so we're staying warm. Water is another issue...
  • The Helper The Helper:
    Where I live has a pool so we are using that to get water to flush the toilets. We have enough bottled water to drink and brush teeth and stuff but it has been a few days and no shower though....
  • Varine Varine:
    I had some water in gallon jugs, and got our water back on yesterday. We don't seem to have any leaks, but I haven't crawled down there to look yet.
  • The Helper The Helper:
    still no water I cannot remember when I last showered now I know how they felt in the old west lol
  • Varine Varine:
    My poor plants are happy, they aren
  • Varine Varine:
    aren't used to going this long without water or lights or normal heat. I think a couple of them froze, but they look like they'll make it
  • Varine Varine:
    Well one of them is pretty rough but I think it was sick to begin with, that one always had some problems.
  • jonas jonas:
  • jonas jonas:
    ???
  • Ghan Ghan:
    That is such a Texas thing to say lol
  • midnight8 midnight8:
    a positive could come out of this. So many people trapped at home could put a dent in the covid numbers in Texas
  • Varine Varine:
    That dude, Tom Boyd, is really upset about the backlash from his "it's your fault you're freezing" thing because he claims he resigned before saying it, so it wasn't like he said it in his official capacity or anything.
  • jonas jonas:
    Almost as if he was saying "screw you guys, I'm going home"
  • Varine Varine:
    I'm fairly new here still but that seems to be the analogous message by several of our politicians.
  • vypur85 vypur85:
    Nobody?
  • jonas jonas:
    Hi vypur85, long time no see
  • tom_mai78101 tom_mai78101:
    Hi vypur85, long time no see.
  • The Helper The Helper:
    We are all somebody
  • Varine Varine:
    I kinda like being nobody tho.
  • The Helper The Helper:
    Voting for the NUON Controller Contest is open in the NUON-Dome NUON forum

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top