Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gearswap] pet_midaction() #1596

Closed
Caradog opened this issue Nov 12, 2017 · 11 comments
Closed

[Gearswap] pet_midaction() #1596

Caradog opened this issue Nov 12, 2017 · 11 comments

Comments

@Caradog
Copy link

Caradog commented Nov 12, 2017

Having issues wherein pet_midaction() still seems to be true while processing pet_aftercast() - would of thought these to be mutually exclusive events as aftercast is processed after the action is flagged complete?

@Caradog Caradog changed the title pet_midaction() [Gearswap] pet_midaction() Nov 12, 2017
@Nekseus
Copy link
Contributor

Nekseus commented May 3, 2018

The only action for pets is midaction. The reason for this is because gearswap does not process the precast action for pets and aftercast is only processed if there is also a precast action.

Filtering out precast and aftercast is reasonable in the case of item use but there is no reason to exclude this from pet actions.

There should be pet precast in my opinion so BST can use charmer's merlin without gimping a slot and there is no reason to not have pet aftercast other than deeming the benefits not worth the effort to rewrite I guess.

Idk who maintains gearswap now that byrth is gone so I'm mentioning you @z16

The file that needs to be rewritten is triggers.lua

@smd111
Copy link
Contributor

smd111 commented May 3, 2018

The only action for pets is midaction. The reason for this is because gearswap does not process the precast action for pets and aftercast is only processed if there is also a precast action.
no there is pet_midcast(spell) and pet_aftercast(spell)
`Filtering out precast and aftercast is reasonable in the case of item use but there is no reason to exclude this from pet actions.

There should be pet precast in my opinion so BST can use charmer's merlin without gimping a slot and there is no reason to not have pet aftercast other than deeming the benefits not worth the effort to rewrite I guess.`
precast does not exist for pets so its impossible to do
-this is because most pet skills you never know about before there triggered unless you can use a JA to trigger them then you use your JA in precast(spell)
and yes pet_aftercast(spell) has a use
-for instance if you want to switch in gear in pet_midcast then remove that gear in pet_aftercast

@Nekseus
Copy link
Contributor

Nekseus commented May 3, 2018

I seem to have got a little mixed up between triggers.lua and a couple other gearswap files at the time. I was a bit over tired working a double last night.

I just want to clarify I said there was no use to exclude aftercast from pet actions. I'm aware of player and pet status. At the time I wrote that I misread some areas of gearswap and thought I found an instance of pet aftercast slipping through the cracks.

I'm sure Caradog is onto something though. The other gearswap bug he brought up was spot on. So I'm confident this issue isn't a matter of some unknown filter, eventArgs, etc being in his job lua.

This isn't the place for this discussion but on the subject of precast I'm pretty sure it is in fact a possibility to add to gearswap but it would be a annoying to say the least. To begin with unify_prefix would need to be redefined a little and some in depth triggers written.

As far as I know BST is the only job that would be effected(unless autos get snap shot or something else) but now that I think of it even if precast was defined the recast reduction of charmer's merlin wouldnt even work if replaced by midcast anyways would it?

Again I've never been into pet jobs. I know about the charmer's merlin thing because some of my friends got into it during the bandwagon and they had a big stink about whether or not to use it and some if only pet.precast existed commentary.

@Caradog
Copy link
Author

Caradog commented May 4, 2018

The issue I'm encountering is trying to swap to aftercast gear after the pet action completes, my aftercast has a line that prevents further action in the case of the player (or pet) still being mid_action for a number of reasons - however the pet_midaction() (at least when I originally posted this, I haven't tested it in months) was flagging true at pet_aftercast, as pet_aftercast is supposed to proc when the action completes these are mutually exclusive events (either the pet is midaction or it has finished), but that doesn't seem to be the case - I'd kind of assumed it was an unfixable problem due to packets being received at the same time or some such, similar to how buff_active can fail for certain events if you act too quickly after the JA that gives said buff (think Sneak Attack)

@Nekseus
Copy link
Contributor

Nekseus commented May 4, 2018

my aftercast has a line that prevents further action in the case of the player (or pet) still being mid_action for a number of reasons

Does pet_aftercast work correctly without this?

[edit] Do you use mote-include?

@Caradog
Copy link
Author

Caradog commented May 4, 2018

No I don't use Mote's files

Anyway, pet_aftercast procs correctly as expected

@smd111
Copy link
Contributor

smd111 commented May 4, 2018

Nekseus - This isn't the place for this discussion but on the subject of precast I'm pretty sure it is in fact a possibility to add to gearswap but it would be a annoying to say the least. To begin with unify_prefix would need to be redefined a little and some in depth triggers written.

pet precast is nearly impossible as the only this you get for it are chat messages which are extraordinarily hard to decode
and the only pets that could use pet_precast are those like PUP's not pets where you need to use a /pet command this is because /pet commands show as a JA in the normal string aka pretarget,precast,midcast,aftercast
so for pets that you need to issue commands to you would use this order to change gear pretarget,precast,pet_midcast,pet_aftercast

@Nekseus
Copy link
Contributor

Nekseus commented May 4, 2018

command this is because /pet commands show as a JA in the normal

as I said...

To begin with unify_prefix would need to be redefined a little and some in depth triggers written.

statics.lua

unify_prefix = {['/ma'] = '/ma', ['/magic']='/ma',['/jobability'] = '/ja',['/ja']='/ja',['/item']='/item',['/song']='/ma',
    ['/so']='/ma',['/ninjutsu']='/ma',['/weaponskill']='/ws',['/ws']='/ws',['/ra']='/ra',['/rangedattack']='/ra',['/nin']='/ma',
    ['/throw']='/ra',['/range']='/ra',['/shoot']='/ra',['/monsterskill']='/ms',['/ms']='/ms',['/pet']='/ja',['Monster']='Monster',['/bstpet']='/ja'}

action_type_map = {['/ja']='Ability',['/jobability']='Ability',['/so']='Magic',['/song']='Magic',['/ma']='Magic',['/magic']='Magic',['/nin']='Magic',['/ninjutsu']='Magic',
    ['/ra']='Ranged Attack',['/range']='Ranged Attack',['/throw']='Ranged Attack',['/shoot']='Ranged Attack',['/ms']='Ability',['/monsterskill']='Ability',
['/ws']='Ability',['/weaponskill']='Ability',['/item']='Item',['/pet']='Ability',['/bstpet']='Ability',['Monster']='Monster Move'}

[edit] I don't want to argue smd111, I'v known of your personal libs for gearswap before this conversation and I respect your work.

We are derailing this issue. Would love to chat if you wish, you can reach me on discord Nekseus#5151

@Byrth
Copy link
Contributor

Byrth commented May 23, 2018

I lack the bandwidth (and the pet) to really understand what is being discussed here tonight, but I'm marking this with a comment so I remember to come back to it.

@Nekseus
Copy link
Contributor

Nekseus commented May 25, 2018

@Byrth
Um, admittedly a lot of confusion on my part... Please forgive my ignorance in this discussion. Not sure where the issue is for this exactly but I suspect triggers?

TLDR: just dont bother reading lol
I ran a little off topic on this and smd111 made some solid educated arguements though I still feel pet precast isn't impossible. Just a bit differently approached from how I first saw it. However I'm not certain. But the way pet actions are handled by the server and with the packet losses from server lag seemingly becoming worse. I feel this is even more of a project not worth exploring.

@Byrth
Copy link
Contributor

Byrth commented May 26, 2018

Okay. I think my original argument against Pet Precast was that Pet Precast is basically player aftercast/precast depending on the pet action. The flow is normally:

  • You input a command
  • Player Pretarget
  • Player Precast
  • Action packet sent
  • Player Midcast

At this point, two things happen for every pet action, but how quickly and how they overlap can vary.

For Player:

  • Returning action packet received (action prepared) - doesn't happen for every pet action
  • Returning action packet received (action use)
  • Player Aftercast

For Pet:

  • Returning Action packet received (action prepared)
  • Pet Midcast
  • Returning Action packet received (action use)
  • Pet Aftercast

My issue with Pet Precast is just that there isn't another thing to hang my hat on for Pet actions. Rigorously defined, Player Precast is also Pet Precast and Player Midcast is also Pet Midcast, and people are free to use them that way, but it felt like I was throwing away an opportunity, particularly for the slower moves, if I didn't make a Pet Midcast.

Regardless, if you feel it isn't a problem then I will close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants