Would World Editor Unlimited mess with JASS

Terrabull

Veteran Member (Done that)
Reaction score
38
topic
I put a JASS script into my map (specifically blade.dk's maxunitstate) and I know it worked in the demo map, but when it's in my map, it appears to do absolutely nothing.
Is this possibly the problem, or is it probably something else?
 

kingbdogz

The Edge of Eternity is upon us.
Reaction score
123
this could be the problem


We have no idea what the script is therefore no one can figure it out. Did you edit the script to fit in your map? if so then i have no idea lol
 

Terrabull

Veteran Member (Done that)
Reaction score
38
Code:
constant function MaxStateModifierId takes unitstate u returns integer
    if u == UNIT_STATE_MAX_LIFE then
        return 'A000' // Rawcode of the Max Life Modifier ability.
    elseif u == UNIT_STATE_MAX_MANA then
        return 'A001' // Rawcode of the Max Mana Modifier ability.
    endif
    return 0
endfunction

function SetUnitMaxState takes unit whichUnit, unitstate whichUnitState, integer newVal returns boolean
    local integer c = newVal-R2I(GetUnitState(whichUnit, whichUnitState))
    local integer i = MaxStateModifierId(whichUnitState)
    if i == 0 then
        return false
    endif
    if c > 0 then
        loop
            exitwhen c == 0
            call UnitAddAbility(whichUnit, i)
            if c >= 100 then
                set c = c - 100
                call SetUnitAbilityLevel(whichUnit, i, 4)
            elseif c >= 10 then
                set c = c - 10
                call SetUnitAbilityLevel(whichUnit, i, 3)
            else
                set c = c - 1
                call SetUnitAbilityLevel(whichUnit, i, 2)
            endif
            call UnitRemoveAbility(whichUnit, i)
        endloop
    elseif c < 0 then
        set c = -c
        loop
            exitwhen c == 0
            call UnitAddAbility(whichUnit, i)
            if c >= 100 then
                set c = c - 100
                call SetUnitAbilityLevel(whichUnit, i, 7)
            elseif c >= 10 then
                set c = c - 10
                call SetUnitAbilityLevel(whichUnit, i, 6)
            else
                set c = c - 1
                call SetUnitAbilityLevel(whichUnit, i, 5)
            endif
            call UnitRemoveAbility(whichUnit, i)
        endloop
    endif
    return true
endfunction

That is the code I copied in, I changed nothing about it for my map, because it works like it is in the demo map.

Code:
Life
    Events
        Player - Player 1 (Red) types a chat message containing life as A substring
    Conditions
        (Substring((Entered chat string), 1, 4)) Equal to life
    Actions
        Set i = (Integer((Substring((Entered chat string), 5, (Length of (Entered chat string))))))
        Custom script: call SetUnitMaxState(udg_u, UNIT_STATE_MAX_LIFE, udg_i)

I use the last line in my map to call the function, I use nothing else from this map. In my map it looks something like this:

Code:
(setup-code which I don't have memorized and isn't related)
    Set sl = HP
    Set tu2 = (Last Created Unit)
    Custom script: call SetUnitMaxState(udg_tu2, UNIT_STATE_MAX_LIFE, udg_sl)

according to logic it SHOULD work
 

Matemeo

New Member
Reaction score
20
I believe, though I may be completely off-base, as I have no clue about this system. That you need abilities, Max Life Modifier ability, and Max Mana Modifier ability. As A000 (as defined in the system) is usually the first custom ability, and A001 is the second. (hence 000,001), Perhaps you need to read the documentation better, or I could be way off. :) gl

Yell if anything else comes up.

EDIT: And yes, you really should Not use WEU, Newgen world editor (easily findable via search) is a much better Editor overall, even if one does not indulge in the pleasures of being a jass Warrior.

:p
 

Terrabull

Veteran Member (Done that)
Reaction score
38
I'm trying to remove the WEU centric stuff that is forcing me to continue using WEU. I started this project over a year ago and got it tangled to much in WEU to get myself out of it and use another editor easily.
I already have to programs, but for the moment, I'm stuck w/ WEU.
And thank you for your suggestion about checking the custom values, I think that's the problem, because I've made several custom abilities, I hadn't thought of that.

You were right, I'm double checking the documentation and I see now that that's what I didn't do. Thank you!
+rep
 

Matemeo

New Member
Reaction score
20
I'm trying to remove the WEU centric stuff that is forcing me to continue using WEU. I started this project over a year ago and got it tangled to much in WEU to get myself out of it and use another editor easily.
I already have to programs, but for the moment, I'm stuck w/ WEU.
And thank you for your suggestion about checking the custom values, I think that's the problem, because I've made several custom abilities, I hadn't thought of that.

You were right, I'm double checking the documentation and I see now that that's what I didn't do. Thank you!
+rep

No problem, glad I could help. /bow
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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