The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

[HELP] How to add stat buffs to existing skills?

By on December 6, 2009 10:21:00 PM from Demigod Forums Demigod Forums

gkrit

Join Date 01/2009
+32

im trying to add affects to abilities through buffblueprints and such but i havent successfully achieved anything of the sort. im able to add extra buffs to existing/established 'Affects' but ive hit a wall with making my own.

Can someone address all the key aspects of a buffblueprint and what is needed to be addressed in order to add Affects on existing abilities (should the skill's function be manipulated accordingly)?

for example...

I want Warp Strike to buff DA with faster attack speed for a certain duration when used.

> Please provide the code on how to do this just so i can see what has been added/manipulated.

Locked Post 13 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 7:08:54 PM from Demigod Forums Demigod Forums

I'm also curious. Can anyone provide?

Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 8:41:31 PM from Demigod Forums Demigod Forums

I haven't tested this at all, but how about trying something like this:

Code: c++
  1. #################################################################################################################
  2. # Warp Strike I
  3. #################################################################################################################
  4. AbilityBlueprint {
  5.     Name = 'HDemonWarpStrike01',
  6.     DisplayName = '<LOC ABILITY_DA_0001>Warp Strike I',
  7.     Description = '<LOC ABILITY_DA_0002>Demon Assassin warps to an enemy and instantly strikes, dealing [GetDamage] damage and increasing attack speed by [GetAttackSpeedBuff]%.',
  8.     AbilityType = 'TargetedUnit',
  9.     TargetAlliance = 'Enemy',
  10.     TargetCategory = 'ALLUNITS - UNTARGETABLE',
  11.     TargetingMethod = 'HOSTILETARGETED',
  12.     EnergyCost = 500,
  13.     RangeMax = 15,
  14.     Cooldown = 7,
  15.     DamageAmt = 250,
  16.     DamageType = 'Spell',
  17.     UISlot = 1,
  18.     HotKey = '1',
  19.     CastAction = 'WarpStrike',
  20.     FollowThroughTime = 0.3,
  21.     GetDamage = function(self) return math.floor( self.DamageAmt ) end,
  22.     GetAttackSpeedBuff = function(self) return math.floor( Buffs['HDemonWarpStrikeBuff01'].Affects.RateOfFire.Mult * 100 ) end,
  23.     OnStartAbility = function(self, unit, params)
  24.         ForkThread(WarpStrike, self, unit, params)
  25.         -- Custom start
  26.         Buff.ApplyBuff(unit, 'HDemonWarpStrikeBuff01', unit)
  27.         -- Custom end
  28.     end,
  29.     Icon = '/DGDemonAssassin/DA_WarpStrike',
  30. }
  31. -- Custom start
  32. BuffBlueprint {
  33.     Name = 'HDemonWarpStrikeBuff01',
  34.     Debuff = false,
  35.     DisplayName = 'Warp Strike Attack Speed Buff',
  36.     Description = 'Faster?',
  37.     BuffType = 'HDEMONWARPSTRIKEBUFF',
  38.     Stacks = 'REPLACE',
  39.     Duration = 6,
  40.     Affects = {
  41.         RateOfFire = {Mult = 0.30},
  42.     },
  43.     Icon = '/DGDemonAssassin/DA_WarpStrike',
  44. },
  45. -- Custom end
Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 9:02:54 PM from Demigod Forums Demigod Forums

ill try it

Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 9:32:14 PM from Demigod Forums Demigod Forums

still doesnt work.

the skill slots go grey with that code, which is usually what i get.... so im prety much stuck ...

Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 9:40:07 PM from Demigod Forums Demigod Forums

Are you hooking correctly and everything? I don't see why all of the skill slots are going grey. Try running the game windowed with /showlog and see what errors you are getting.

eg. Demigod shortcut target = D:\Demigod\Retail\1.20.0211\bin\Demigod.exe /windowed 1280 720 /showlog /skiintro /map MAP13 /hero hvampire

Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 10:26:23 PM from Demigod Forums Demigod Forums

yeh i am hooking it coz all my other tweaks are working for that mod its just when i try to add an additional bufftype it goes whacko.

im not quite sure what u mean with /showlog

Reason for Karma (Optional)
Successfully updated karma reason!
December 7, 2009 11:45:38 PM from Demigod Forums Demigod Forums

The only problem I can see with the posted code is in the end of the buffblueprint:

  1.     },
  2.     Icon = '/DGDemonAssassin/DA_WarpStrike',
  3. },

The ending ) must not have a ,

Removing this should allow the skills to load up. ( I was able to test that much. However, due to problems with my laptop I can't test that the skill is actually firing. )

When you run into a problem, check the folder where you your game.prefs is ( something like:

C:\Users\(YOUR USER NAME)\Documents\My Games\Gas Powered Games\Demigod

Open demigodLog.txt and search for warning. You'll learn which ones are normal ( if you skip the intro videos, there will be a warning for each of those for example. ) You can also use the /log "filename" to create a log file inside your gamefolder instead. This one should log more once the game starts. These logs are absolutely essential, and often tell you exactly the problem. ( In this case, it mentions that it did not expect to find the comma, because it was supposed to be the end of that blueprint. )

Cheers!

Reason for Karma (Optional)
Successfully updated karma reason!
December 8, 2009 12:20:10 AM from Demigod Forums Demigod Forums

i think you need to completely understand how the buffing works an where it is done. i cant help you with that but i can tell you a way how you might find what you need.

first add a custom attribute to the table that doesnt affect others (unique name). then go to a place in the code where you think that this information should be available somehow. then you use the function PrintInformation(1) from the script i posted here during the last days. this will print out every table and nested table and its content, so basically every variable that is available (except the global variables). then you search the created log for your custom attribute and look if it is loaded at all and where. then you can follow the nested tables up to the root table, search for usages of that table or the nested ones and see where the buffs are being applied and why yours is not.

another problem could be (what i had with a custom angel) that it just wasnt loaded because i didnt import the .lua that was neccessary. so if this bp comes with a lua then try to import it somewhere so that it is known to the program.

Reason for Karma (Optional)
Successfully updated karma reason!
December 8, 2009 5:15:06 AM from Demigod Forums Demigod Forums

Quoting Derog,
i think you need to completely understand how the buffing works an where it is done. i cant help you with that but i can tell you a way how you might find what you need.

first add a custom attribute to the table that doesnt affect others (unique name). then go to a place in the code where you think that this information should be available somehow. then you use the function PrintInformation(1) from the script i posted here during the last days. this will print out every table and nested table and its content, so basically every variable that is available (except the global variables). then you search the created log for your custom attribute and look if it is loaded at all and where. then you can follow the nested tables up to the root table, search for usages of that table or the nested ones and see where the buffs are being applied and why yours is not.

another problem could be (what i had with a custom angel) that it just wasnt loaded because i didnt import the .lua that was neccessary. so if this bp comes with a lua then try to import it somewhere so that it is known to the program.

wow ... i have no idea wat ur talking about lol

im no expert with this stuff but i thought i could manipulate code so that i can apply a simple buff to an existing skill. but maybe its a little more complex than that?

if theres anything else u know plz feel free and ill try my best to understand the process

Reason for Karma (Optional)
Successfully updated karma reason!
December 8, 2009 8:41:51 AM from Demigod Forums Demigod Forums

I just tested my code out and the reason that it isn't working is the final comma at the end of the buff blueprint, as zechio also mentioned. Change it to:

Code: c++
  1. BuffBlueprint {
  2.     Name = 'HDemonWarpStrikeBuff01',
  3.     Debuff = false,
  4.     DisplayName = 'Warp Strike Attack Speed Buff',
  5.     Description = 'Faster?',
  6.     BuffType = 'HDEMONWARPSTRIKEBUFF',
  7.     Stacks = 'REPLACE',
  8.     Duration = 6,
  9.     Affects = {
  10.         RateOfFire = {Mult = 0.30},
  11.     },
  12.     Icon = '/DGDemonAssassin/DA_WarpStrike',
  13. }

You can tell it was a copy and paste job =P Oh, and to get your log showing up, right-click your Demigod shortcut, go to Properties. In the Target section, append the switches you want, like /windowed 1024 768 and /showlog.

Reason for Karma (Optional)
Successfully updated karma reason!
December 9, 2009 1:58:55 AM from Demigod Forums Demigod Forums

OMG IT WORKS!!!it was the comma.

and the only thing i was missing from the code was this line...

Buff.ApplyBuff(unit, 'HDemonWarpStrikeBuff01', unit)

i was trying to refernece the buff some other way lol.

for everyone!! lol

Reason for Karma (Optional)
Successfully updated karma reason!
December 9, 2009 1:54:17 PM from Demigod Forums Demigod Forums

Quoting gkrit,
OMG IT WORKS!!!it was the comma.

and the only thing i was missing from the code was this line...

Buff.ApplyBuff(unit, 'HDemonWarpStrikeBuff01', unit)

i was trying to refernece the buff some other way lol.

for everyone!! lol

NP...we've all done these things:) I know while working on my skill that had to count and change based on number of enemies around, I had a nightmare of a time...and those commas bit me a lot. (sometimes it was the lack of a comma ). It still is very rough and could be improved in several ways, but I just wanted it to work. Never meant it as a real mod, so it can stay where it's at for now, hehe.

Glad you got things up and working, and glad I could help!

cheers!

Reason for Karma (Optional)
Successfully updated karma reason!
August 2, 2011 8:26:46 AM from Demigod Forums Demigod Forums

um you want to BUFF DA? why?

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000157   Page Render Time: