[Mod] Money (or Economy) [201207] [money]

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

Does line 54 do anything?

Code: Select all

amount = amount + 0
It caused my server to crash, with this message:

Code: Select all

12:40:42: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: /home/daniel/.minetest/mods/minetest/money/init.lua:54: attempt to perform arithmetic on local 'amount' (a string value)
An innocent kitten dies every time you top-post.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

You should delete the line.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

Does your mod support adding new types of stores?

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

No. What do you mean by new types of stores?
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

Well right now your stores requires two nodes because you cant have an inventory and input field on the same meta/node. I think i have an idea for single-node stores that could work

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

This is very interesting idea, but how do it?
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

single node stores wouldn't have inventories like chests. They'd be like zip-nodes: a single node containing within 100,200, etc. of the nodetype. We could have one meta (signlike) to set the prices, and a seperate meta (not mutable) to save the remaining QTY. the QTY would be displayed in the infotext, while the prices you edit like signs.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

What will store owner do, when he want take/give the nodes from/to store?
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

It crashed again, with this message:

Code: Select all

23:26:25: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: /home/daniel/.minetest/mods/minetest/money/init.lua:64: attempt to compare string with number
It seems to crash whenever the /money command is used with a negative number.
This is the offending line:

Code: Select all

elseif amount < 0 then
Is "amount" a string? I really don't understand that command definition, sorry.
Last edited by Menche on Sat Jul 21, 2012 16:31, edited 1 time in total.
An innocent kitten dies every time you top-post.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

Replace

Code: Select all

amount < 0

to

Code: Select all

tonumber(amount) < 0

and add

Code: Select all

amount = tonumber(amount)

or

Code: Select all

amount = amount + 0

after

Code: Select all

elseif tonumber(amount) < 0 then
    minetest.chat_send_player(name, "The amount must be greater than 0.")
    return true
end
and replace

Code: Select all

(param1 and "add")
to

Code: Select all

(param1 ~= "add")
I hope there are no bugs in my mod.
Last edited by kotolegokot on Sat Jul 21, 2012 16:45, edited 1 time in total.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

kotolegokot wrote:"amount" is a number. Which command do you use?
It said "attempt to compare string with number" when it crashed. It crashed when /money pay player was used with a negative number.
An innocent kitten dies every time you top-post.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

See previous post or just download and setup mod again.
And thank you very much for your great help in fixing errors.
Last edited by kotolegokot on Sat Jul 21, 2012 16:54, edited 1 time in total.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

mauvebic, I read lua_api.txt and I know, how realize your idea!
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

NEW BIG UPDATE! (See first post)
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

Nice :-) glad you figured out the singlenode shops :-) Could you do the same thing but in barter? exchange nodes for nodes, instead of for money?

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

Thank you! Yes, I want do it in next update.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

Dont thank me, your formspec gave me an idea for my linking books, ive been looking for a way to name the books and show who they belong to :-)

If you get the barter working ill include in nullspace (with your permission) :-)
Last edited by mauvebic on Tue Jul 24, 2012 16:10, edited 1 time in total.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

What is nullspace?
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

customized game mode, with a disabled mapgen, modified and additional default mods (link here). I figure barter would come in handy on maps with extremely limited resources :-)

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

when i try to access the one node shop i get this. It opens the black square in the top left corner and that's it. any ideas?

Image

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

Try use last version of Minetest. And you should download money mod again. In a recent version of Minetest, locked chest is working on another.
Last edited by kotolegokot on Wed Jul 25, 2012 06:37, edited 1 time in total.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

installed the latest stable release 4.1 and same result. Also using the github version of the mod link.

running ubuntu 64 bit if it helps.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

I think I fix the error.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

User avatar
kotolegokot
Member
Posts: 131
Joined: Mon Jul 02, 2012 17:03
Location: Russia, Ishim

by kotolegokot » Post

Added barter shop. See first post.
I'm creator of these mods: Locked sign, Locked furnace, Money. And I'm a developer of The RealTest Game.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

+1

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests