+1% mana per unit (make sense?)

Epicurus

New Member
Reaction score
1
I want the triggering unit to get +1 Percent mana per unit it saves, but I couldn't find a add mana. There was only a set mana, so I came up with this. Does it make sense?

Trigger:
  • Unit Group - Pick every unit in (Units in secondary death 01 02 <gen> owned by Player 10 (Light Blue)) and do (Actions)
    • Loop - Actions
      • Unit - Create 1 Civilian (Male 2) for Player 10 (Light Blue) at (Random point in Civil creation 01 <gen>) facing Default building facing degrees
      • Unit - Set mana of (Triggering unit) to ((Percentage mana of (Triggering unit)) + 1.00)%
      • Unit - Remove (Picked unit) from the game
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Unfortunately, to add 1% is a bit out there. You'd have to create abilities to add mana to the hero about as many as times as you think your heroes have mana. Say 1-2000?
 

Exide

I am amazingly focused right now!
Reaction score
448
What do you mean 'per unit it saves'?
Your trigger leaks.

You want to add 1% of maximum mana to a certain unit, when "A unit is saved"?
 

Epicurus

New Member
Reaction score
1
Well would +x mana rather than percent be easier?

And, what do you mean by leak?

Heres the full trigger, maybe that will make "Unit saved" more clear.

Trigger:
  • Save01
    • Events
      • Unit - A unit enters secondary death 01 02 <gen>
    • Conditions
      • ((Item carried by (Triggering unit) of type Reanimation Device) is owned) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Reanimation Device)
      • Hero - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) experience to (Triggering unit), Hide level-up graphics
      • Player - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 10) to (Owner of (Triggering unit)) Current gold
      • Player - Add ((Integer((Real((Number of units in (Units in secondary death 01 <gen> owned by Player 10 (Light Blue))))))) x 1) to (Owner of (Triggering unit)) Current lumber
      • Unit Group - Pick every unit in (Units in secondary death 01 02 <gen> owned by Player 10 (Light Blue)) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Civilian (Male 2) for Player 10 (Light Blue) at (Random point in Civil creation 01 <gen>) facing Default building facing degrees
          • Unit - Set mana of (Triggering unit) to ((Percentage mana of (Triggering unit)) + 1.00)%
          • Unit - Remove (Picked unit) from the game
 

Exide

I am amazingly focused right now!
Reaction score
448
Leaks cause lag. We don't want that.
Your trigger leaks unit groups and point leaks.

You should rewrite your trigger like this:

Code:
Save01 
Events 
Unit - A unit enters secondary death 01 02 <gen> 
Conditions 
((Item carried by (Triggering unit) of type Reanimation Device) is owned) Equal to True 
((Triggering unit) is A Hero) Equal to True 
((Owner of (Triggering unit)) controller) Equal to User 
Actions
[B]set tempgroup = Units in (secondary death 01 02 <gen> owned by Player 10 (Light Blue)))[/B] 
Item - Remove (Item carried by (Triggering unit) of type Reanimation Device) 
Hero - Add ((Integer((Real((Number of units in [B]tempgroup[/B] x 10) experience to (Triggering unit), [B]Show[/B] level-up graphics 
Player - Add ((Integer((Real((Number of units in [B]tempgroup[/B] x 10) to (Owner of (Triggering unit)) Current gold 
Player - Add ((Integer((Real((Number of units in [B]tempgroup[/B] x 1) to (Owner of (Triggering unit)) Current lumber 
Unit Group - Pick every unit in [B]tempgroup[/B] and do (Actions) 
Loop - Actions
[I]set temppoint = (Random point in Civil creation 01 <gen>)[/I]
Unit - Create 1 Civilian (Male 2) for Player 10 (Light Blue) at [I]temppoint[/I] facing Default building facing degrees
custom script  call RemoveLocation(udg_temppoint) 
Unit - Set mana of (Triggering unit) to ((Percentage mana of (Triggering unit)) + 1.00)% 
Unit - Remove (Picked unit) from the game

>would +x mana rather than percent be easier?
-Yes.


EDIT: More information on memory leaks can be found here:
http://www.thehelper.net/forums/showthread.php?t=27219
 

Epicurus

New Member
Reaction score
1
Ok, thanks. Does this work for the +mana?

Trigger:
  • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 1.00)
 

Exide

I am amazingly focused right now!
Reaction score
448
No, that just increases the current mana of the unit (not the maximum mana).
You should create an ability based of an item ability that increases maximum mana of the unit by X (for example 10) - then give this to the Hero.
(I don't have WE with me atm, so I'm not sure what item ability you should use, or if there even is one - but I'm sure you'll find it if you search.)
 

Epicurus

New Member
Reaction score
1
Oh sorry, I wanted to increase current mana. I'm using it to replace most mana regen. :)

Don't you have to destroy the temp group too? I'm already reading.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Then that trigger works perfectly. Aside from leaks.
 

Exide

I am amazingly focused right now!
Reaction score
448
Oh sorry, I wanted to increase current mana. I'm using it to replace most mana regen. :)

Don't you have to destroy the temp group too? I'm already reading.

If you want to increase current mana (like drinking a mana potion) then your trigger will work fine.

Yes, of course, my bad. :eek:
Yes, you have to call DestroyGroup(udg_tempgroup)
 

Epicurus

New Member
Reaction score
1
Just wondering if this looks right. I added numbers to the temp locations and groups because I have multiple areas on the map where this happens and I don't know if it would cause problems to use 1 temp---- for everything.

Trigger:
  • Save01
    • Events
      • Unit - A unit enters secondary death 01 02 &lt;gen&gt;
    • Conditions
      • ((Item carried by (Triggering unit) of type Reanimation Device) is owned) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Set Tempgroup_S01 = (Units in secondary death 01 02 &lt;gen&gt; owned by Player 10 (Light Blue))
      • Item - Remove (Item carried by (Triggering unit) of type Reanimation Device)
      • Hero - Add ((Integer((Real((Number of units in Tempgroup_S01))))) x 10) experience to (Triggering unit), Show level-up graphics
      • Player - Add ((Integer((Real((Number of units in Tempgroup_S01))))) x 10) to (Owner of (Triggering unit)) Current gold
      • Player - Add ((Integer((Real((Number of units in Tempgroup_S01))))) x 1) to (Owner of (Triggering unit)) Current lumber
      • Unit Group - Pick every unit in Tempgroup_S01 and do (Actions)
        • Loop - Actions
          • Set Temppoint_C01 = (Random point in Civil creation 01 &lt;gen&gt;)
          • Unit - Create 1 Civilian (Male 2) for Player 10 (Light Blue) at Temppoint_C01 facing Default building facing degrees
          • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 1.00)
          • Unit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup (udg_Temppoint_C01)
      • Custom script: call DestroyGroup (udg_Tempgroup_S01)
 

Genkora

Frog blast the vent core!
Reaction score
92
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 1.00)

that won't give it 1% mana though, just 1 mana. It should be ((Mana of (Triggering unit)) + ((Mana of (Triggering unit) x .01)

that will give 1%

edit- sorry, I didn't realize you meant to change that at the time of my post
 
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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top