Adding abilities to units idea/help/lost&scared

Level 7
Joined
May 15, 2009
Messages
168
I absolutely must overcome this "ability cap". It is going to happen.

My idea, can it work?
So, I want a hero who can learn, say, any 4 out of 100 skills. Clearly this exceeds what you are allowed to add to your hero and enable.

I have read a lot about this "catalog" thing, and it confuses the bajezus out of me. However, with it, I should technically be able to change buttons on my command card, correct? So, for each ability, I can simply make 2 dummy abilities; 1 for target spells and 1 for no-target spells. Then, based on whatever skill I pick, create an icon for that spell and change the energy cost, then link it to the dummy ability. When I cast the dummy ability, based on the button I was given, I can create a dummy unit who already knows the ability, and have him cast the spell.

Is the above possible? am I missing something? I have read the tutorial on catalogs, and am unable to connect the dots. If the above is possible could someone just show me a picture of, in GIU, the line for adding a button to a command card; and if you are feeling really nice, the line for changing the cost of an ability.

^^I learn best through seeing and attempting to recreate. thanks for any help that can be offered.


***Editttttt
I was just stuck with genious for a second.

Taking Catalogs out of the equation... Is there a limit to the number of buttons I can have on a command card? Could I say make 100 buttons, and add them to a single spot on my command card; then just enable 1 of them based on the ability picked. I could still with triggers create a dummy unit when the ability is cast based on the skill I picked earlier.

Anyone, anyone? did I just cure cancer? Though I am sure I am 1 of the 2 people who may view this as important as the cure for cancer...
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
I have read a lot about this "catalog" thing, and it confuses the bajezus out of me. However, with it, I should technically be able to change buttons on my command card, correct?
If you can change them via upgrades then catalogs can do it. If not then you are out of luck.

What you need to do has 2 systems.
1. The learn system
2. The cast system

The learn system changes the button catalog entry for one of the dummy abilities and sets up everything needed by system 2.
The cast system detects when a dummy ability is cast and then starts an effect chain for the appropiate ability you wanted to be cast by looking up which dummy was cast and then getting the effect chain (the virtual ability) it is mapped to.

I do not think it is possible to MUI this, only PUI.
 
Level 9
Joined
Dec 21, 2006
Messages
490
just an idea( i didn't try this yet)
you could create one target ability with a set effect. then add the effecttree of your skills to the set and validate them with a behavior. so you will need 100 different buffs, one for each ability. when that certain ability is learnt, add the buff and the target ability set effect should cast the right one.
i know you cannot add 100 different effects to the set effect but you could lower the number of abilities by the number of effects that can be put into set effect ( or trigger effect).
would be perfect if one ability would exclude another, those could be grouped together.
the cost and cd and icon can be set by trigger with catalog.

another thing you could use the levels of the ability to group abilities.
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
i know you cannot add 100 different effects to the set effect but you could lower the number of abilities by the number of effects that can be put into set effect ( or trigger effect).
Or you could modify the effect branch via script using the catalog set of natives. Although not all effect scopes allow this there are some which you must use as the base of the chain. Not MUI but PUI atleast.
 
Level 7
Joined
May 15, 2009
Messages
168
Alright, so, I guess I will be learning catalogs then. No matter what tutorials I follow, I always end up with an error. Back to the tutorials boarddddd.

Thanks to both of you for your input. I will post back when I have the framework of a system, if anyone finds this and is wondering what it might look like. I am going to attempt to go by what muahahahaa said; because, well, I am failing at learning catalogs, and it appears to use less. Once I learn them, I might do both, just to see which is more organized behind the scenes.

For the sake of getting my map balanced first; I am gonna use a dummy ability system for now; just to get 30 skills in the game; so people can playtest it. A very simple system, using dummy research buttons on a hero to change the level of abilities on a hero. Then I will work on this system when I dont have pressure from all of the other angles of the game; and can focus better on what I need done.

Thanks again!
 
Level 7
Joined
May 15, 2009
Messages
168
Alright, so, while trying to update the tooptip on a button, in an attempt to learn catalogs, I get this error:

ERRORCATALOGFIELDNOTWRITTEN
CatalogFieldValueSet(c_gameCatalogButton, "SpiritBolt", "CButton_Tooltip", (EventPlayer()), "1")

I attempt to change a button, and get the same error. Really, attempting to change anything gets me an error like this. I have searched a few forums, and it seems as though every single way this function might be useful, it doesn't work in. Anything that might be helpful to change returns an error.

In GUI, does anyone know any way that this action might possibly work? If you link me an XML view/custom text guide, I will have no idea what it is saying, and even though I copy it exactly, it still will not work.



EDIT: I figured this out, yayyy. Trial and error testing out a lot of things; turned out I shouldnt have used the CButton_ value. If anyone else bumps into this problem. I guess I will try the same thing with changing other catalog fields now. Maybe this can help someone who only knows GUI. I know, we are a terrible group of undereducated...
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
This is the scope. Obviously it will not be part of the field.

You use "." to get sub fields in the case of a compound field.
X.Y will get sub field Y from structre X.
you then use "[n]" where n is a number to get values from a list.
X.Y[n] will get sub field Y element n from structre X.

I created a test system to auto detect all the elements in a certain field. I found a bug where flags are stored as bits in a 32 bit (long) while only using a fraction of that (like 8 flag elements). The result is that the field size detection from the scope will tell you there are 32 elements when there is not.
 
Level 7
Joined
May 15, 2009
Messages
168
What I have working:

Catalog - Set value of Effects "SpiritBoltDamage1" "Amount" for player (Triggering player) to (String((((Real(Offensive Level[(Triggering player)])) * 50.0) + 50.0)) with Any Precision decimal places)

Catalog - Set value of Effects "LivingShield" "VitalArray[Life].Change" for player (Triggering player) to (String((((Real(Offensive Level[(Triggering player)])) * 2.0) + 1.0)) with Any Precision decimal places)

^^That updates the effects of abilities, so that the tooltips will also update. Easier than making different buttons and effects for every level of an ability; I think.

I have also found, as said above, that I cannot swap out abilities with a catalog;

Catalog - Set value of Units "WhoDaLisk" "AbilArray[4].Link" for player (Triggering player) to "LivingShield"

Returns an error.

Or you could modify the effect branch via script using the catalog set of natives. Although not all effect scopes allow this there are some which you must use as the base of the chain. Not MUI but PUI atleast.

I don't fully understand all of the terms in that. If I were to use a catalog, and simply change the first (and only) effect for the ability to one of a similar type (target point, say) then the ability "should" launch the switched one? So then I would only have to change the icon and tooptip on the button for your ability, along with the mana cost/cooldown; and no one would ever know it was the same ability being shot. Is that about right?
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
Some effect scopes allow you to change the effect links using the catalog editing natives. As such you can change the chain of effects executed by an ability. You can also edit the button icon and tooltips using effects to change them to match the loaded effect chain for an ability.

You can not change the effect chain directly from the ability but you can change the effect chain from a link in the effect chain in an ability. Be aware that you will need to find the appropiate chain link to change as not all effect scopes allow you to modify ability links.
 
Level 7
Joined
May 15, 2009
Messages
168
I will keep updating my progress here, in case anyone like me comes upon this thread...

Rather than using the Hero-Learn (learnable skills) method, which caps at 20 learnable abilities; I went with Research instead. It allows me to trigger ability level increases; without having to use dummy abilities that would take up my valuable "ability" cap.

I then use dialog boxes which display the skills you can pick from. A much easier way would be to use shops with items in them, or research upgrades; then triggering off that. Dialogs look much nicer, imo. When a player picks an ability from the dialog it saves the ability in a game link-ability variable array (Took me forever to find this, it is NOT ability command). So, every ability is saved for every player. Based on the number of abilities, you will need a number of arrays; I use 4.

Then I use a catalog to change my dummy research button (The one I use to increase the level of abilities):

Catalog - Set value of Buttons "LevelSkill1" "Tooltip" for player (Triggering player) to (Value of Buttons (String(Hero Skill1_Variable[(Triggering player)])) "Tooltip" for player (Triggering player))


I change the tooltip and name of the button to match whatever offensive skill was picked. the icon, sadly, cannot be changed.

Hope this helps anyone who isn't great with the editor and looking to do something similar to what I am.

I will be attempting the above idea in the near future; once I come close to capping on abilities.
 
Level 7
Joined
May 15, 2009
Messages
168
alright, so making some decent progress over the past few days; I have hit an annoying wall... I cannot for the sake of my life get this field value to work properly...

Here is what the behavior looks like in the imports file:

<CBehaviorBuff id="DefensiveMatrix">
- <InfoIcon value="Assets\Textures\btn-ability-protoss-voidprison.dds"/>
- <EditorCategories value="AbilityorEffectType:Units"/>
- <RemoveValidatorArray index="0" removed="1"/>
- <Duration value="30"/>
- <Modification>
- - <VitalMaxArray index="Shields" value="60"/>
- </Modification>
</CBehaviorBuff>


What I want to link to is the vital maxarray shields value.


Catalog - Set value of Behaviors "DefensiveMatrix" "Modification.VitalMaxArray[Shields]" for player (Triggering player) to 1

that returns an error; saying invalid field.

Can anyone offer a solution?

****EDIT****
On a hunch I made up a little debug thingy;
UI - Display (Text((Value of Behaviors "DefensiveMatrix" "Modification.VitalMaxArray[Shields]" for player (Triggering player)))) for (Player group((Triggering player))) to Subtitle area


It will run that, telling me what the current value of the field is. I cannot however change the field value of a behavior? In the tutorial http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-658/catalog-functions-178518/ it mentions nothing about that. Seems really silly that you cannot change the value of behaviors... stupid... system...
 
Last edited:

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
It will run that, telling me what the current value of the field is. I cannot however change the field value of a behavior? In the tutorial Catalog Functions it mentions nothing about that. Seems really silly that you cannot change the value of behaviors... stupid... system...

The reason I believe is due to optimizations inside the internal engine being very had to change (they are computed once and can not be destroyed and recomputed). Last I heard the catalog change natives had the same scope of fields as upgrade changes.
 
Level 7
Joined
May 15, 2009
Messages
168
New question then... Is there a way to do math with global variables in a data reference? sayyy, a tooltip? (variable[player(owner of unit with this ability)] * 40)

Dynamic tooltips are important for any game; and the main reason I haven't been triggering all of my abilities is that I cant find a way to reference what they do in a tooltip.
 
Level 7
Joined
May 15, 2009
Messages
168
I can change tooltips; I have been doing that well. My problem is creating a changing tooptip that changes as an ability changes. I can link any part of an ability into the tooltip with a data reference; and as the data reference (damage) changes, it will automatically update on the tooltip. However, if I were to trigger damage dealt to a unit, say "cause X unit to deal 45 damage to picked unit of type spell" I could not then have a tooltip that updates the damage value as the skill is leveled, as there is no data reference to... reference.
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
Yes but as it is script you can just directly use the memory location of the variable as a reference. Ofcourse you will have to type cast it to text (which may need an intermitent cast to string) before it is useful. No more different from how you describe you are doing it currently (using script to look up data enteries and generating a modified tooltip and then using the catalog natives to change the button) except instead of looking up data, you are just getting the value of a variable.
 
Level 7
Joined
May 15, 2009
Messages
168
the problem though is that I do not know how to check a part of an array to match a player in a tooltip.

I can display a variable; sure. Abilities are MPI, so when 1 player increases the level of an ability, I need to chance only his tooltip to what the damage of his ability is. (triggering player) doesnt mean anything when reading a tooltip; is what it comes down to...

To work around this, what I have been doing, is just creating every level of the ability (which is much more time consuming) and then making a dummy ability and triggering a change to a value field, which I link to a tooltip. Overall, this is about 5X longer than simply changing a value with catalogs... About 20X longer than using the WC3 editor... Silly "Can do anything" galaxy editor...
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
About 20X longer than using the WC3 editor
Next to the fact it was impossible to do in WC3...

(triggering player) doesnt mean anything when reading a tooltip
Yes but when you increase the ability level you update the tooltip using a piece of script. The same formula that calculates the effect can then be used in the tooltip.
 
Level 7
Joined
May 15, 2009
Messages
168
in the wc3 editor, you could simply make a levelable ability and a tooltip for each level. You could also make a completely custom ability, and still set the values to the tooltip on the dummy ability. triggering your own ability with a dummy ability is much easier than having to do all of this simply to get a dynamic tooltip.

Yes but when you increase the ability level you update the tooltip using a piece of script. The same formula that calculates the effect can then be used in the tooltip.
"Ummm what?" is the best I can offer. What piece of script is used to update a tooltip? The same formula cannot be used in a data reference in a tooltip because the formula used to update the "damage" of an ability is based on array[triggering player] which means nothing in a tooltip; as there is no array[owner of this unit with this ability]

edit: are you suggesting that I run a trigger to change the tooltip manuallly? Like, run an if/then for every ability in the game, and change the tooltips like that? because loops in loops in loops are not a good idea; and there is no reason at all why there should be THAT much legwork to make a tooltip that reflects an abilities value.
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
edit: are you suggesting that I run a trigger to change the tooltip manuallly? Like, run an if/then for every ability in the game, and change the tooltips like that? because loops in loops in loops are not a good idea; and there is no reason at all why there should be THAT much legwork to make a tooltip that reflects an abilities value.
You only do this for scripted abilities, as this provides you access to the array values like you want.
 
Level 7
Joined
May 15, 2009
Messages
168
Scripted abilities where I can change say the "damage" of an ability, will update on their own with a simple data reference in the tooltip.

If I have 6 levels on an ability, a data reference can only reference 1 of the levels; so as I increase it, the tooltip stays the same. That is the problem I am having. Abilities that I make levels for; just the opposite of the "only scripted"
 
Level 7
Joined
May 15, 2009
Messages
168
alright doctor, having finally overcome/come to terms with tooltip problems, I bumped into a new problem.. that is even more frustrating...

As a I level an ability, the tooltip changes to a completely different tooltip.

Level 1 tooltip will be what it is intended to be. I increase the level, and the tooltip changes to a completely different tooltip. A dummy tooltip I created on an unused button. I use a catalog to change a dummy learn ability tooltip into the dummy ability tooltip.

Any idea why it would be changing my actual skill tooltip to that of a dummy tooltip? I checked all of my triggers, and even tried changing the ID of my true ability tooltip to gibberish. Nothing seems to be working.

EDIT************

Though I have no idea what was causing the problem, once again, I figured out a work around. An answer to this problem would be nice; but I will once again let it fall to "Blizzard is a baddy"
 
Last edited:
Level 7
Joined
May 15, 2009
Messages
168
i change the catalog field value of a button tooltip to the value of a different one? what is not to get?

Button,DummyButton,"tooltip"
I get the value of 1 tooltip, and set it to another tooltip.

Do I really have to say "I used a catalog field value change"? for you to understand what I am suggesting? This whole thread is about changing data with catalog functions. The ACTION in the editor is under the field "CATALOG".

No idea on what could be causing the tooltip part of a button to change upon skill leveling?
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
Do I really have to say "I used a catalog field value change"? for you to understand what I am suggesting? This whole thread is about changing data with catalog functions. The ACTION in the editor is under the field "CATALOG".

I learnt them directly via Galaxy script so do not know of their GUI names. There you have catalogs which are the parent containers for all data of the same type (like the units catalog or the actors catalog). Catalogs define one or more scopes which are the various super types of all data that can be declared within a certain catalog. Scopes define fields for which data can be declared. Enteries are always of a certain scope and declare specific data that are unrelated from each other. You can even see these termonologies in the errors the game throws at you for incorrect data / script usage.

Try turning off your script to see if the tooltips still change. It might be a hard to detect logic mistake in your tooltip changing script itself causing this. These are very easy to make and everyone who ever does scripting or programming will make tons of them at times.
 
Last edited:
Level 7
Joined
May 15, 2009
Messages
168
it is my script that allows for levels to be increased on abilities. I increase the levels via a research command, opposed to learn command.

What I think was happen was, it was searching for the button ID that matched with the skill.

Say I was leveling the ability "Stimpack" with ID "Stimpack" when I leveled it, it was changing the tooltip to what the tooltip for button ID "Stimpack" had on it; rather than a different tooltip which I assigned to the ability.

The reason my "dummy" button had the ID "Stimpack" was because I used a catalogfieldvalueset to set the tooltip of my dummy research button based on what ability was picked for a unit.

What I did to fix it, was I set my dummy to combine the string of the tooltip (from a catalogfieldvalueget) and 2. So if I were to pick ability ID "Stimpack" it would set the dummy research ability to button ID "Stimpack2" and I set the actual ability button ID to "Stimpack"

It works perfectly now. It is just strange that the game would attempt change something I had already set to a different value. I'm sure it is a problem that no one but me will ever have to run into though; easy for blizzard to overlook.
 
Level 7
Joined
May 15, 2009
Messages
168
If you can change them via upgrades then catalogs can do it. If not then you are out of luck.

What you need to do has 2 systems.
1. The learn system
2. The cast system

The learn system changes the button catalog entry for one of the dummy abilities and sets up everything needed by system 2.
The cast system detects when a dummy ability is cast and then starts an effect chain for the appropiate ability you wanted to be cast by looking up which dummy was cast and then getting the effect chain (the virtual ability) it is mapped to.

I do not think it is possible to MUI this, only PUI.

I spent a good deal of time learning the SC2 editor, and actually understand this now.

Problem though... a big problem...

How would I be able to set the energy cost and cooldown of abilities using this method? Mannually changing the casting units vitals would work on paper; but think about how that would have to look in game; on your ability. No cooldown timer, no energy cost displayed. You cannot change cooldown and mana cost with catalogfieldvalueset.
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
Are you sure natives such as these...
native void UnitAddCooldown (unit inUnit, string inCooldown, fixed inVal);
native fixed UnitGetCooldown (unit inUnit, string inCooldown);
no not work for ability cooldown? Would seem kind of pointless for them to exist if they did not work.

Can you not emulate cost text by storing the icons and costs inside the tooltip text instead of relying on the auto detect?
 
Level 7
Joined
May 15, 2009
Messages
168
Ahh, I was attempting to change it with a set catalog field value; which was returning an error; didnt realize there was another function for them.

I do have to ask though; how would I go about planting the little energy icon in a tooltip? I have never thought of, of heard of doing that before. There are quite a few areas of my map that it could help me a lot also.
 
Top