World Editor Unlimited Advanced Ability Problem

Undead Me

New Member
Reaction score
5
I was just made the editor of one of my favorite obscure maps, Laosh'Ra's Soulchess, so this week I set about making a new version. The map had been made in WEU which I hadn't used before but I downloaded it and got to work. Things were going pretty well for a while, I did some balancing and made some new abilities, but I ran into trouble with one:

The spell was to be called Enchanted Armor. When activated it gave bonus armor equal to 3% of the caster's max hp. However any time a unit with the Enchanted Armor buff took damage the unit lost 2 mana. If the unit ran out of mana the spell was ended.

The problem I ran into was with the change in armor. I tried to use the advanced trigger unit- change defense. I got all the triggers set up properly, but when I tried to save the map I was told there were now 5 errors in the triggers.

A page appeared with all the triggers in JASS (I'm passably good at JASS but I work with GUI when possible) and it pointed out the 5 lines. Every line was one of the ones that involved changing armor. They all began with "call changearmor." The specific error was called "Error: Expect function" or something like that.

My interpretation of that message is that Editor isn't recognizing "changearmor" as a valid function for some reason. I'm not sure why that would be because elsewhere in the map the original creator used a similar advanced unit- change maximum life with no problems.

Am I missing some obvious step to make an advanced stat change trigger work? Does anyone know another simple way to change armor up and down by a percentage of max life?
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
WEU is notoriously known for its memory leaking GUI triggers and seemingly random crashes. I'd advise you switch.

Anyhow, onto your question. In order to do this you'll have to create an ability with X amount of levels (based off of the max health in your map). Have it gain 1 armor for each level. When the ability is casted on an unit, add the ability, then set it to a level based on the health. For example, a unit with 300 health will get 9 armor.
 

Tyman2007

Ya Rly >.
Reaction score
74
WEU has been known to destroy maps..

Use Jass Newgen. You don't need to know Jass to use it.
 

jjonj

New Member
Reaction score
1
Ive had the same problem, i loved WEU for a long time, but it the advanced triggers dont work anymore.

I needed its ability to grant health and armor aswell for my TD so i looked how WEU made its triggers and copied its system:

Here's the function i made (jass)
It requires global variable TempInt
and abilities copied from item ability that gives armor.
My abilities are 'A01S' which gives +16 armor
'A01W' which gives +8 armor and so on..
You call the function like this in your triggers:
Trigger:
  • Custom script: GiveArmor(5, GetLastCreatedUnit())

to give last created unit 5 armor
JASS:
function GiveArmor takes integer amount, unit WhichUnit returns nothing
    set udg_TempInt = amount
    loop
        exitwhen udg_TempInt == 0
        if udg_TempInt >= 16 then
            set udg_TempInt = udg_TempInt - 16
            call UnitAddAbilityBJ( 'A01S', WhichUnit )
        elseif udg_TempInt >= 8 then
            set udg_TempInt = udg_TempInt - 8
            call UnitAddAbilityBJ( 'A01W', WhichUnit )
        elseif udg_TempInt >= 4 then
            set udg_TempInt = udg_TempInt - 4
            call UnitAddAbilityBJ( 'A01V', WhichUnit )
        elseif udg_TempInt >= 2 then
            set udg_TempInt = udg_TempInt - 2
            call UnitAddAbilityBJ( 'A01U', WhichUnit )
        elseif udg_TempInt >= 1 then
            set udg_TempInt = udg_TempInt - 1
            call UnitAddAbilityBJ( 'A01X', WhichUnit )
        endif
    endloop
endfunction
 

Ayanami

칼리
Reaction score
288
There is another alternative, if you want damage, armor, etc. All you need is 5 abilities based on "Item - Armor Bonus" or "Item - Damage Bonus", depending on what you want. This method supports up to 99999 armor. It can be increased easily if needed.

I'll assume you need armor here.

Create 5 ability, all based on "Item - Armor Bonus". Change it to a unit ability. Set it to have 10 levels. Now, set all the level intervals with interval of ones, starting from 0. Here's an example.

Level 1: 0
Level 2: 1
Level 3: 2
...and so on.

For the next ability, set all the levels with intervals of tens, starting from zero yet again. Here's an example.

Level 1: 0
Level 2: 10
Level 3: 20
...and so on.

Repeat this until you reach your 5th ability, which should look something like this:

Level 1: 0
Level 2: 10000
Level 3: 20000
...and so on.

Now comes the triggering part. It's quite simple actually. Here are the variables that you need.

Variables
ArmorAbility - Ability Array with size of 5
TempReal - Real
TempDivider - Integer
TempInt - Integer
TempUnit - Unit

Now, in map initialization, set your ArmorAbility variables to the armor bonus spells. The highest interval (0, 10000, 20000, ...) should be set as ArmorAbility[1], while the lowest armor interval (0, 1, 2, ...) at ArmorAbility[5].

Trigger:
  • Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ArmorAbility[1] = Armor Bonus (10000's)
      • Set ArmorAbility[2] = Armor Bonus (1000's)
      • Set ArmorAbility[3] = Armor Bonus (100's)
      • Set ArmorAbility[4] = Armor Bonus (10's)
      • Set ArmorAbility[5] = Armor Bonus (1's)


And now, we have to add these abilities when the hero learns the certain spell.

Trigger:
  • Learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to MyAbility
      • (Level of MyAbility for (Triggering unit)) Equal to 1
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Unit - Add ArmorAbility[IntegerA] to (Triggering unit)


When you add these abilities, it should provide 0 bonus armor as they are set to level 1 by default. That's the purpose of having armor bonus of 0 at every level 1. Now here's the armor adding part.

Trigger:
  • Armor Bonus
    • Events
      • <Your Event>
    • Conditions
      • <Your Conditions>
    • Actions
      • Set TempUnit = (Triggering unit) <-- Depends on what your event is
      • Set TempReal = 500.00 <-- Your armor bonus amount
      • Set TempDivider = 10000
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set TempInt = ((Integer(TempReal)) / TempDivider)
          • Unit - Set level of ArmorAbility[(Integer A)] for TempUnit to (TempInt + 1)
          • Set TempReal = (TempReal - (Real((TempInt x TempDivider))))
          • Set TempDivider = (TempDivider / 10)


You will get the exact bonus armor as stated in "Set TempReal" part (except the decimals of course). The armor bonus cap is up to 99999 in this case.

Using JASS would be much easier to accomplish this though, as you won't have to copy this whole chunk of code every time you want to apply bonus armor.
 

Undead Me

New Member
Reaction score
5
Thanks for the great responses everyone, though I think I'll stick with WEU at least until I finish this version.
 
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