Skill choosing trouble

Ah, didn't see that XD Thanks.

Ok, So I'm using Cheese as dummy items for the skills, just with different icons and custom names. Do I used "chee" for the item or the actual custom name?
 
If you press CTRL+D, you can see the item/ability codes.

You'll need a different code for each item though.
 
Ok, my only 2 problems now are
-Line 149: Invalid argument type (integer)
call UnitAddAbility(Hero, 'AHbh')

Sadly the ability I am using has no number, just those 4 letters.

The other problem is with the custom script it says
-Line 148: Expect a function name
call example(GetTriggeringUnit())

Not sure if that one was addressed about and I just missed it :p
 
JASS -
function BashAbility takes unit Hero returns nothing
call UnitRemoveItem(Hero, 'I000')
call UnitAddAbility(Hero, 'AHbh')
endfunctionEvents

GUI-
Events
Unit - A unit enters LeaveSkills <gen>
Conditions
Actions
Custom script: call example(GetTriggeringUnit())

I'm off to work, Hopefully we can get this all worked out when I'm back. Thanks for all your help and dedication =D
 
Is there actually "Events" after "endfunction"?

Also, your function is called "BashAbility", but you try to call "example".
You need to call "BashAbility":
Code:
Custom script:    call BashAbility(GetTriggerUnit())

Also, I know you're not done, but you need to check what item the hero has to determine what function to call.

if item slot 1 = Bash then
call BashAbility(GetTriggerUnit())
elseif item slot 1 = Cleave then
call CleaveAbility(GetTriggerUnit())
elseif...


And also, it's "GetTriggerUnit()".
My bad :p
 
Ok, lets see here...So what I have now in JASS is...

Code:
function BashAbility takes unit Hero returns nothing
    call UnitRemoveItem(Hero, 'I000')
    call UnitAddAbility(Hero, 'AHbh')
endfunction
if item slot 1 = Bash then
call BashAbility(GetTriggerUnit())
elseif item slot 1 = Cleave then
call CleaveAbility(GetTriggerUnit())
elseif...

and the custom script says

Code:
call BashAbility(GetTriggerUnit())
 
The if's are in the GUI trigger.
The JASS trigger are only for the code 'function' to 'endfunction'.
 
OH, that makes more sense...I was kinda confused why it wasn't working XD
Give me a few min to fix this and I'll get back to you.
 
Sorry for the long reply, had a busy day.

I can't seem to get that trigger set up in GUI, can you post it so I see what it looks like?
 
Trigger:
  • ItemToAbility
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to BashItem
            • Then - Actions
              • Custom script: call BashAbility(GetTriggerUnit(), bj_forLoopAIndex)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to VampItem
                • Then - Actions
                  • Custom script: call VampAbility(GetTriggerUnit(), bj_forLoopAIndex)
                • Else - Actions
                  • &lt;...&gt;

JASS:
function BashAbility takes unit t, integer i returns nothing
    call UnitRemoveItemFromSlot(t, i)
    call UnitAddAbility(t, i)
endfunction

function VampAbility takes unit t, integer i returns nothing
    call UnitRemoveItemFromSlot(t, i)
    call UnitAddAbility(t, i)
endfunction

It can't call the function from the GUI trigger for some reason.
Try making a post asking about that, unless I can figure it out.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top