Mana Absorb Auto Recast

chiwang

New Member
Reaction score
0
So the premise of my trigger is that I'm adding a 3rd resource Food.

Peasants will be able to "gather" food from Farms by Mana Absorbing the mana of the Farm.

The cooldown of Mana Absorb is 0 seconds and the casting time is 20 seconds. Peasants initially have 0 mana and have a capacity of 10. My trigger aims to have Peasants automatically Mana Absorb a farm after the first manual user-commanded Mana Absorb.

Here is the trigger:

EVENTS:
--------Unit - A unit finishes casting an ability

CONDITIONS:
--------(Ability being cast) Equal to Mana Absorb

ACTIONS:
--------Unit - Set mana of (Casting unit) to 0.00
--------Unit - Order (Casting unit) to Undead Destroyer - Absorb Mana (Target unit of ability being cast)

Basically, the trigger fails because nothing happens after the initial user-commanded Mana Absorb. How can I fix this?

Also, can I get some ideas on how to get my Peasants to return to the nearest town hall after Mana Absorbing?



Thanks everyone for your help :)
 

Ayanami

칼리
Reaction score
288
So the premise of my trigger is that I'm adding a 3rd resource Food.

Peasants will be able to "gather" food from Farms by Mana Absorbing the mana of the Farm.

The cooldown of Mana Absorb is 0 seconds and the casting time is 20 seconds. Peasants initially have 0 mana and have a capacity of 10. My trigger aims to have Peasants automatically Mana Absorb a farm after the first manual user-commanded Mana Absorb.

Here is the trigger:

EVENTS:
--------Unit - A unit finishes casting an ability

CONDITIONS:
--------(Ability being cast) Equal to Mana Absorb

ACTIONS:
--------Unit - Set mana of (Casting unit) to 0.00
--------Unit - Order (Casting unit) to Undead Destroyer - Absorb Mana (Target unit of ability being cast)

Basically, the trigger fails because nothing happens after the initial user-commanded Mana Absorb. How can I fix this?

Also, can I get some ideas on how to get my Peasants to return to the nearest town hall after Mana Absorbing?



Thanks everyone for your help :)

If you use autocast, the trigger won't recognize "Mana Absorb" as an ability when used.
 

chiwang

New Member
Reaction score
0
You mean like Inner Fire/Heal autocast? The skill is Mana Absorb theres no autocast for that, I'm trying to trigger a loop for the skill.
 

chiwang

New Member
Reaction score
0
Basically, the trigger fails because nothing happens after the initial user-commanded Mana Absorb. How can I fix this?

Mana Absorb works fine on the building if you cast it yourself, I just want it to keep recasting after you order a Peasant to Mana Absorb the building.
 

Ayanami

칼리
Reaction score
288
Hmm, then create a periodic trigger that constantly orders the Peasant to cast Mana Absorb? Well, Mana Absorb has a 20 seconds casting time right?
 

chiwang

New Member
Reaction score
0
Ya but is there something wrong with the trigger I have already?

EDIT: Well I mean there IS something wrong :p because it doesn't work :(
Whats wrong with it?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
To start with, copy your trigger directly instead of writing everything by yourself. Just right-click the trigger inside the triggerwindow, just above "Event" and click "Copy as text".
Also change the event to A unit Starts the effect of an ability instead, and change (Casting unit) to (Triggering unit) :D
 

Ayanami

칼리
Reaction score
288
Post all of your triggers using WC3 tags. From there, I will be able to help. But likeKomaqtion said, use Triggering unit.
 

chiwang

New Member
Reaction score
0
Ok Glenphir and Komaqtion, thanks for your help. Revised trigger below:

Trigger:
  • Mana
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Absorb
    • Actions
      • Set Food[(Player number of (Owner of (Triggering unit)))] = (Food[(Player number of (Owner of (Triggering unit)))] + 10)
      • UNIT - SET MANA OF (TRIGGERING UNIT) TO 0.00
      • UNIT - ORDER (TRIGGERING UNIT) TO UNDEAD DESTROYER - ABSORB MANA (TARGET UNIT OF ABILITY BEING CAST)
      • Leaderboard - Change the value for (Owner of (Triggering unit)) in (Leaderboard of (Owner of (Triggering unit))) to Food[(Player number of (Owner of (Triggering unit)))]


However, the Peasant still doesn't do anything after 1 Mana Absorb and also the Peasant's mana doesn't get emptied (basically the capitalized parts don't work). When I used casting unit the Peasant's mana got emptied.
 

chiwang

New Member
Reaction score
0
Sure, thanks for your time.

View attachment legionwars.w3x

So revised trigger:

Trigger:
  • Mana
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Farm
    • Actions
      • Wait 1.00 seconds
      • Set Food[(Player number of (Owner of (Triggering unit)))] = (Food[(Player number of (Owner of (Triggering unit)))] + 10)
      • Unit - Set mana of (Triggering unit) to 0.00
      • Wait 0.50 seconds
      • Unit - Order (Triggering unit) to Undead Destroyer - Absorb Mana (Target unit of ability being cast)
      • Leaderboard - Change the value for (Owner of (Triggering unit)) in (Leaderboard of (Owner of (Triggering unit))) to Food[(Player number of (Owner of (Triggering unit)))]


It seems this line:
Trigger:
  • Unit - Order (Triggering unit) to Undead Destroyer - Absorb Mana (Target unit of ability being cast)

doesn't work, everything else is fine. I think the problem is the "Target unit of ability being cast," since I ordered the Triggering unit to go harvest gold instead of Mana Absorb and it worked. Help?



And also, any ideas on how to get my Peasants to return to the nearest town hall after Mana Absorbing?
 

Squirel

New Member
Reaction score
13
For the return to town hall, you might try modifying the call to arms ability. You might be able to cause it to not create a militia. You'd have to play around with it. That would get the return to town hall but then I don't know how to get the Peasant to return to the farm. You might do that with a variable for the location of the farm. I'm not really sure but I think that that's what you need to mess around with.
 

chiwang

New Member
Reaction score
0
OK, so big update.

After the User orders a Peasant to gather food from a Farm, the Peasant will go into a loop where it will gather food from Farm then return to nearest Town Hall and start all over again.

Trigger:
  • Mana
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to GatherFood
    • Actions
      • Set FarmUnit = (Target unit of ability being cast)
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Human Peasant - Call To Arms
      • Wait until ((Unit-type of (Triggering unit)) Equal to Villager Militia), checking every 1.00 seconds
      • Unit - Order (Triggering unit) to Human Militia - Back To Work
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Undead Destroyer - Absorb Mana FarmUnit
      • Set Food[(Player number of (Owner of (Triggering unit)))] = (Food[(Player number of (Owner of (Triggering unit)))] + 10)
      • Leaderboard - Change the value for (Owner of (Triggering unit)) in (Leaderboard of (Owner of (Triggering unit))) to Food[(Player number of (Owner of (Triggering unit)))]
      • Unit - Set mana of (Triggering unit) to 0.00



However, a single lone problem remains. Lets say there are three Farms that you want to gather food from. So you order 3 Peasants to 3 separate Farms... when the loop kicks in all 3 Peasants will return to only 1 Farm since the UnitFarm variable is only 1 Unit. :banghead: Suggestions?
 

Squirel

New Member
Reaction score
13
Hadn't thought of that. You need an array variable with alot of indexes... You also need to count each time a peasant starts to cast that ability. The index will be related to the number of times that a unit casts that spell. The farm that you're targeting gets stored to that array index... Hard to explain and very complicated. Unless anyone has a better way to do it...
 

chiwang

New Member
Reaction score
0
Ya Squirel I was thinking the same thing but was wondering if there was a better way as well haha. Thanks man for helping though. Same to you, Glenphir and Komaqtion.

Okay, this trigger has been solved! I just gave every Peasant its own custom value and made an unit array Farm(custom value of Peasant).

Trigger:
  • Mana
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Farm
    • Actions
      • Set Farm[(Custom value of (Triggering unit))] = (Target unit of ability being cast)
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Human Peasant - Call To Arms
      • Wait until ((Unit-type of (Triggering unit)) Equal to Villager Militia), checking every 1.00 seconds
      • Unit - Order (Triggering unit) to Human Militia - Back To Work
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Undead Destroyer - Absorb Mana Farm[(Custom value of (Triggering unit))]
      • Set Food[(Player number of (Owner of (Triggering unit)))] = (Food[(Player number of (Owner of (Triggering unit)))] + 10)
      • Leaderboard - Change the value for (Owner of (Triggering unit)) in (Leaderboard of (Owner of (Triggering unit))) to Food[(Player number of (Owner of (Triggering unit)))]
      • Unit - Set mana of (Triggering unit) to 0.00


Thanks again to all those who helped!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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!
  • 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

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top