Did you ever try this program? Its awesome for such things.
Nope. Does it tell me what constants are available for each of the parameter inputs?
I should have elaborated a bit more.
I have no problem finding out the types of the parameters taken by each function. I usually just manually check it at the wiki. But sometimes even knowing the type, you have no idea what kinda input gamelinks or strings or the functions accept, and its through GUI that I find this. One example would be effect creation. I have no idea what the effect constants gamelink strings are, I can only find this out by first manually popping them in GUI, then viewing the generated script.
The fact that theres no autocomplete in the vanilla editor is the reason why I decided to code my own quick functions. I find it extremely tedious to type out the original function names, much less remember them in my head when i want to use them.
Edit: Glad to say everything works just as I'd like it to.
SC2 can only handle a timer period in multiples of 0.0625. For more accurate calculations, you should use this value. Quote:
Good to know, thanks for the information. I'll fix this up when I'm not feeling tired :P Were you running in window mode? or Full screen? It will lag in window mode because of the debugger. When i tried on full screen I had no problem at all. If i spam the spell like 50+ times (using he order queue), the framerate doesn't seem to drop below 50. Running on medium settings here. I noticed framerate drops alot when viewing the stetmans. I really hope there aren't any variables leaking.. If you've skimmed through the code, you might have noticed I use structs (as a ring buffer) to store spell instances and constants. I wonder if this may be the cause.
I won't be removing the GUI so soon as I use it to find out what parameters certain functions can take.
Quote:
Could you elaborate when the malfunction happens? Everything seems to work fine for me.
Basically, the spell values should be 4/6/8/10 and 60/95/130/165. However, sometimes the effect catalog doesn't get updated as of that old version of the map, and i'd have to try cast the spell multiple times before it updates.
Quote:
I was not able to reproduce; your ability never surpassed level 4 for me.
Have you taken a look at the data entry for the ability yet? if you check raw data, the ID should be A001, under cost, there should be only 3 entries as of that version. Despite which, it levels to level 4. This was resolved after I put in the learn ability.
Quote:
Also I was referring to the command index of the learn ability, which you do not use at all.
Haven't touched on this just yet, but i think i have an idea of what you mean. The command index of the second submenu should be 1. Whilst the first is 0. I enquired on this on a thread in the galaxy forum a few days back.
@Kueken531: Go
Okay.. I think I've hit my daily data frustration quota for today. I've been able to clone your example almost entirely except for the fact that my command card is resetting whenever I learn an ability. How do I stop this from happening? *tries very hard to suppress his frustration...*
Will be testing out the learn ability catalog set tomorrow.. Hopefully i won't have that random catalog set failure problem anymore once I shift the code to my spell learn handler..
Sure, I hope it won't intimidate you though =/ It's pretty long and I use a lot of custom functions.
Still mid way working on the learn ability thing. The current trigger that handles spell level ups is
t_SpellHandler. Basically it levels up the spell whenever it's cast, and it's supposed to update the catalog too.
Oh, and if you see any potential ways I can improve my coding, please do let me know.
And uh.. forgive me, its not exactly cleaned up yet.
Edit:
Quote:
The learn ability index can be a little tricky. It seems to be pretty random, which number is used by an ability; if you only have one, it will be most likely 0, but for multiple abilities in the learn ability, the order tends to vary pretty much randomly.
I usually just make a bunch of triggers reacting to each index to manually test for the index ingame.
Thinking back about this.. i did notice something else wierd. Under the abilities cost, you have 5 indexes to represent the number of spells. In my code, I put 4 (Intending to have a 4 level spell) But my ability was jumping to level 5.
I suspect this may be happening as your snipe ability begins unlearned, whilst mine doesn't.. But still.. that doesn't seem logical at all. Anyway.. back to working on the learn ability.
In the end I went with cataloging and the effect amount parameter because I personally feel having to manually edit the tooltips one by one is just too tedious.
Thanks so much Kueken, Your map helped my understanding on this a lot. Theres some wierd stuff though.. When I change stuff in the data editor, it sometimes causes the set catalog value trigger to fail randomly for some unknown reason. It's not clear whether this is trigger or data related. After a few tries it works perfectly as it should though. Urgh.. its happening again. The values aren't updating and there is no error message. It seems to work fine when I remove my "run trigger" function..
Edit: Okay, its not the run trigger function. It's just not updating randomly and not spitting any error messages -_-
-.- damnit Blizzard. Thank you so much for sharing that, it probably saved me from going a little more insane than I already am. I owe you one, i swear this woulda kept me up til pretty late..
After casting the spell 3 times, it should appear as level 0,1,2 not 0,1,3.. I've no idea why it's skipping 2 and i'm pretty damn sure its not caused by the script... FML
Feel free to try it out below.. Just load the map and throw some projectiles.
Not to worry, Galaxy script is fine. I believe you're slightly mistaken:
bool CatalogFieldValueSet ( preset catalog, string entry, string fieldPath, int player, string value )
It takes a player, not a player group.
Quote:
as long as only one instance of the ability is allowed per player (or all instances always have the same level
This is actually what has me stumped. Im working on the assumption that there might be a possibility where 1 player has dupes of the same units, but the instances might not be the same level. It gives the ability more flexibility that way.
By the way, forgot to ask. If I change a catalog value, is it universal? Lets say I use DummyEffectA to store my damage. But when I change the damage with catalog, wouldn't all players be affected by it? If this is so, If two players have the same ability, one has it at level 1, the other at 2, wouldn't the tooltip display incorrectly for one of them?
Edit: Seems it allows catalog setting for individual players. I foresee a problem if the same player has 2 units with the same ability though.
Yeah, parallel processing. The trigger that runs the spell is never created until it is needed. Once the spell is cast, it is created, run, then destroyed. (Case A) If my understanding of how this works is right, this isn't the same as having a trigger that is created and left in the background until it is needed. (Case B)
In case B, if 1000 events fire, the single trigger in the background might not be able to handle it quick enough (that is assuming it runs in a sequential manner). Whereas in Case A, every spell cast means one instance of the trigger is created and run parallel with the rest.
What Keuken says, I believe is probably more accurate.
Quote:
Does the editor actually give you control over how many concurrent threads are run on your processor?
Not too sure about how the editor handles this. I haven't found any function that allows me to do that so far, but who knows, it might exist. Either that or its done automatically.
Edit:
Quote:
And why store the damage in unused fields, when you can just make the tooltip show the damage and change the damage directly via catalogs? This is my current method (the one posted earlier in this thread is out-dated), and it works just fine, not only for damage, but for many other values as well. Tooltips can show the same values catalogs can read and modify, and they show the modified values properly.
I don't suppose you could share a simple example of how this is done by any chance? I'm sort of a reverse engineer, I learn better through practical >_>
Hm.. Heres the raw text for one of the existing campaign abilities
Quote:
Stuns all enemies in a small area. Deals <d ref="Effect,330mmBarrageCannonsPersistent,PeriodCount * Effect,330mmBarrageCannonsDamage,Amount"/> damage over <d ref="Effect,330mmBarrageCannonsPersistent,PeriodCount * Effect,330mmBarrageCannonsPersistent,PeriodicPeriodArray[0]"/> seconds in a larger area.
I'm pretty sure this is the string that performs dynamic damage calculation. If there is some sort of reference I can point to to directly get level with this method, Then it should be possible to avoid having to create a new effect at all. I just need a field or array of sorts it seems.. Will update later, Gonna try this out.
You should be careful when linking triggers with spells. It's not guaranteed that a trigger will fire when it's supposed to if too many events fire at the same time.
I actually coded a spell handler to do this for me. The spell handler just checks the spell thats cast then runs a separate thread to perform the spell. Many events does kinda slow down framerate with the debugger on, but when I tried spamming the ability on full screen, seems to work just fine with no lag despite the insane amount of effects taking place. Its open source so you can get it here.
Catalogs sound like fun. Are they restricted to modifying effect parameters? Or can we mess around with the Ability parameters as well? I'm thinking of using some unused field to store the damage values. I'd like to avoid having to create extra effects where possible (Trying to avoid any unecessary map size increase and keep things optimal.)
Done :) Works exactly as I need it to. Thanks for the help and the offer. Though I don't think I'll be touching on data much :P I mainly need to use it because there is no way to dynamically created buttons/effects (That I know of) through pure script.
@Kueken531: Go
Nope. Does it tell me what constants are available for each of the parameter inputs?
I should have elaborated a bit more. I have no problem finding out the types of the parameters taken by each function. I usually just manually check it at the wiki. But sometimes even knowing the type, you have no idea what kinda input gamelinks or strings or the functions accept, and its through GUI that I find this. One example would be effect creation. I have no idea what the effect constants gamelink strings are, I can only find this out by first manually popping them in GUI, then viewing the generated script.
The fact that theres no autocomplete in the vanilla editor is the reason why I decided to code my own quick functions. I find it extremely tedious to type out the original function names, much less remember them in my head when i want to use them.
Edit: Glad to say everything works just as I'd like it to.
Thanks for the help everyone!
Yeah thats the one, i tried your fix and it works :)
Good to know, thanks for the information. I'll fix this up when I'm not feeling tired :P Were you running in window mode? or Full screen? It will lag in window mode because of the debugger. When i tried on full screen I had no problem at all. If i spam the spell like 50+ times (using he order queue), the framerate doesn't seem to drop below 50. Running on medium settings here. I noticed framerate drops alot when viewing the stetmans. I really hope there aren't any variables leaking.. If you've skimmed through the code, you might have noticed I use structs (as a ring buffer) to store spell instances and constants. I wonder if this may be the cause.
I won't be removing the GUI so soon as I use it to find out what parameters certain functions can take.
Basically, the spell values should be 4/6/8/10 and 60/95/130/165. However, sometimes the effect catalog doesn't get updated as of that old version of the map, and i'd have to try cast the spell multiple times before it updates.
Have you taken a look at the data entry for the ability yet? if you check raw data, the ID should be A001, under cost, there should be only 3 entries as of that version. Despite which, it levels to level 4. This was resolved after I put in the learn ability.
Haven't touched on this just yet, but i think i have an idea of what you mean. The command index of the second submenu should be 1. Whilst the first is 0. I enquired on this on a thread in the galaxy forum a few days back.
@Kueken531: Go Okay.. I think I've hit my daily data frustration quota for today. I've been able to clone your example almost entirely except for the fact that my command card is resetting whenever I learn an ability. How do I stop this from happening? *tries very hard to suppress his frustration...*
Will be testing out the learn ability catalog set tomorrow.. Hopefully i won't have that random catalog set failure problem anymore once I shift the code to my spell learn handler..
@Kueken531: Go
Sure, I hope it won't intimidate you though =/ It's pretty long and I use a lot of custom functions.
Still mid way working on the learn ability thing. The current trigger that handles spell level ups is t_SpellHandler. Basically it levels up the spell whenever it's cast, and it's supposed to update the catalog too.
Oh, and if you see any potential ways I can improve my coding, please do let me know.
And uh.. forgive me, its not exactly cleaned up yet.
Edit:
Thinking back about this.. i did notice something else wierd. Under the abilities cost, you have 5 indexes to represent the number of spells. In my code, I put 4 (Intending to have a 4 level spell) But my ability was jumping to level 5.
I suspect this may be happening as your snipe ability begins unlearned, whilst mine doesn't.. But still.. that doesn't seem logical at all. Anyway.. back to working on the learn ability.
@Kueken531: Go
In the end I went with cataloging and the effect amount parameter because I personally feel having to manually edit the tooltips one by one is just too tedious.
Thanks so much Kueken, Your map helped my understanding on this a lot. Theres some wierd stuff though.. When I change stuff in the data editor, it sometimes causes the set catalog value trigger to fail randomly for some unknown reason. It's not clear whether this is trigger or data related.
After a few tries it works perfectly as it should though.Urgh.. its happening again. The values aren't updating and there is no error message. It seems to work fine when I remove my "run trigger" function..Edit: Okay, its not the run trigger function. It's just not updating randomly and not spitting any error messages -_-
@Vexal: Go
-.- damnit Blizzard. Thank you so much for sharing that, it probably saved me from going a little more insane than I already am. I owe you one, i swear this woulda kept me up til pretty late..
@Kueken531: Go
Thanks! :) Will take a look at this after I get some rest. Almost midnight here
@VoidPotato: Go
I'll probably be going with this method.. I've got a really strange problem that wasn't a problem before now..
My debugger output:
I'm using this to set the ability level. This line of code occurs only once and executes whenever the spell is cast.
After casting the spell 3 times, it should appear as level 0,1,2 not 0,1,3.. I've no idea why it's skipping 2 and i'm pretty damn sure its not caused by the script... FML
Feel free to try it out below.. Just load the map and throw some projectiles.
@Kueken531: Go
Not to worry, Galaxy script is fine. I believe you're slightly mistaken:
bool CatalogFieldValueSet ( preset catalog, string entry, string fieldPath, int player, string value )
It takes a player, not a player group.
This is actually what has me stumped. Im working on the assumption that there might be a possibility where 1 player has dupes of the same units, but the instances might not be the same level. It gives the ability more flexibility that way.
@Kueken531: Go
By the way, forgot to ask. If I change a catalog value, is it universal? Lets say I use DummyEffectA to store my damage. But when I change the damage with catalog, wouldn't all players be affected by it? If this is so, If two players have the same ability, one has it at level 1, the other at 2, wouldn't the tooltip display incorrectly for one of them?
Edit: Seems it allows catalog setting for individual players. I foresee a problem if the same player has 2 units with the same ability though.
@Vexal: Go
Yeah, parallel processing. The trigger that runs the spell is never created until it is needed. Once the spell is cast, it is created, run, then destroyed. (Case A) If my understanding of how this works is right, this isn't the same as having a trigger that is created and left in the background until it is needed. (Case B)In case B, if 1000 events fire, the single trigger in the background might not be able to handle it quick enough (that is assuming it runs in a sequential manner). Whereas in Case A, every spell cast means one instance of the trigger is created and run parallel with the rest.What Keuken says, I believe is probably more accurate.
Not too sure about how the editor handles this. I haven't found any function that allows me to do that so far, but who knows, it might exist. Either that or its done automatically.
Edit:
I don't suppose you could share a simple example of how this is done by any chance? I'm sort of a reverse engineer, I learn better through practical >_>
@TheAlmaity: Go
Hm.. Heres the raw text for one of the existing campaign abilities
I'm pretty sure this is the string that performs dynamic damage calculation. If there is some sort of reference I can point to to directly get level with this method, Then it should be possible to avoid having to create a new effect at all. I just need a field or array of sorts it seems.. Will update later, Gonna try this out.
I actually coded a spell handler to do this for me. The spell handler just checks the spell thats cast then runs a separate thread to perform the spell. Many events does kinda slow down framerate with the debugger on, but when I tried spamming the ability on full screen, seems to work just fine with no lag despite the insane amount of effects taking place. Its open source so you can get it here.
I'll be updating time to time though when I make modifications.
@Kueken531: Go
Catalogs sound like fun. Are they restricted to modifying effect parameters? Or can we mess around with the Ability parameters as well? I'm thinking of using some unused field to store the damage values. I'd like to avoid having to create extra effects where possible (Trying to avoid any unecessary map size increase and keep things optimal.)
@TheAlmaity: Go
Done :) Works exactly as I need it to. Thanks for the help and the offer. Though I don't think I'll be touching on data much :P I mainly need to use it because there is no way to dynamically created buttons/effects (That I know of) through pure script.
@zeldarules28: Go
Aight, I'll keep that in mind should I ever need it.
@VoidPotato: Go
My thoughts exactly. 1 dummy effect that deals 0 damage is all it takes really.
Got one last question. Does anyone know how to extract the level of an ability and use it to create a dynamic tooltip? Some arithmetic required here.
@Kueken531: Go
Terribly sorry for bumping this.. But could anyone please teach me how I can make my abilites have more than 1 level?
By default the data editor seems to assume 0. Im using galaxy to increment the level of the ability, but it seems to be capped at 1.