• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Catalog Ability Addition help?

Status
Not open for further replies.
I made a trigger to add an ability to a unit but it doesn't work, i get an error every time i use it. This is the trigger action i use. (For catalogs)
Catalog - Set value of Units "Swann" "CardLayouts.LayoutButtons[5].AbilCmd" for player 1 to "DefensiveMatrix,Execute"

Also, where does the array go, as I've tried it after each of the parameters but it doesn't work.

Could someone give me a demo map of lets say a high templar getting a working stimpak? i don't care if you have to replace an ability to do it.

Thanks.
 
Level 11
Joined
Aug 1, 2009
Messages
963
Wrote a tutorial about this earlier, :eek:

The specific example you are talking about has two arrays, one after CardLayouts (the command card 0-3) and one after LayoutButtons.

Furthermore, you would also have to have the Defensive Matrix ability added to the list of the units abilities. However, this comes with the inherent problem that you cannot add new entries to catalogs (or fields to arrays), you can only modify pre-existing ones. :(
 
Level 11
Joined
Aug 1, 2009
Messages
963
You might not be able to change the command card layout. Do you have the ability already added to the unit?

Try just doing a Catalog Field Value Get on the same fieldpath and see if it returns you anything or still throws an error.
 
Hmm, it actually works, but i still get the error, any idea what would be causing that?

Edit: No, it doesn't work. Can you give me a demo map of what you used in your tutorial?

Try giving a high templar an ability with a trigger (You can pre add the ability to the unit)

This is the xml
Code:
    <CUnit id="Swann">
        <LifeStart value="10"/>
        <LifeMax value="10"/>
        <WeaponArray index="0" Link=""/>
        <WeaponArray index="1" Link=""/>
        <AbilArray index="1" Link="DefensiveMatrix"/>
        <AbilArray index="2" Link="attack"/>
        <AbilArray index="3" Link="move"/>
        <AbilArray Link="CalldownMULE2"/>
        <CardLayouts index="0">
            <LayoutButtons index="5" Face="DefensiveMatrix" AbilCmd="CalldownMULE2,Execute"/>
        </CardLayouts>
        <BehaviorArray index="0" removed="1"/>
    </CUnit>
 
Level 11
Joined
Aug 1, 2009
Messages
963
I didn't actually use Catalog Field Value Set for most of my tutorial because it can be extremely inconsistent, sometimes not working with little apparent reason.

Anyways, tested it myself,

String = (Value of Units "Marine" "CardLayouts[0].LayoutButtons[0].AbilCmd" for player Any Player) <String>

works fine, and shows up properly, while

Catalog - Set value of Units "Marine" "CardLayouts[0].LayoutButtons[0].AbilCmd" for player 1 to "Yamato,Execute"

will throw an error and not do anything.

However, if you want to add abilities, you can try going into the campaign map for "Piercing the Shround" (the bonus mission) and look at how they do it there - they hide abilities, then show them. :eek:
 
Status
Not open for further replies.
Top