[Mod] Laptop (WIP) (V. 0.39)

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

The Laptop OS does use Nodemeta for data storage and for formspecs. So the OS requires a node to work (=Hardware). To open Nodemeta's formspec without right-click is not possible.
But I think you do not need the full framework for your game or concept. What do you need? Just a framework: you can use smartfs. My smart_inventory does use smartfs for example.

The Theming: themes.lua could be used in other projects slightly modified.

The "Window Manager" Stack? Ok, this needs to be written new, optimized to your needs.

I am the author of Laptop-OS and may can help you to port some functionalities to your project. Just mention me in a github issue and I look if I can help you.

vtwindsurfer
Member
Posts: 10
Joined: Sun Oct 01, 2017 14:57
Location: Vermont, USA

Re: [Mod] Laptop (WIP) (V. 0.39)

by vtwindsurfer » Post

A strange bug popped up for me recently. I've been using this mod for a while and I have not made any changes or updates recently. When I try to print a document, my server crashes with the following:

Code: Select all

2018-10-28 12:19:13: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop' in callback node_on_receive_fields(): /usr/share/minetest/builtin/common/misc_helpers.lua:597: attempt to concatenate local 'color' (a nil value)
2018-10-28 12:19:13: ERROR[Main]: stack traceback:
2018-10-28 12:19:13: ERROR[Main]: 	/usr/share/minetest/builtin/common/misc_helpers.lua:597: in function 'get_color_escape_sequence'
2018-10-28 12:19:13: ERROR[Main]: 	/usr/share/minetest/builtin/common/misc_helpers.lua:606: in function 'colorize'
2018-10-28 12:19:13: ERROR[Main]: 	...netest/mods/minetest-laptop-master/apps/os_print_app.lua:220: in function 'formspec_func'
2018-10-28 12:19:13: ERROR[Main]: 	..._server/.minetest/mods/minetest-laptop-master/app_fw.lua:11: in function 'get_formspec'
2018-10-28 12:19:13: ERROR[Main]: 	...st_server/.minetest/mods/minetest-laptop-master/mtos.lua:349: in function 'set_app'
2018-10-28 12:19:13: ERROR[Main]: 	...st_server/.minetest/mods/minetest-laptop-master/mtos.lua:406: in function 'print_file_dialog'
2018-10-28 12:19:13: ERROR[Main]: 	...test/mods/minetest-laptop-master/apps/stickynote_app.lua:76: in function <...test/mods/minetest-laptop-master/apps/stickynote_app.lua:33>
2018-10-28 12:19:13: ERROR[Main]: 	..._server/.minetest/mods/minetest-laptop-master/app_fw.lua:36: in function 'receive_data'
2018-10-28 12:19:13: ERROR[Main]: 	...st_server/.minetest/mods/minetest-laptop-master/mtos.lua:370: in function 'pass_to_app'
2018-10-28 12:19:13: ERROR[Main]: 	...er/.minetest/mods/minetest-laptop-master/hardware_fw.lua:61: in function <...er/.minetest/mods/minetest-laptop-master/hardware_fw.lua:59>
Strange because it only happens to certain computers in certain locations (not all of them, at least, not yet). I've rebooted the server, reinstalled the mod but the problem persists. I don't really know lua but I'm slowly learning but I don't even know where to start with this so I figured I'd ask the experts. Does anyone know what the problem is? Is there anything I can do to fix it?

User avatar
StarNinjas
Member
Posts: 332
Joined: Wed Mar 14, 2018 00:32
GitHub: starninjas
IRC: StarNinjas
In-game: J1
Location: aincrad

Re: [Mod] Laptop (WIP) (V. 0.39)

by StarNinjas » Post

GA is not here right now he is at USA Army boot camp he will be back soon but maybe bell07 could help.

-J1

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

Thank you for the bug report. Found the issue with printer app and "Printer removed" Status. Fixed in GA and my fork github repo

MHL
Member
Posts: 345
Joined: Mon Aug 20, 2018 00:44
GitHub: NOT APPLICABLE
IRC: NOT APPLICABLE
In-game: singleplayer
Location: Somewhere in SSWZ
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by MHL » Post

Nice mod
COME SEE MY MINETEST MAP!!!

COME SEE MY MINETEST MAP!!!


User avatar
GamingAssociation39
Member
Posts: 845
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Laptop (WIP) (V. 0.39)

by GamingAssociation39 » Post

migdyn wrote:Nice mod
Thanks but all credit goes to Bell07
Jesus Is Lord and Savior!!!

Isja Krass
Member
Posts: 46
Joined: Sat Aug 18, 2018 19:30
In-game: init.lua
Location: {X=25.25, y=-400, z=478,8} Bavaria, Germany

Re: [Mod] Laptop (WIP) (V. 0.39)

by Isja Krass » Post

maybe you can add Servers, that can do different thigs.

for example:
[*] mailserver: players can write E-Mails
[*] mediaserver: players can listen to some music
[*] gameserver: players can play minigames together
[*] bank-account server: a onlinebanking server for the currency mod
[*] cloud server: data storage

serves should be placeable and amenable like digiline-cannels.
my topics | profile | contact me | nothing else to say...

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

I've run into an error when using the "item_drop" mod.

I had players report to me that they could infinitely duplicate computers ("laptops") by placing a computer and punching it to pick it back up. It instantly adds the computer to inventory but also drops another computer in the world. I haven't looked at the source for this mod yet, but I'd suspect that it is manually adding it to inventory somehow but the item_drop mod is likely overriding default behavior in MT.

I was able to reproduce the issue myself with a test user account with basic privs. It doesn't occur with an admin account in creative. I haven't experienced this with any other nodes/items in my server yet. I've used a large number of mods with item_drop too.

I gave three players one cp core laptop each only to find that they had tiled the floor of their patio with about two dozen laptops.

EDIT: I eventually fixed this by disabling item_drop_on_dig or whatever its called fro the item_drop mod.
Last edited by FreeGamers on Sun Jul 28, 2019 17:58, edited 1 time in total.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

FaceDeer
Member
Posts: 472
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Laptop (WIP) (V. 0.39)

by FaceDeer » Post

Hi, I just posted an initial alpha version of a new mod called commoditiesmarket and I'm told it might serve as a useful component for this mod to incorporate or call upon so I figured I should comment here. Currently there's just a simple "show_market" API to pop open a formspec for a given market, I can add more hooks if desired to make it easier to use by this mod or other similar frameworks. I haven't tried out this mod myself before so I don't know what it's interface is like.

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

I am trying to integrate the commoditymarket mod as an app into Laptop but I am having trouble passing a simple name of the current player to the function. Can someone help?

Code: Select all

laptop.register_app("ecommerce", {
	app_name = "eCommerce",
	app_icon = "commoditymarket_gold_coins.png",
	app_info = "Online Commodity Market",
	formspec_func = function()
	local name = (mtos.sysram.current_player)
		commoditymarket.show_market("kings", name)
	end,
})
2020-05-20 02:00:29: WARNING[Server]: Undeclared global variable "mtos" accessed at ..._simple_survival_game/mods/laptop/apps/ecommerce_app.lua:6
2020-05-20 02:00:29: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop' in callback node_on_receive_fields(): ..._simple_survival_game/mods/laptop/apps/ecommerce_app.lua:6: attempt to index global 'mtos' (a nil value)
2020-05-20 02:00:29: ERROR[Main]: stack traceback:
2020-05-20 02:00:29: ERROR[Main]: ..._simple_survival_game/mods/laptop/apps/ecommerce_app.lua:6: in function 'formspec_func'
2020-05-20 02:00:29: ERROR[Main]: .../games/saras_simple_survival_game/mods/laptop/app_fw.lua:11: in function 'get_formspec'
2020-05-20 02:00:29: ERROR[Main]: ...st/games/saras_simple_survival_game/mods/laptop/mtos.lua:373: in function 'pass_to_app'
2020-05-20 02:00:29: ERROR[Main]: ...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:61: in function <...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:59>
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

@FreeGamers. You forgotten the formspec_func parameters

Code: Select all

formspec_func = function(app, mtos)
In case no current agent assigned you need to handle the mtos.sysram.current_player is empty.
You can look into the mail_app how I did it

Code: Select all

		if not mtos.sysram.current_player then
			mtos:set_app() -- no player. Back to launcher
			return false
		end

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

All this app really needs to do is pass a playername to commoditymarket and call the function from that mod. I've tried copying some of those functions from the mail app before and it ended with more errors. I spent a few hours last night working on this (before I posted here initially) and was getting pretty confused. I'm still learning... this is what I've ended up with now.

I've addede the receive_fields_func because I was getting some errors mentioning it. This is what I currently have now. Still crashes when the app is called.

Code: Select all

laptop.register_app("ecommerce", {
	app_name = "eCommerce",
	app_icon = "commoditymarket_gold_coins.png",
	app_info = "Online Commodity Market",
	formspec_func = function(app, mtos)		
	
	-- No player, so go back to the app launcher
		if not mtos.sysram.current_player then
			mtos:set_app()
			return false
		end	

	-- Declare variable used to hold the player name for commoditymarket function.
		local name = (mtos.sysram.current_player)
		commoditymarket.show_market("kings", name)

	-- End the formspec_func function.	
	end,
	
	receive_fields_func = function (app, mtos)

	-- if the player changed, return to app launcher.		
		if mtos.sysram.current_player ~= mtos.sysram.last_player then
			mtos:set_app() -- wrong player. Back to launcher
			return
		end

	-- End the receive_fields_func.	
	end,
})
2020-05-20 09:51:36: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop' in callback node_on_receive_fields(): .../games/saras_simple_survival_game/mods/laptop/app_fw.lua:28: attempt to concatenate local 'app_result' (a nil value)
2020-05-20 09:51:36: ERROR[Main]: stack traceback:
2020-05-20 09:51:36: ERROR[Main]: .../games/saras_simple_survival_game/mods/laptop/app_fw.lua:28: in function 'get_formspec'
2020-05-20 09:51:36: ERROR[Main]: ...st/games/saras_simple_survival_game/mods/laptop/mtos.lua:373: in function 'pass_to_app'
2020-05-20 09:51:36: ERROR[Main]: ...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:61: in function <...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:59>
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

@FreeGamers, the formspec_func needs to return any formspec string (or false).

Try something like

Code: Select all

	local market = commoditymarket.registered_markets["kings"]
	if market == nil then return end
	local formspec = market:get_formspec(market:get_account(player_name))
	return formspec or false
Code taken from commoditymarket.show_market() function

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

I'm going to stop working on this. I no longer think integrating commoditymarket into the laptop apps works for my game (balance breaking in terms of inventory accessibility in survival) and I don't want to invest additional time into this when I have many other bugs to try to fix and features to implement.

I think getting these two mods to work together would really provide a powerful way to access markets. I think this greatly increase the value of the laptop as well as the ease of access for a market to many players.

I use commoditymarket on my survival game and players don't seem to use it as much as I thought they would. Smartshops (a vending machine) still are much more common. I'm not exactly sure why that is (probably complexity and availability), but I initially wanted to implement these two mods as an eCommerce app to make both of these mods more used.

However for survival purposes, I think the exploitation of holding items in the market as additional inventory storage could backfire. This could probably de-incentized easily with storage limits or listing fees.

bell07, I'm going to pause on this for right now. I could not figure out how to make it work. I am extremely grateful for your assistance on this.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

User avatar
jolotico
New member
Posts: 7
Joined: Thu Jul 11, 2019 17:36
GitHub: jolotico
In-game: julito

Re: [Mod] Laptop (WIP) (V. 0.39)

by jolotico » Post

How can I install the minebrowser-sites to make it work?

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests