2 - function PetSynergyCombatAI.OnPetAbilityClick( abilityId ) prevents preloading abilities
What SHOULD Happen:
Without the mod enabled you can preload abilities as a white lion. As an example:
Be in Trained to Threaten (TTT)
Click or use hotkey to activate all 3 pet abilities, one after the other very quickly
Activate Trained to Kill (TTK)
Wait for the last ability from TTT to fire (should see all 3 debuffs on target)
Then activate the three TTK abilities
This enables you to "preload" the TTT abilities and then swap to TTK (using just that one GCD). Then your pet can continue with the TTK abilities while you use your abilities. This gives you great burst potential.
What DOES Happen:
Because the "function PetSynergyCombatAI.OnPetAbilityClick( abilityId )" limits your ability to click by implementing
"if (globalCooldown > 0.75) or (cooldown > 0.75) then"
you are unable to preload your abilities. Instead you have to wait for each ability to fire, and once all three are fired, you can then swap to the next stance. (the function simply does not let your abilities load when you click on them)
In Addition:
Pet abilities WITHOUT the mod are able to be pre loaded while not in combat.
The "function PetSynergyCombatAI.OnCombatFlagChanged()"; sets "playerWantsAbilityId = nil" when not in combat, making it difficult to preload abilities outside of combat.
ROUGH FIX:
The below is a rough fix for the above problems. It introduces additional instability with the mod's timer handling, make it difficult for the mod to fire the abilities off in the preferred order. It does allow for preloading abilities. And also starts the timer handler when you activate an ability.
It adds cut and pasted code
there are also -- marks in front of the offending code
function PetSynergyCombatAI.OnPetAbilityClick( abilityId )
local cooldown
-- Start Cut and Pasted Code from function PetSynergyCombatAI.OnCombatFlagChanged()
if timerHandle == nil
then
timerHandle = AceTimer:ScheduleRepeatingTimer( CombatEngine, 0.5 )
end
-- End Added Code
cooldown = GetAbilityCooldown( abilityId )
-- if (globalCooldown > 0.75) or (cooldown > 0.75) then
playerWantsAbilityId = abilityId
-- else
CommandPetDoAbility( abilityId )
globalCooldown = globalCooldown + 1.5
-- end
end
| User | When | Change |
|---|---|---|
| MaddBomber83 | Sat, 03 Jan 2009 20:56:42 | Create |
- 2 comments
- 2 comments
Facts
- Reported on
- 03 Jan 2009
- Status
- New - Issue has not had initial review yet.
- Type
- Defect - A shortcoming, fault, or imperfection
- Priority
- Medium - Normal priority.
- #2
MaddBomber83 Mon, 05 Jan 2009 00:09:11Awesome, using my method above definitely breaks a lot of the mod, lol. I'm wondering . . .
Keeping with your internal timers. . .
I'm gonna wait until you release the rewrite to go back through and figure your code out again. But I'm wondering if the below method may work.
If the user clicks an ability, the mod turns the handing over to the user by adding the pets GCD to the internal timer, for each ability the user clicks. I think the pets timer is 1s (they seem to pop thier abilities faster than every 1.5 seconds), I'll have to play some more when I get back to my comp, but it would go like this. User clicks 3 abilities. The mod adds 1 second (or whatever the cooldown is) for each ability and does nothing during that time (giving those abilities the chance to fire). Once that time is up (assuming the user doesn't click any abilities) the mod will take over and start using the preferred ability list.
In practice for me, this allows me to pre load the 3 TTT abilities and then swap to TTK. The mod gives those abilities that I selected enough time to fire, and then manages the TTK set according to my preference list.
As an unrelated comment, I've adapted pet code before in other games. I've never made a pet control mod from scratch before though. I have to say that the way you wrote out the code (with the comments and the formatting and the names of the functions) made it very easy to understand what was going on. Thank you for writing this mod and formatting it cleanly.
- #1
amirabiri2 Sun, 04 Jan 2009 22:03:46I see what you're saying. I think I'll simply take out the GCD for the click function (but not the normal AI). The reason for the inernal GCD is to avoid spam since it seemed to break things, (i.e abilities not firing). However if I enable spam for the user click function, I guess the user knows what they want. It won't affect the "user wants" functionality since that is based on the ability CD and not the GCD.
Thanks for the info.