Good Morning,
In the spirit of doing more modding as a community, I thought I'd share my recent problem to get feedback and provide some lua examples to those unfamiliar with the demigods lua code.
Task:
One of the things I've been working on is to find a way to allow the QoT to automatically self-target her shield when she needs to (i.e., when running away). The theory can then be extended for use on the Oak's shield, Sedna's heal, and QoT's Mulch Shambler. My idea was that if '3' is the hotkey for the ability, then shift + 3, control + 3, or alt +3, should be suitable alternatives.
Progress:
I've made it so I can autocast on the QoT. However, there are issues having both of the skills overlap.
Problems:
Icon overlap:
The self-shield and shield icons (in position 3) overlap on the skill bar. When the skill is recharging the icon has two layers of red applied instead of just the one. Additionally, this glitch is still present when unpacked with the unpacked skill set. Trying to 'hide' or place the icon in an unviewable place causes all of the unpacked skills to be represented by grey (null?) icons, and none of the skills are responsive, even with hotkeys.
Hotkey failure:
The # is not a valid hotkey (shift + 3), neither is $ or @. I'm assuming this is true for all of the shift + number combinations, although i haven't tested them. Forum users suggests a double tap method, press 3 twice to self-cast, but I don't think this would work out well in the heat of battle.
Code changes thus far:
Two changes are necessary. The first adds the ability to the QoT's. The second adds it to her level up tree so she can use it. Once this is fixed, duplicate entries for all levels of her Bramble Shield would be necessary.
First, the ability code itself. (note, the code isn't in c++, but the formatting seems to work out)
Code: c++
- #######################
- ##Add to HQueen_Abilities.lua
- #######################
- AbilityBlueprint {
- Name = 'HQueenBrambleShield01S',
- DisplayName = '<LOC ABILITY_Queen_0032>Bramble Shield I',
- Description = '<LOC ABILITY_Queen_0037>Thorns form a shield around an allied unit, absorbing [GetAbsorbAmt] damage.\nOnly one absorption effect per unit may be active at a time.',
- AbilityType = 'Instant', #This makes it self-cast
- EnergyCost = 400,
- Cooldown = 7,
- RangeMax = 20,
- UISlot = 3, #This specifies what clickable skill number it is. Putting this as null or out of range doesn't work out.
- HotKey = '3', #I tried a couple of things, none of them worked.
- CastAction = 'Shield',
- FollowThroughTime = 1.5,
- AbilityCategory = 'HQUEENPACKED',
- SharedCooldown = 'HQueenBrambleShield01', #This makes the selfshield and shield use the same cool down timers.
- Icon = '/dgqueenofthorns/NewQueenBrambleShield01',
- CanCastWhileMoving = true, #Thrown in because it makes sense. If balance requires her to stop while casting, then this can be removed.
- GetAbsorbAmt = function(self) return math.floor( Buffs['HQueenBrambleShield01'].Affects.Absorption.Add ) end,
- Buffs = {
- BuffBlueprint {
- Name = 'HQueenBrambleShield01',
- Debuff = false,
- DisplayName = '<LOC ABILITY_Queen_0034>Bramble Shield',
- Description = '<LOC ABILITY_Queen_0035>Protected from damage.',
- BuffType = 'ABSORB',
- Stacks = 'REPLACE',
- Icon = '/dgqueenofthorns/NewQueenBrambleShield01',
- Duration = 30,
- Affects = {
- Absorption = { Add = 700 },
- },
- SoundLoop = 'Forge/DEMIGODS/QueenOfThorns/snd_dg_qothorns_brambleshield',
- Effects = 'Bramble01',
- }
- },
- }
And secondly the one line change to add it to her level up choices. I made it so that when Bramble shield is taken, both abilities are gained.
Code: c++
- ########################
- ##Edit and add the one noted line to HQueen_unit.bp
- ########################
- #################################################################################################################
- # Bramble Shield I #################################################################################################################
- HQueenBrambleShield01 = {
- Gains = {
- 'HQueenBrambleShield01',
- 'HQueenBrambleShield01S', ##This is the line to add the selfshield
- },
- Icon = '/dgqueenofthorns/NewQueenBrambleShield01',
- Level = 1,
- Loses = {
- 'HQueenBrambleShieldGrey01',
- },
- },
So, anyone have any ideas or suggestions how to fix the problems I've gotten?