Having an issue with tooltip data sourcing. Basically I have 19 abilities my Imp hero can use, so 19 different buttons, with different costs, level requirements, that kind of thing. To avoid someone getting level 10 of a spell at like level 5 though, I have decided you can only increase the spell's level every 5 levels. I wanted the tooltip to dynamically show what level you must be to purchase a spell. To this end, I put in 19 dummy damage effects, each damage effect the original level requirement. Then I put in 19 upgrades with 9 levels each, each level adding 5 damage to the dummy damage effects, effectively setting the level from say 15 to 20, 20 to 25, etc.
Now this is all working great, if they have their own unit selected while they are browsing the ability menu. Say they are looking at lightning bolt, which is base level requirement of 5, which they already have level 3 of. So now it displays required level of 20. However, if they are selecting an ally or no unit, it shows the ally's level requirement, or the enemy's level requirement, which in most cases is 5. I obviously do NOT want this happening. I thought about possibly making the dialog select the hero every time it is opened, but I don't intend for this to be that kind of RPG. Is there a way around this, or should I just give up having dynamically updated ability tooltips? I want this to work, as it would be great to dynamically show how much of a damage upgrade they would get with each spell (based on their int level which boosts damage, etc).
I am guessing when you select a unit it sets the "Player owner" of that player to be the "Triggering Player" of your little ability thingy. When you are selecting an ability. Make sure the triggering player stays the same.
Store the "Unit/Player" who is going to interact with your abilities. And don't change the value unless he closed the dialog ability selection menu thingy.
I understand what you mean, but I'm not exactly sure how to implement it. I have no events to speak of, at least that I have set up, that are showing this tooltip though. The only interactions I have set up with the buttons are creating them, and keeping tabs on who has clicked them.
Still not sure how to go about making sure the tooltip always knows you are referring to the triggering player, or triggering player's hero. It might make more sense if we were talking about Mouse Click, Mouse Enter, or Mouse Exit event, but I'm referring only to the little tooltip that you set on the button. I want to be able to use dref fields to show things level required for the spell, damage the upgrade would give (with stat effects). The dref fields are working great, they just aren't sure what player to show drefs for.... No idea where/how you force them to always mean a certain player.
Screenshots won't be possible at the moment(next 6 hours), I can show you the exact script used to make the dialog, update the dref field, etc though if that helps?
Be easier if I just post a txt file I think, I'll use my hero with only 4 abilities since it is a much easier exampe to follow, there is a lot to it, I'll try to explain what I do in it though with comments. The only thing I can't really post is actual stuff inside the text, but it is just blah blah blah, dref the damage amount field of a dummy damage effect in data editor controlled by SetCasperUpgrades function.
Please ask me if something isn't clear, I really want to figure this out as it will greatly affect the visual/user friendly appeal of my project. Thanks for taking a look in advance!
@Deadzergling: Go
Sounds like the script is referencing the "selected unit". I would suggest you first make a global variable something like PlayerHeros[0-15] type unit. Then set each players hero to the appropriate index of the variable. Then where the code changes the unit to show stats for you just change it the the PlayerHero variable.
Please describe what your actual problem is in less words?
You dont want the dialogs to show when they dont have thier own hero selected?
I dont see any code in there that refers to selected units..... and nothing that updates the dialogs values...
From what I understood when he was explaining the problem in IRC, he displays text, which includes references to data, similar to how you would set up button tooltips. For data button tooltips, this works just fine, because it should always display the information matching to the selected unit. If you select an enemy unit with a universal button you are allowed to see, it would update the information based on the enemy's tech status.
However, apparently, this is done dynamically for every single text reference used, every time the player changes his selection. I doubt, there are triggers interfering, it sounds like a hardcoded issue to me. However, I didn't test this myself yet, so I might be wrong.
I have no idea how to fix this, but there would be a couple of workarounds including
limit the selection; disallow the player to select enemy units. Handle the stuff you need the selection for in another way.
attach invisible units with bigger hitboxes to enemies, so when you select the enemy, you select an invisible allied unit instead
simulate the tooltips by pulling all the values from data with catalogs instead of with dref references and construct the tooltips from there, which allows you to specify the player.
I just came up with the last idea (mentioned the others earlier in IRC), it should work in theory. You would lose the convenience of the text editor, but everything else should work exactly the same otherwise.
Thanks a lot for the help you three, seems I'll be going with Option # 3:
simulate the tooltips by pulling all the values from data with catalogs instead of with dref references and construct the tooltips from there, which allows you to specify the player.
Going to be awhile though, I have just decided the way my intelligence/wisdom currently works is wrong, and I need to redo just about everything about it... Oh well, at least I know how to approach this now.
Sorry for hijacking the thread, but I have what I think is a similar problem.
I have a lot of upgrades with different max levels. I want to update the tooltip to show the level of the upgrade. I do this with data references in the button tooltip. Since I don't know of a way to use data references to get the current level, I use a dummy behavior's duration field instead. The upgrade adds to the duration and the tooltip references the behavior duration.
This works fine, but there's one issue. If I move the mouse over the button, it'll show something like: "Increases movement speed. Level: 0 / 5". If I press it once and keep the mouse over the button, it'll still show "Increases movement speed. Level: 0 / 5". However, if I move the mouse away so the tooltip fades and once again move it over, it'll update to 1 / 5 correctly.
I understand why this is happening(I'm assuming it was never meant to be dynamically updated while visible), but is there a way to fix it or a workaround that doesn't require several buttons for each upgrade.
Using a dummy damage effect might work better, that is what I did, although I'm guessing you aren't being specific enough referring to your dummy behaviors. And it totally is meant to be dynamically updated while visible, only for a button in data, not in triggers. I am assuming these buttons are in data connected to your unit, not in a dialog, right?
When your updating your dialogs.... you could detect whether the tool tip actually required to be changed or not. If the tool tip requires being changed then you can hide the button and then reshow it. This should hide the players active tool tip and reshow it with up to date content
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
@Deadzergling: I'm not sure why damage effects would work better. Also, what I meant was "I'm assuming it was never meant to be dynamically updated while the tooltip is visible". I want to update the tooltip, while the tooltip is visible. This doesn't seem to work with data references, at least not for me.
@SouLCarveRR: I'm talking about normal data buttons, not dialogs.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Having an issue with tooltip data sourcing. Basically I have 19 abilities my Imp hero can use, so 19 different buttons, with different costs, level requirements, that kind of thing. To avoid someone getting level 10 of a spell at like level 5 though, I have decided you can only increase the spell's level every 5 levels. I wanted the tooltip to dynamically show what level you must be to purchase a spell. To this end, I put in 19 dummy damage effects, each damage effect the original level requirement. Then I put in 19 upgrades with 9 levels each, each level adding 5 damage to the dummy damage effects, effectively setting the level from say 15 to 20, 20 to 25, etc.
Now this is all working great, if they have their own unit selected while they are browsing the ability menu. Say they are looking at lightning bolt, which is base level requirement of 5, which they already have level 3 of. So now it displays required level of 20. However, if they are selecting an ally or no unit, it shows the ally's level requirement, or the enemy's level requirement, which in most cases is 5. I obviously do NOT want this happening. I thought about possibly making the dialog select the hero every time it is opened, but I don't intend for this to be that kind of RPG. Is there a way around this, or should I just give up having dynamically updated ability tooltips? I want this to work, as it would be great to dynamically show how much of a damage upgrade they would get with each spell (based on their int level which boosts damage, etc).
I am guessing when you select a unit it sets the "Player owner" of that player to be the "Triggering Player" of your little ability thingy. When you are selecting an ability. Make sure the triggering player stays the same.
Store the "Unit/Player" who is going to interact with your abilities. And don't change the value unless he closed the dialog ability selection menu thingy.
I understand what you mean, but I'm not exactly sure how to implement it. I have no events to speak of, at least that I have set up, that are showing this tooltip though. The only interactions I have set up with the buttons are creating them, and keeping tabs on who has clicked them.
MakeImpDialog (function)
{
gv_impSkills_BILL[lp_p][3].lv_btn = gf_NewDialogItemBtn(gv_impSkillPages[lp_p][0], lv_x3, lv_y3, lv_xOff3, lv_yOff3, c_anchorTop, StringExternal("Param/Value/D745AFD3"));
}
The function for making new buttons is:
int gf_NewDialogItemBtn (int lp_dialog, int lp_sizeX, int lp_sizeY, int lp_offsetX, int lp_offsetY, int lp_anchor, text lp_tooltip) {
int lv_btn;
lv_btn = c_invalidDialogControlId;
libNtve_gf_CreateDialogItemButton(lp_dialog, lp_sizeX, lp_sizeY, lp_anchor, lp_offsetX, lp_offsetY, lp_tooltip, StringExternal("Param/Value/E0C36243"), "");
lv_btn = DialogControlLastCreated();
DialogControlFadeTransparency(lv_btn, PlayerGroupAll(), 0.0, 100.0);
return lv_btn;
}
I'm not really sure where in this I could switch it to always refer to the hero unit.
Still not sure how to go about making sure the tooltip always knows you are referring to the triggering player, or triggering player's hero. It might make more sense if we were talking about Mouse Click, Mouse Enter, or Mouse Exit event, but I'm referring only to the little tooltip that you set on the button. I want to be able to use dref fields to show things level required for the spell, damage the upgrade would give (with stat effects). The dref fields are working great, they just aren't sure what player to show drefs for.... No idea where/how you force them to always mean a certain player.
@Deadzergling: Go
From the sounds of it your displaying this requirement information in a dialog?
Could we get some screen shots?
Id be glad to take a look at the map file for you and see if there is anything that can be done.
@SouLCarveRR: Go
Screenshots won't be possible at the moment(next 6 hours), I can show you the exact script used to make the dialog, update the dref field, etc though if that helps?
Be easier if I just post a txt file I think, I'll use my hero with only 4 abilities since it is a much easier exampe to follow, there is a lot to it, I'll try to explain what I do in it though with comments. The only thing I can't really post is actual stuff inside the text, but it is just blah blah blah, dref the damage amount field of a dummy damage effect in data editor controlled by SetCasperUpgrades function.
Please ask me if something isn't clear, I really want to figure this out as it will greatly affect the visual/user friendly appeal of my project. Thanks for taking a look in advance!
@Deadzergling: Go Sounds like the script is referencing the "selected unit". I would suggest you first make a global variable something like PlayerHeros[0-15] type unit. Then set each players hero to the appropriate index of the variable. Then where the code changes the unit to show stats for you just change it the the PlayerHero variable.
Please describe what your actual problem is in less words?
I dont see any code in there that refers to selected units..... and nothing that updates the dialogs values...
How exactly do you update the dialogs?
From what I understood when he was explaining the problem in IRC, he displays text, which includes references to data, similar to how you would set up button tooltips. For data button tooltips, this works just fine, because it should always display the information matching to the selected unit. If you select an enemy unit with a universal button you are allowed to see, it would update the information based on the enemy's tech status.
However, apparently, this is done dynamically for every single text reference used, every time the player changes his selection. I doubt, there are triggers interfering, it sounds like a hardcoded issue to me. However, I didn't test this myself yet, so I might be wrong.
I have no idea how to fix this, but there would be a couple of workarounds including
I just came up with the last idea (mentioned the others earlier in IRC), it should work in theory. You would lose the convenience of the text editor, but everything else should work exactly the same otherwise.
Thanks a lot for the help you three, seems I'll be going with Option # 3:
simulate the tooltips by pulling all the values from data with catalogs instead of with dref references and construct the tooltips from there, which allows you to specify the player.
Going to be awhile though, I have just decided the way my intelligence/wisdom currently works is wrong, and I need to redo just about everything about it... Oh well, at least I know how to approach this now.
Sorry for hijacking the thread, but I have what I think is a similar problem.
I have a lot of upgrades with different max levels. I want to update the tooltip to show the level of the upgrade. I do this with data references in the button tooltip. Since I don't know of a way to use data references to get the current level, I use a dummy behavior's duration field instead. The upgrade adds to the duration and the tooltip references the behavior duration.
This works fine, but there's one issue. If I move the mouse over the button, it'll show something like: "Increases movement speed. Level: 0 / 5". If I press it once and keep the mouse over the button, it'll still show "Increases movement speed. Level: 0 / 5". However, if I move the mouse away so the tooltip fades and once again move it over, it'll update to 1 / 5 correctly.
I understand why this is happening(I'm assuming it was never meant to be dynamically updated while visible), but is there a way to fix it or a workaround that doesn't require several buttons for each upgrade.
@Siretu: Go
Using a dummy damage effect might work better, that is what I did, although I'm guessing you aren't being specific enough referring to your dummy behaviors. And it totally is meant to be dynamically updated while visible, only for a button in data, not in triggers. I am assuming these buttons are in data connected to your unit, not in a dialog, right?
@Siretu: Go
When your updating your dialogs.... you could detect whether the tool tip actually required to be changed or not. If the tool tip requires being changed then you can hide the button and then reshow it. This should hide the players active tool tip and reshow it with up to date content
@Deadzergling: I'm not sure why damage effects would work better. Also, what I meant was "I'm assuming it was never meant to be dynamically updated while the tooltip is visible". I want to update the tooltip, while the tooltip is visible. This doesn't seem to work with data references, at least not for me.
@SouLCarveRR: I'm talking about normal data buttons, not dialogs.