How to make mana Degen every 5sec (out of combat)

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Well, a blunt way would be checking every 5 seconds for the current order of an unit. If it's "attack", don't do anything, if it's "hold ground" or "stop", set the units mana to units mana - 5.
 

J3LADE

New Member
Reaction score
7
o_O im kinda stuck now... what happens if theres more than 1 of this unit?

I have made my first trigger to add mana to the unit every time it attacks. Also it sets the variable "Warrior [Player Number of (Attacking Unit)]" to (Attacking Unit)

Then my next trigger is like this so far:

Event:
Every 5sec of game
Conditions:
Actions:
If Then Else:
Conditions:
Or any Conditions are true: Current order of the variable "Warrior [???]" equal to stop
Current order of the variable "Warrior [???]" equal to Hold Ground
Current order of the variable "Warrior [???]" equal to Move
Current order of the variable "Warrior [???]" equal to Patrol

Replace ??? with something that works plz or change the triggering alltogether if you want. Try to make it generic if you can so i don't have to write a trigger for every player. o_O
 

Tinki3

Special Member
Reaction score
418
For Each (Integer A) from 1 to 12 do Loop - Actions
--Loop - Actions
----If Then Else:
------Conditions:
--------Or any Conditions are true:
----------Current order of the variable "Warrior [(Integer A)]" equal to stop
----------Current order of the variable "Warrior [(Integer A)]" equal to Hold Ground
----------Current order of the variable "Warrior [(Integer A)]" equal to Move
----------Current order of the variable "Warrior [(Integer A)]" equal to Patrol

Use "Integer A" to refer to every warrior from 1 - X
 

J3LADE

New Member
Reaction score
7
Yea ive never thought of that Integer 1 to X because i don't really know what it refers to. Like how do you know it's not 1 - 12 items or attacks? o_O So could you give me some enlightenment on this?

Thanks Tinki3
 

Tinki3

Special Member
Reaction score
418
> could you give me some enlightenment on this?

Code:
Example
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to <Number of Warriors>, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Current order of Warrior[(Integer A)]) Equal to (Order(stop))
                                 ...
                    Then - Actions
                        Unit - Set mana of Warrior[(Integer A)] to ((Mana of Warrior[(Integer A)]) - 10.00)
                    Else - Actions
The "Loop - Actions" will loop through every "Warrior" unit that has a current order of "stop", every 5 seconds.

And, if the current Warrior that is being looped in the loop matches the conditions, it will have it's mana deducted by 10.

"(Integer A)", in this case, refers to each Warrior array index. It works sort of the same way as "Picked Unit".
 

Tinki3

Special Member
Reaction score
418
You'll know if its Picked the units or not after they've had their mana deducted :p

They obviously can't have their mana deducted unless they match the conditions, however.

(Notice that I said "They" - "(Integer A)" basically means the same thing, in this case)
 

J3LADE

New Member
Reaction score
7
If 1 of the warriors matches the conditions will it deduct the mana of the others if there are others?

And also the warriors are trained from a tavern, does this effect Integer A in any way? Because does Integer A refer only to whats there at the time or can it be modified like say someone comes in late game and chooses a warrior then when theres already been a warrior from the start of the game, does Integer A include the guy who was trained later in the game?
 

Tinki3

Special Member
Reaction score
418
If 1 of the warriors matches the conditions will it deduct the mana of the others if there are others?
Well, if the other Warrior's current orders were nothing equal to what was filtered in your conditions, then, no.
And also the warriors are trained from a tavern, does this effect Integer A in any way?
Not if Integer A loops up to 8191 times (8191 is the maximum array value a variable can cope with).

You'll need to make sure that each Warrior has its own specific array value, however.
does Integer A refer only to whats there at the time
Yes - It'll only loop through Warrior variables that actually have a value.
can it be modified like say someone comes in late game and chooses a warrior
Yes, it can.
does Integer A include the guy who was trained later in the game?
No, it doesn't.
 

J3LADE

New Member
Reaction score
7
Quote:
can it be modified like say someone comes in late game and chooses a warrior

Yes, it can.

Quote:
does Integer A include the guy who was trained later in the game?

No, it doesn't.

----------------------------------------------

Those are both the same questions really and they got different answers?!?!?!

My heroes are from a tavern (all of them) so they are not actually in the game at "Map Initialization" so will that effect it? (That's basicly what i'm saying)
 

Tinki3

Special Member
Reaction score
418
My heroes are from a tavern (all of them) so they are not actually in the game at "Map Initialization" so will that effect it? (That's basicly what i'm saying)
That will affect it, yes.

Here's a solution:
Code:
Example
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Index Greater than # of players
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions
                Set Index = (Index + 1)
                Set Warrior[Index] = (Triggering unit)
Remove the condition function to 'unrestrict' the amount of valued Warriors.
 

J3LADE

New Member
Reaction score
7
For some reason: (Current order of Warrior[(Integer A)]) Equal to (Order(move)) is not responding to decrease the warriors mana when "stop" and "hold ground" are working. (I haven't tried patrol yet)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top