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.
Yep, seen it shortly after, check my edit
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 10+ times, 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.
It was indeed the Stetmans, setting shaders to medium or replacing the Stetmans fixes the lag entirely (or killing some of the Stetmans; the problem seems to be the flashlight which turns off when incapacitated. So actually using your spell multiple times causes the map to lag less :D)
For the test I used full screen and deactivated the debugger btw.
Quote:
I won't be removing the GUI so soon as I use it to find out what parameters certain functions can take.
Did you ever try this program? Its awesome for such things.
You mean the command card closes, when you spent a learning point? Thats a tricky one :)
The Galaxy Editor does not show all data values of an object when viewed with Combine Structure Values option. If you uncheck this option, some new fields for the command card will appear; one of them is called SubmenuIsSticky.
However, you still cannot change it; if you try to change the individual value, it will still open the standard edit command card window, which misses this option.
So the only way I know of for editing this (besides raw XML editing, of course) is switching to raw data view and manually typing a "1" at the correct place of the field (however you can simply replace all "0"s with "1"s; they represent the different buttons and if a button doesn't open a command card, this field will have no influence).
Didn't see your map until now, btw. I will have a look at it.
€ A note for your map: You can remove the Gui trigger, if you include the trigger librarys in your Custom Scripts. Just add
include"TriggerLibs/NativeLib"
to your script.
For some reason, your map laggs pretty hard on my PC; just to let you know.
constfixedc_tPeriod=0.05;//Fixed Timer period
SC2 can only handle a timer period in multiples of 0.0625 (On second thought, the accuracy of a fixed is actually the same thing; so nothing should change here. Still I would change it for consistency). For more accurate calculations, you should use this value.
Quote:
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 -_-
Could you elaborate when the malfunction happens? Everything seems to work fine for me.
Sure, I hope it won't intimidate you though =/ It's pretty long and I use a lot of custom functions.
Don't worry ;)
Quote:
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.
Seems to work fine
Quote:
Oh, and if you see any potential ways I can improve my coding, please do let me know.
I try to ;)
Quote:
And uh.. forgive me, its not exactly cleaned up yet.
Compared to my usual mess its like heaven ;)
Quote:
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 was not able to reproduce; your ability never surpassed level 4 for me.
€ Ah, now I see. You reduced the ability to 3 cost values, but it still reaches level 4. This seems to be an issue with the UnitAbilityChangeLevel function. If you use UnitAbilityMaxLevel it returns 3; probably this value is compared to the current level internally, but ability levels in galaxy start at 0, while the max level counts each level including the 0; so the correct check would be current level + 1 < max level. Try to implement this check yourself.
Also I was referring to the command index of the learn ability, which you do not use at all.
Quote:
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 my code example, I commented out a message, which shows you, if the trigger will react and which level the ability is. I suggest enabling/adding such a message for your own trigger.
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.
Do you mind sharing your code? Maybe we will see something :)
Could just use multiple effects for the ability, it will switch automatically. But this kind of misses the point, we try to find alternatives for this ;)
I made a small example map, which basically holds the hero/ability system I use currently. It is data-only, except the part where catalog functions are used to modify the effects for higher levels. Since this is a one-time change (only when the player levels up the ability) this should be quite performance friendly.
The tooltip shows the correct damage for each level, without the need of special handling or any change of the tooltip via trigger.
The only downside is the only 1 instance of the ability per player problem (and the fact that not all values can be changed by catalogs, of course)
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.
Yes, you are correct of course :)
Quote:
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.
If you need this, Catalogs are not an option, I guess.
All catalog values have a playergroup parameter, they can be changed for each player individually. The tooltips will show up correctly, as long as only one instance of the ability is allowed per player (or all instances always have the same level).
I will create a small example map. You are familiar and fine with galaxy script, correct? If not stated otherwise, I will use it.
It can be easy to fire more than thousands. For example, if you have many units with an attack speed of zero, "any unit is attacked" can cause overflow problems.
Show me proof, create a testmap, where an event failed to trigger. I have yet to see a map, where an event fails, which is 100% not related to any other stuff interfering (and by that, I do not mean too many events at once, but just other triggers, conditions or variables messing with the actual trigger)
When you say thread, are you referring to it in the context of parallel processing, or does the term have a different meaning in the editor?
Does the editor actually give you control over how many concurrent threads are run on your processor?
Not the threads on your processor, but the threads handled by the game. Each trigger starts its own thread for example. In Gui, you can create functions, which run in their own thread as well (well, this translates to galaxy by actually creating a new trigger anyways).
@TheAlmaity: 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.)
They can basically be applied to any data object; however quite a lot of fields are read-only (for example almost all behavior fields except duration). For abilities, they also change the values for all data objects of the player, so they can only be used if one player cannot use multiple levels of the abilities simultaneously.
They can change the same fields an upgrade object can change.
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.
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.
Still needs to be determined. For my tests, thousands of events simultaneously fired work perfectly fine.
Use another dummy effect that isnt used by the spell at all, have the tooltip refer to a value you need from that effect (If your tooltip says the ability does X damage, have "X" be a reference to the Damage - Amount field in the unused effect), then use catalogs to change that value every time the ability is leveled up :)
In this case, you might want to use catalogs to change the ability effects directly :)
If you use the proper ref links in the tooltip, it will update automatically. Also its easier to change other things than just damage (like AoE or something)
Well, when I have a complex ability with multiple levels and only want to change the damage on lvlup, I usually use a damage effect with 0 damage and use a trigger, which triggers for this damage effect. Then I cause the damage dependant on the skill level per trigger.
Other than that, there is no possibility I know of.
You use a damage effect, which causes 0 damage. Then you create a trigger with the event: Any unit takes damage with (your effect). Then you use the UnitDamage- Function to cause the desired amount of damage to your target. You can get the ability level of the ability (note that level 1 will be detected as 0, level 2 is 1 and so on).
The UnitDamage- Function uses a damage effect to cause the damage, you can either take the 0 damage effect (in this case, make sure it has no AoE, cover AoE-damage with search effects. Also add a condition: damage caused==0 to prevent an infinite loop and you should carefully handle actors, dont use the damage effect as impact effect for actors, it will trigger the actor event multiple times), or use another damage effect dedicated for the triggered damage.
Dunno if the UnitDamage- Function is available in Gui, I use Galaxy script. You could easily use a custom script if not.
This would be a simple spell (or a complex one, does not really matter as long as all damage is caused by a single damage effect), named Electrocute. It has the id "Electrocute" and uses a 0 damage effect "ElectrocuteDamage". The damage caused is set up in the function EC_Damage, the passed integer is the ability level -1, like stated above.
So this function would return 50 + 25*lvl as damage, which is then caused by the UnitDamage- function. My ability has 5 levels, which cause 50/75/100/125/150 damage this way.
Note that this way should be fairly performant, since your trigger is reactin only on a single damage effect (unlike for example a wc3 damage detection, which needed to check all damage events at once and filter the correct ones to modify)
Well, when I have a complex ability with multiple levels and only want to change the damage on lvlup, I usually use a damage effect with 0 damage and use a trigger, which triggers for this damage effect. Then I cause the damage dependant on the skill level per trigger.
Other than that, there is no possibility I know of.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Yep, seen it shortly after, check my edit
It was indeed the Stetmans, setting shaders to medium or replacing the Stetmans fixes the lag entirely (or killing some of the Stetmans; the problem seems to be the flashlight which turns off when incapacitated. So actually using your spell multiple times causes the map to lag less :D)
For the test I used full screen and deactivated the debugger btw.
Did you ever try this program? Its awesome for such things.
You mean the command card closes, when you spent a learning point? Thats a tricky one :)
The Galaxy Editor does not show all data values of an object when viewed with Combine Structure Values option. If you uncheck this option, some new fields for the command card will appear; one of them is called SubmenuIsSticky.
However, you still cannot change it; if you try to change the individual value, it will still open the standard edit command card window, which misses this option.
So the only way I know of for editing this (besides raw XML editing, of course) is switching to raw data view and manually typing a "1" at the correct place of the field (however you can simply replace all "0"s with "1"s; they represent the different buttons and if a button doesn't open a command card, this field will have no influence).
Didn't see your map until now, btw. I will have a look at it.
€ A note for your map: You can remove the Gui trigger, if you include the trigger librarys in your Custom Scripts. Just add
to your script.
For some reason, your map laggs pretty hard on my PC; just to let you know.
SC2 can only handle a timer period in multiples of 0.0625 (On second thought, the accuracy of a fixed is actually the same thing; so nothing should change here. Still I would change it for consistency). For more accurate calculations, you should use this value.
Could you elaborate when the malfunction happens? Everything seems to work fine for me.
Don't worry ;)
Seems to work fine
I try to ;)
Compared to my usual mess its like heaven ;)
I was not able to reproduce; your ability never surpassed level 4 for me.
€ Ah, now I see. You reduced the ability to 3 cost values, but it still reaches level 4. This seems to be an issue with the UnitAbilityChangeLevel function. If you use UnitAbilityMaxLevel it returns 3; probably this value is compared to the current level internally, but ability levels in galaxy start at 0, while the max level counts each level including the 0; so the correct check would be current level + 1 < max level. Try to implement this check yourself.
Also I was referring to the command index of the learn ability, which you do not use at all.
This should not be a problem.
@FuzzYD: Go
In my code example, I commented out a message, which shows you, if the trigger will react and which level the ability is. I suggest enabling/adding such a message for your own trigger.
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.
Do you mind sharing your code? Maybe we will see something :)
@SouLCarveRR: Go
Could just use multiple effects for the ability, it will switch automatically. But this kind of misses the point, we try to find alternatives for this ;)
I made a small example map, which basically holds the hero/ability system I use currently. It is data-only, except the part where catalog functions are used to modify the effects for higher levels. Since this is a one-time change (only when the player levels up the ability) this should be quite performance friendly.
The tooltip shows the correct damage for each level, without the need of special handling or any change of the tooltip via trigger.
The only downside is the only 1 instance of the ability per player problem (and the fact that not all values can be changed by catalogs, of course)
Yes, you are correct of course :)
If you need this, Catalogs are not an option, I guess.
@FuzzYD: Go
All catalog values have a playergroup parameter, they can be changed for each player individually. The tooltips will show up correctly, as long as only one instance of the ability is allowed per player (or all instances always have the same level).
I will create a small example map. You are familiar and fine with galaxy script, correct? If not stated otherwise, I will use it.
Show me proof, create a testmap, where an event failed to trigger. I have yet to see a map, where an event fails, which is 100% not related to any other stuff interfering (and by that, I do not mean too many events at once, but just other triggers, conditions or variables messing with the actual trigger)
Not the threads on your processor, but the threads handled by the game. Each trigger starts its own thread for example. In Gui, you can create functions, which run in their own thread as well (well, this translates to galaxy by actually creating a new trigger anyways).
They can basically be applied to any data object; however quite a lot of fields are read-only (for example almost all behavior fields except duration). For abilities, they also change the values for all data objects of the player, so they can only be used if one player cannot use multiple levels of the abilities simultaneously.
They can change the same fields an upgrade object can change.
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.
Still needs to be determined. For my tests, thousands of events simultaneously fired work perfectly fine.
In this case, you might want to use catalogs to change the ability effects directly :)
If you use the proper ref links in the tooltip, it will update automatically. Also its easier to change other things than just damage (like AoE or something)
You use a damage effect, which causes 0 damage. Then you create a trigger with the event: Any unit takes damage with (your effect). Then you use the UnitDamage- Function to cause the desired amount of damage to your target. You can get the ability level of the ability (note that level 1 will be detected as 0, level 2 is 1 and so on).
The UnitDamage- Function uses a damage effect to cause the damage, you can either take the 0 damage effect (in this case, make sure it has no AoE, cover AoE-damage with search effects. Also add a condition: damage caused==0 to prevent an infinite loop and you should carefully handle actors, dont use the damage effect as impact effect for actors, it will trigger the actor event multiple times), or use another damage effect dedicated for the triggered damage.
Dunno if the UnitDamage- Function is available in Gui, I use Galaxy script. You could easily use a custom script if not.
This would be a simple spell (or a complex one, does not really matter as long as all damage is caused by a single damage effect), named Electrocute. It has the id "Electrocute" and uses a 0 damage effect "ElectrocuteDamage". The damage caused is set up in the function EC_Damage, the passed integer is the ability level -1, like stated above.
So this function would return 50 + 25*lvl as damage, which is then caused by the UnitDamage- function. My ability has 5 levels, which cause 50/75/100/125/150 damage this way.
Note that this way should be fairly performant, since your trigger is reactin only on a single damage effect (unlike for example a wc3 damage detection, which needed to check all damage events at once and filter the correct ones to modify)
@Johnzee: Go
Well, when I have a complex ability with multiple levels and only want to change the damage on lvlup, I usually use a damage effect with 0 damage and use a trigger, which triggers for this damage effect. Then I cause the damage dependant on the skill level per trigger.
Other than that, there is no possibility I know of.