Spodii / netgore

Cross platform online rpg engine using C# and SFML
http://www.netgore.com/
40 stars 16 forks source link

Item Tooltips #373

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There is a major bug about the weapons and armor.

when you create a new items, on the server side everything work fines, but when 
you put your cursor above it, the tooltip is showing the stats and all the 
STATS are missing.

I mean Str, Agi, MinHit, MaxHit etc...

I've seen that all the other stats on the items are synchronizing on the IO but 
not these...

anyone could fix this?

I guess, I should just put them as normal stats like the other cause they work 
fine. 

Original issue reported on code.google.com by volko...@hotmail.com on 25 Apr 2013 at 6:33

GoogleCodeExporter commented 9 years ago
I finally had some time to look at this again. I think I've cracked it, give me 
a few days and I'll try and commit a solution to this :).

Original comment by darksumm...@gmail.com on 4 Aug 2013 at 7:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I won't be committing any changes but the cause of this bug is due to the 
[NetGore.SyncValueAttribute()] not being set on the stat collections therefore 
all stats defaulting to 0 and not showing on the tooltips.

Original comment by darksumm...@gmail.com on 6 Aug 2013 at 6:17

GoogleCodeExporter commented 9 years ago
So would the way to solve it be to not using stat collections for the stats? Or 
is there someway to add the [NetGore.SyncValueAttribute()] to the stat 
collections?

Original comment by pamm...@gmail.com on 12 Aug 2013 at 11:36

GoogleCodeExporter commented 9 years ago
No - statcollections are there for a reason.
This is what I thought but wasn't sure of whether the sync attribute could be 
added to collections. I asked Spodi but I've not received a reply yet.
Instead of relying on the sync, I created my own manual way of showing stats to 
the client.

Original comment by darksumm...@gmail.com on 12 Aug 2013 at 12:17

GoogleCodeExporter commented 9 years ago
I've created other stats on the character that doesn't use these stats anymore.
Until a better fix is done, cause I am trying to make my game balance with the 
Mobs, quests... can't wait for a fix in 5 months :P

What did you do dark for this trouble?

Original comment by volko...@hotmail.com on 12 Aug 2013 at 1:39

GoogleCodeExporter commented 9 years ago
My fix (which I might as well commit at this rate xD), was manually sending the 
StatCollection over to the client via the normal BitStream approach. Issue 
solved :).
However, I wanted other people to realise this and learn something ;).

Original comment by darksumm...@gmail.com on 12 Aug 2013 at 7:21

GoogleCodeExporter commented 9 years ago
Did you have to code your own read function for stat collections? I've found I 
can write stat collections, but can't seem to find the corresponding read 
function.

Original comment by pamm...@gmail.com on 13 Aug 2013 at 9:52

GoogleCodeExporter commented 9 years ago
If you look at the write method, you will see that it actually loops through 
each relevant (non zero) stat. So the answer is there - all you have to do is 
loop through the total sent (which it sends via a byte datatype) and read each 
stat.

I've basically explained the whole thing now, oh well :P

Original comment by darksumm...@gmail.com on 13 Aug 2013 at 12:12

GoogleCodeExporter commented 9 years ago
Ok, well I solved it now, but my fix is very hacky it seems. My read method 
converts them into the KeyValue<StatType, int> collection that the client 
expects but it doesn't add the zero stats, so sometimes returns null.. so I had 
to test for null in the tool tips.

Original comment by pamm...@gmail.com on 13 Aug 2013 at 12:37

GoogleCodeExporter commented 9 years ago
That's not right at all :( If you follow my comments correctly, it will work 
perfectly. Talk on the forums or message me to carry this conversation further.

Original comment by darksumm...@gmail.com on 13 Aug 2013 at 3:00