Jump to content
  • 0
Sign in to follow this  
GmOcean

showsp

Question

I've been asking for assistance quite a bit lately, forgive me xD

 

Okay, let's start off with, I know there currently isn't any packets that support the display of party member's SP bar(blue). So I decided to settle with copying the clif->hpdisplay and making SP versions, to just update the HP with SP status information.

This is all done by performing a check of a player's variable and if yes update with SP if no, update with HP. So far it works.... but backwards @.@;

 

What I want it to do is, if a player turns @showsp on. Then the HP bars of his/her party members will be updated with SP information. Then when a party member who has @showsp off, will only see HP bars with HP information. That means, even the HP of the player using @showsp on.

 

But, what I managed to do was this:

1. Player A uses @showsp on.

2. Player B uses @showsp off.

3. Player A uses a skill.

4. Player B see's his HP bar drop. Pressing Alt+Z will also display the same information. (This is the problem. Player B should only see the HP information).

5. Player B uses a skill.

6. Player A doesn't see a change in the bar because Player B isn't showing SP. (Again this is a problem. Player A should see an update because he is requesting to see SP information).

 

I don't know where I went wrong with this patch, but i'll post what changes I made.

( Don't mind the buybacklist clif added in there. It is completely irrelevant to this, and also doesn't interfere with it =P )

showsp.patch

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I think that's because in each of the cases you check player's whose HP/SP changed for the variable, when you're supposed to check it for whoever you're sending info to. I assume @showsp switches "displaypartysp" variable 1/0?

 

ETA: Just a suggestion, wouldn't it be way easier to just alter sd's hp to sp if that variable is present during clif_party_hp/clif_hpmeter_single/clif_hpmeter_sub?

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

It'd cause issues down the line with battle.c for use with skills that do HP/SP ratios to calculate damage. And yeah, @showsp just switches the variable. Once this issue of updating properly is fixed, i'll just create a custom state and switch that around so as not to rely on player variables. Also i believe a player's state is reset upon relogging which is what i'd like to have this do without the need of OnPCLoginEvent.

Share this post


Link to post
Share on other sites
  • 0

Are you sure? I'd think those clifs are used only to send rightful info to client and nothing else, calculations are always done somewhere else? I just searched files for clif->party_hp/clif->hpmeter_single/clif->hpmeter_sub, and what I found didn't come from any calculations, rather informing clients of change in HP, or resending information(first party joining, changing map, and so on).

 

ETA: Also, why would battle.c rely on packet info sending if it has access right to session data for calculations?

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

Yeah, but any time a player receives damage, the client needs to update that information. By default it uses those clif->hp to do those updates, if I were to add the variable checks to those clif's it would interfere with the proper update because it would push for SP update instead. Also, it's better to use custom Clifs for modifications like this so as to not completely interfere with the way existing code works.

 

Edit: Now that I re-think about it, you could be right about just adding the check to clif->hp, but since creating new clifs doesn't impact the way it works I'll use that since it makes things easier to read when looking at the code as a whole.

Edited by GmOcean

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.