Bug with shop in 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

Bug with shop in MMO template

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

When I activate the merchant, I get a "Type mismatch" error. Attached a screenshot.

My locale is using commas instead of periods for decimals, which may be the cause.
Attachments
001-shop.png

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

Re: Bug with shop in MMO template

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

Ah, yes, this is because the shop buy/sell factors are text parameters instead of number parameters. "0.5" and "0,5" mean the same thing depending on the system. Mr.Numbers will be able to fix this fairly easily.

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

Re: Bug with shop in MMO template

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

You can fix this by changing the buy/cost factor to be "Number" parameters in the "Show Shop" custom event AND the "Send Show Shop" network message:
Image

(Will be fixed in next release, thanks for reporting!)
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: Bug with shop in MMO template

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

Still the same error. I also changed the "NP_Sell_Value_Factor" to number, but it didn't help.

If I change this variable from 0.5 to 0,5 in the script debugger, the shop opens:
001-moneys3.png


001-moneys4.png

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

Re: Bug with shop in MMO template

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

Yeah, you'll need to re edit the sxripts that calls to both of those so the number is registered as a number parameter and it isn't remaining still as text. It's like adding a new parameter. Right now it'll have quotes.

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

Re: Bug with shop in MMO template

Postby neero » Sun Feb 05, 2017 1:09 pm

I got it working, but I have theories of multiple bugs that does not reside with the template.

1. Changing a parameter from text to number after it has already been set as text does not work. It looks good in the GUI, but behind the scenes it still is text.
2. <please ignore this one>

Edit:
The second "bug" was me goofing, so I removed it.

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

Re: Bug with shop in MMO template

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

Changing the parameter to number is one step. You need to re edit every call to it and make sure any manually inputted values are re written. Use values will work just fine, as long as the use value / variable isn't already text.

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

Re: Bug with shop in MMO template

Postby neero » Sun Feb 05, 2017 1:33 pm

Ah, I see.... It doesn't update in the scripts where you have used it. I guess that makes sense.
I deleted the parameters and re-set them in the scripts to get it working. I see now that I wouldn't have needed to delete them, I could just have re-set them.

Sorry, didn't get you the first time you said it ^^;

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

Re: Bug with shop in MMO template

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

You'll be able to distinguish a constant text or constant number when you hover your mouse over the node. If it has quotes it's text, and if it's just the number, it's saved as an actual number and will work on all platforms.

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

Re: Bug with shop in MMO template

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

In the script editor? I don't see that
001-stuffssss.png

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

Re: Bug with shop in MMO template

Postby Mike » Sun Feb 05, 2017 3:11 pm

Those are not constants and do not need to be changed; those are variables which, if the original variable is text, will be forcibly turned into a number (which is system-dependent).

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

Re: Bug with shop in MMO template

Postby Mr.Numbers » Sun Feb 05, 2017 4:19 pm

The script is located inside the shopkeeper actor template under NPC group. K the code for opening the shop is inside the actor activated trigger.
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
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: Bug with shop in MMO template

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

Yep - all figured out now :D !

It simply required changing the "Show Shop" custom event to take in numbers instead of text, and adjusting the "Shopkeeper" actor template's script appropriately to use a constant number rather than a constant text.

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

Re: Bug with shop in MMO template

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

Just to confirm, I do not have this issue in the new version of the template.


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron