So as the title suggests, having some issues with upgrades. This uses data and triggers to work, I'm almost positive it is something on the data side going wrong though. I had been using behaviors to apply benefits of stats before, but have decided that upgrades make more sense in terms of the tooltips showing more accurate damage/delay/range information. I've used upgrades successfully in the past, so it is really boggling why this isn't working. Anyways with all that said let me give you the basic setup for how my stats work, at least how stamina works since it is the simplest one.
The stamina upgrades are setup like this, I have Stamina1, Stamina2, Stamina3, Stamina4, all set to max level 255, the upgrade is of type "Talents", this is true of sta/wis/agi, str/dex/int is of type "Attack Bonus". This is to get around the whole max level of 255 thing. The Affected Unit Array includes my 5 heroes, imp, jack,casper,knight, and bob. The effects includes:
Unit:Imp HP Max: Add 5 hp
Unit:Bob HP Max: Add 5 hp
Unit:Casper HP Max: Add 10 hp
Unit:Jack HP Max: Add 10 hp
Unit:Knight HP Max: Add 15 hp
Unit:Imp HP Regen: Add .05 regen
Unit:Bob HP Regen: Add .05 regen
Unit:Casper HP Regen: Add .1 regen
Unit: Jack HP Regen: Add .1 regen
Unit: Knight HP Regen: Add .15 regen
Now for how these upgrades get applied, either a player starts game with a hero that has stamina, chooses to add a stamina stat point, or equips some armor with stamina on it. This is picked up by the triggers and sent to the function statApply, which looks something like this:
gf_StatApply(int lp_p, int lp_amount, string lp_statName)
{
int lv_currAmount = lp_amount;
if(lp_statName == "Stamina")
{
if(lv_currAmount < 256)
{
Set Stamina1 Upgrade Level to lv_currAmount for lv_p;
Set Stamina2 Upgrade Level to 0 for lv_p;
Set Stamina3 Upgrade Level to 0 for lv_p;
Set Stamina4 Upgrade Level to 0 for lv_p;
}
else
{
Set Stamina1 Upgrade Level to 255 for lv_p;
lv_currAmount -= 255;
if(lv_currAmount < 256)
{
Set Stamina2 Upgrade Level to lv_currAmount for lv_p;
Set Stamina3 Upgrade Level to 0 for lv_p;
Set Stamina4 Upgrade Level to 0 for lv_p;
}
else
{
Set Stamina2 Upgrade Level to 255 for lv_p;
lv_currAmount -= 255;
if(lv_currAmount < 256)
{
Set Stamina3 Upgrade Level to lv_currAmount for lv_p;
Set Stamina4 Upgrade Level to 0 for lv_p;
}
else
{
Set Stamina3 Upgrade Level to 255 for lv_p;
lv_currAmount -= 255;
if(lv_currAmount < 256)
{
SetStamina4Upgrade Level to lv_currAmount for lv_p;
}
else
{
SetStamina4Upgrade Level to 255 for lv_p;
}
}
}
}
}
Appears my upgrade issue was the same as yaksmanofage's at http:www.sc2mapster.com/forums/development/data/42323-solved-infinite-upgrades-possible/#p11, however mine seems to enjoy bugging as early as 30 or 40 upgrades. I'll try setting it up to be Strength1, Strength10, Strength100, Strength1000 with a max level of 10 each, no way in heck I should go beyond 10000 + 1000 + 100 + 10 strength, I doubt it will go past 500 but just to be safe :P.
That is, after sleep, work, and bah humbug. I might PM yaks while I'm at it....
So pretty sure I found some real issues with upgrades.....
1. They get moody if you try to go past 100 upgrades.
2. They get moody if you try to use multiplication/division in the alteration
3. They hate me in general and are plotting against me.
1 and 2 are actually true, 3 is just from WAY too many hours wasted on this crap.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So as the title suggests, having some issues with upgrades. This uses data and triggers to work, I'm almost positive it is something on the data side going wrong though. I had been using behaviors to apply benefits of stats before, but have decided that upgrades make more sense in terms of the tooltips showing more accurate damage/delay/range information. I've used upgrades successfully in the past, so it is really boggling why this isn't working. Anyways with all that said let me give you the basic setup for how my stats work, at least how stamina works since it is the simplest one.
The stamina upgrades are setup like this, I have Stamina1, Stamina2, Stamina3, Stamina4, all set to max level 255, the upgrade is of type "Talents", this is true of sta/wis/agi, str/dex/int is of type "Attack Bonus". This is to get around the whole max level of 255 thing. The Affected Unit Array includes my 5 heroes, imp, jack,casper,knight, and bob. The effects includes:
Unit:Imp HP Max: Add 5 hp
Unit:Bob HP Max: Add 5 hp
Unit:Casper HP Max: Add 10 hp
Unit:Jack HP Max: Add 10 hp
Unit:Knight HP Max: Add 15 hp
Unit:Imp HP Regen: Add .05 regen
Unit:Bob HP Regen: Add .05 regen
Unit:Casper HP Regen: Add .1 regen
Unit: Jack HP Regen: Add .1 regen
Unit: Knight HP Regen: Add .15 regen
Now for how these upgrades get applied, either a player starts game with a hero that has stamina, chooses to add a stamina stat point, or equips some armor with stamina on it. This is picked up by the triggers and sent to the function statApply, which looks something like this:
Appears my upgrade issue was the same as yaksmanofage's at http:www.sc2mapster.com/forums/development/data/42323-solved-infinite-upgrades-possible/#p11, however mine seems to enjoy bugging as early as 30 or 40 upgrades. I'll try setting it up to be Strength1, Strength10, Strength100, Strength1000 with a max level of 10 each, no way in heck I should go beyond 10000 + 1000 + 100 + 10 strength, I doubt it will go past 500 but just to be safe :P.
That is, after sleep, work, and bah humbug. I might PM yaks while I'm at it....
So pretty sure I found some real issues with upgrades.....
1. They get moody if you try to go past 100 upgrades. 2. They get moody if you try to use multiplication/division in the alteration 3. They hate me in general and are plotting against me.