The author had "In order to change the Zealot's ability from Charge to Blink, I would call: CatalogFieldValueSet (c_gameCatalogUnit, "Zealot", "AbilArray[5].Link, 1, "Blink");" I changed the Zealot to a DarkTemplar.
However, I tried this and I got an error that says "ErrorCatalogFieldNotWritten" Does anyone else have this problem with this trigger?
"ErrorCatalogFieldNotWritten" simply means that the field path is not correct. Since the field path of ""AbilArray[4].Link" is actually correct the problem can only be due to one reason: the catalog function is meant to change an existing value. So, if the Dark Templar doesn't have a 5th ([4] = the 5th ability) there is nothing to change, right?
Try placing a dummy ability for the unit in that position, then the dummy ability would be turned into the "Blink" ability when your trigger worked.
Ahh, you're right. I didn't actually try it out myself, until now, I just knew that the format was correct. However, after actually trying it myself I see that everything works fine- you can perform the test yourself by printing the contents of that field in a message to show it's validity.
Then, I just looked at the link you provided and found this: "I'm sure you can only change what you can change through upgrades.". So basically, you can't change the ability list in this way during run time. This method would only be good for changing contents in some fields, while allowing you access to check the contents of other fields.
You're going to need a different method for this work, adding the blink ability and simply adding a requirement would be a good method. It kind of makes sense, I mean if you were able change this during the mid-cast of an ability you would totally screw the game.
The easiest way to add/remove abilities is to add all of the abilities to the unit, and then show/hide specific ones. There is a limit to 32 abilities this way though. Which makes for about 28 usable abilities (stop, walk, attack, learn, ect take up ability slots). If you need to pass the 32 limit, the best thing to do would to make 2 similar abilities out of the same one, and just use requirements the launch the correct events.
Hey guys, based on this documentation http://www.sc2mapster.com/forums/resources/tutorials/1250-triggers-catalog-field-value-get-set/,
The author had "In order to change the Zealot's ability from Charge to Blink, I would call: CatalogFieldValueSet (c_gameCatalogUnit, "Zealot", "AbilArray[5].Link, 1, "Blink");" I changed the Zealot to a DarkTemplar.
However, I tried this and I got an error that says "ErrorCatalogFieldNotWritten" Does anyone else have this problem with this trigger?
Thanks
@onslaughtbear: Go
"ErrorCatalogFieldNotWritten" simply means that the field path is not correct. Since the field path of ""AbilArray[4].Link" is actually correct the problem can only be due to one reason: the catalog function is meant to change an existing value. So, if the Dark Templar doesn't have a 5th ([4] = the 5th ability) there is nothing to change, right?
Try placing a dummy ability for the unit in that position, then the dummy ability would be turned into the "Blink" ability when your trigger worked.
Good luck!
I thought about that as well, so I went to check the DT's ability at the 5th array.
So I am quite sure that this isn't the issue here.
@onslaughtbear: Go
Ahh, you're right. I didn't actually try it out myself, until now, I just knew that the format was correct. However, after actually trying it myself I see that everything works fine- you can perform the test yourself by printing the contents of that field in a message to show it's validity.
Then, I just looked at the link you provided and found this: "I'm sure you can only change what you can change through upgrades.". So basically, you can't change the ability list in this way during run time. This method would only be good for changing contents in some fields, while allowing you access to check the contents of other fields.
You're going to need a different method for this work, adding the blink ability and simply adding a requirement would be a good method. It kind of makes sense, I mean if you were able change this during the mid-cast of an ability you would totally screw the game.
Sadly, yea. Thanks for the reply. I just assumed that it works since the author provided it and I didn't really read the other posts. My bad there.
Btw, how do you print the contents of the field to show its validity?
UI - Display Message ( Convert String To Text ( Catalog Field Value Get(...)))
There are several different error messages for the catalog system, I currently can't remember the others but:
The easiest way to add/remove abilities is to add all of the abilities to the unit, and then show/hide specific ones. There is a limit to 32 abilities this way though. Which makes for about 28 usable abilities (stop, walk, attack, learn, ect take up ability slots). If you need to pass the 32 limit, the best thing to do would to make 2 similar abilities out of the same one, and just use requirements the launch the correct events.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418