Money bug with the MMO template

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
neero
001 Subscriber
 
Joined: Sun Jul 18, 2010 2:46 pm
Location: Norway

Money bug with the MMO template

Postby neero » Sat Feb 04, 2017 12:13 pm

After playing a little with the MMO template, I suddenly get a script error when logging in my character. Attached a screenshot.
Using 1.0.18

It's a bit hard to reproduce, because it doesn't happen with a new character. But when it has first started to happen with a character, it happens every time when logging in.
This is the steps I have done when trying to reproduce the issue (successful reproduction 2 times):
- create new character and log in
- put on weapon and armor
- go and kill 1 enemy
- log out
- log in
- kill another enemy
- log out
- login
*error*

Mike mentioned something about commas and period. Because my locale is using comma instead of period with decimals, it may cause issues.
Attachments
001-money.png

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Money bug with the MMO template

Postby Mike » Sat Feb 04, 2017 12:14 pm

Yeah, I think when the money amount isn't a full unit of money (ie: decimals), this is where the problem lies. As with the shop/inn issue, it'll be a matter of changing some number parameters to text parameters.

User avatar
Mr.Numbers
001 Support
 
Joined: Wed Feb 28, 2007 1:50 am
Location: Alberta, Canada

Re: Money bug with the MMO template

Postby Mr.Numbers » Sun Feb 05, 2017 3:28 am

Actually Mike, that event actually DOES use the "Numbers" parameter, I feel that this is actually a legitimate bug. Perhaps you are mistaken and 001 does not properly handle foreign number systems? Perhaps it could be because this is a network message but not a custom event?
Image
I AM THE ALL MIGHTY SCRIPTING MASTER
Please do not PM me with Engine 001 related questions, rather post on the forums. ;)

User avatar
neero
001 Subscriber
 
Joined: Sun Jul 18, 2010 2:46 pm
Location: Norway

Re: Money bug with the MMO template

Postby neero » Sun Feb 05, 2017 7:11 am

I tried to figure this one out my self yesterday, but got dizzy and gave up ^^;

Everything works ok on the client, it is the server that is screwing up.

It seems the problem happens here, in the Actor template "Defeated/destroyed":
001-moneys.png

It adds it up like this: 14,62 + 8,76 = 14,628,76

I didn't find what network message that is a part of this.

The only place I found a text-thingy, was here:
001-moneys2.png

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Money bug with the MMO template

Postby Mike » Sun Feb 05, 2017 11:20 am

Yeah, that parameter could definitely cause it. If you can let me know where this addition is happening I could check it out. But it's likely a number field issue as adding money has never been a problem as long as it's numbers you're working with.

User avatar
neero
001 Subscriber
 
Joined: Sun Jul 18, 2010 2:46 pm
Location: Norway

Re: Money bug with the MMO template

Postby neero » Sun Feb 05, 2017 12:41 pm

It didn't help changing it to number, I don't think that one is used here.

The addition is happening in the Actor template (root template) "Defeated/destroyed":
001-moneys5.png

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Money bug with the MMO template

Postby Mike » Sun Feb 05, 2017 1:21 pm

Are you able to look at the before and after of the money and narrow it down to a specific issue? That way you could likely recreate the same issue in a small project. Like I said though, I'm fairly certain it's the fact that money factors are being treated as text instead of numbers, since games have been handling money locally forever.

User avatar
neero
001 Subscriber
 
Joined: Sun Jul 18, 2010 2:46 pm
Location: Norway

Re: Money bug with the MMO template

Postby neero » Sun Feb 05, 2017 2:17 pm

It's an actor variable, and not the built in money system. I assume the "reward_money" variable is treated as number, as there is a math operation just before. This leaves me with thinking the actor variable "Money" is defined as text.
This is all happening server side, but I have no clue where the server is notified that the enemy is killed. Or is it the server that is notifying the client? Then it wouldn't be any network messages involved here? I don't have a fully understanding of how everything works yet.

Got sick yesterday, so my brain isn't function very well right now. It's probably best that Mr.Numbers take a look at this. Or if he could explain more in detail how killing an enemy works, and I'll check it out when I'm back on my feet :)

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Money bug with the MMO template

Postby Mike » Sun Feb 05, 2017 5:56 pm

The solution for this one was to change the parameter for "Send Money" to use numbers instead of text.

I've also made a change to Save/Load Setting to work with numbers better.

User avatar
Mr.Numbers
001 Support
 
Joined: Wed Feb 28, 2007 1:50 am
Location: Alberta, Canada

Re: Money bug with the MMO template

Postby Mr.Numbers » Mon Feb 06, 2017 3:47 am

I have potentially(?) fixed this, as tonight I went through and made sure all parameters are of the correct type.
Image
I AM THE ALL MIGHTY SCRIPTING MASTER
Please do not PM me with Engine 001 related questions, rather post on the forums. ;)

User avatar
neero
001 Subscriber
 
Joined: Sun Jul 18, 2010 2:46 pm
Location: Norway

Re: Money bug with the MMO template

Postby neero » Mon Feb 06, 2017 11:25 am

I am not able to reproduce this issue in the new version :)


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron