[mod] Vehicles [vehicles]

User avatar
krokoschlange
Member
Posts: 57
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange
Location: get_author_pos() ~= get_viewer_pos()

Re: [mod] Vehicles [vehicles]

by krokoschlange » Post

Nice mod but:
Bad bug:

Code: Select all

2017-06-03 16:37:37: ACTION[Server]: krokoschlange right-clicks object 2978: LuaEntitySAO at (534,26.5,506)
2017-06-03 16:37:37: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'vehicles' in callback luaentity_Step(): /home/fabian/.minetest/mods/vehicles/api.lua:190: attempt to perform arithmetic on global 'timer' (a userdata value)
2017-06-03 16:37:37: ERROR[Main]: stack traceback:
2017-06-03 16:37:37: ERROR[Main]: 	/home/fabian/.minetest/mods/vehicles/api.lua:190: in function 'object_drive'
2017-06-03 16:37:37: ERROR[Main]: 	/home/fabian/.minetest/mods/vehicles/api.lua:803: in function </home/fabian/.minetest/mods/vehicles/api.lua:801>
2017-06-03 16:37:37: ERROR[Main]: 	(tail call): ?
This happens randomly (for me it was after a few hours of playing in a world), but when it happens it happens to all cars in the world. Only way to fix is disable the mod, remove all objects and enable again.(didn't work very well, after a few new cars placed, it crashed again with the same error)
You are able to enter and leave the car, steer and even drive backwards but when you press [W] it crashes
EDIT: only happens in a certain region of the map
EDIT: seems it only happens when you are near to these blinking lights from streets 2.0.1:
Image
EDIT: thats why (I think): the blinking light also uses a global variable called timer

Code: Select all

-- Blinking Light

minetest.register_node("streets:roadwork_blinking_light_off", {
	description = "Blinking Light",
	paramtype = "light",
	paramtype2 = "facedir",
	drawtype = "nodebox",
	tiles = { "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_off.png" },
	sunlight_propagates = true,
	groups = { cracky = 1 },
	node_box = {
		type = "fixed",
		fixed = {
			{ -0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125 }, -- Base
			{ -0.1875, -0.3125, 0, 0.1875, 0.0625, 0 }, -- Light
		}
	},
	on_timer = function(pos, elapsed)
		minetest.set_node(pos, { name = "streets:roadwork_blinking_light_on", param2 = minetest.get_node(pos).param2 })
	end,
	on_construct = function(pos)
LOOK HERE >>> timer = minetest.get_node_timer(pos)
LOOK HERE >>> timer:start(1)
	end,
})

minetest.register_node("streets:roadwork_blinking_light_on", {
	description = "Blinking Light",
	paramtype = "light",
	paramtype2 = "facedir",
	drawtype = "nodebox",
	tiles = { "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_on.png" },
	sunlight_propagates = true,
	groups = { cracky = 1, not_in_creative_inventory = 1 },
	node_box = {
		type = "fixed",
		fixed = {
			{ -0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125 }, -- Base
			{ -0.1875, -0.3125, 0, 0.1875, 0.0625, 0 }, -- Light
		}
	},
	light_source = 12,
	on_timer = function(pos, elapsed)
		minetest.set_node(pos, { name = "streets:roadwork_blinking_light_off", param2 = minetest.get_node(pos).param2 })
	end,
	on_construct = function(pos)
LOOK HERE >>> timer = minetest.get_node_timer(pos)
LOOK HERE >>> timer:start(1)
	end,
	drop = "streets:roadwork_blinking_light_off",
})
EDIT: seems to be fixed when you rename the timer variable :)
Attachments
screenshot_20170603_170735.png
(866 KiB) Not downloaded yet

User avatar
DS-minetest
Member
Posts: 1141
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: DS-minetest
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod] Vehicles [vehicles]

by DS-minetest » Post

krokoschlange wrote:seems to be fixed when you rename the timer variable :)
Eh, just make the variable local. :P
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [mod] Vehicles [vehicles]

by azekill_DIABLO » Post

+1

User avatar
krokoschlange
Member
Posts: 57
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange
Location: get_author_pos() ~= get_viewer_pos()

Re: [mod] Vehicles [vehicles]

by krokoschlange » Post

DS-minetest wrote:
krokoschlange wrote:seems to be fixed when you rename the timer variable :)
Eh, just make the variable local. :P
I know, it's better :)

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

Glad it's sorted :) I will rename the timer in my mod to something less obvious, just in case there are other mods which could cause the same problem.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
DS-minetest
Member
Posts: 1141
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: DS-minetest
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod] Vehicles [vehicles]

by DS-minetest » Post

D00Med wrote:Glad it's sorted :) I will rename the timer in my mod to something less obvious, just in case there are other mods which could cause the same problem.
If the timer really has to be global, have you thought of making a global vehicles table variable and save the timer in it?
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

I don't think it has to be global.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

Robsoie
Member
Posts: 98
Joined: Fri Apr 29, 2016 16:22

Re: [mod] Vehicles [vehicles]

by Robsoie » Post

D00Med wrote:Try it now, I think I've fixed it.
Just tested newest version now with recently released 0.4.16 and it does not crash anymore when punching a car to restore it into inventory, good job !
Though not sure if it's intended, but now you need to punch it a lot of time before the vehicle disappear.

And when it disappear, it does not leave the "vehicle block" anymore to be picked, it's like it's now completely destroyed.

User avatar
krokoschlange
Member
Posts: 57
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange
Location: get_author_pos() ~= get_viewer_pos()

Re: [mod] Vehicles [vehicles]

by krokoschlange » Post

DS-minetest wrote:
D00Med wrote:Glad it's sorted :) I will rename the timer in my mod to something less obvious, just in case there are other mods which could cause the same problem.
If the timer really has to be global, have you thought of making a global vehicles table variable and save the timer in it?
D00Med wrote:I don't think it has to be global.
a local variable does the job. tested it.

User avatar
Andrey01
Member
Posts: 2416
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Vehicles [vehicles]

by Andrey01 » Post

Is work going still for new update?

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

Ok, thanks for testing guys.
Yep I'm still working on an update, I'm halfway through making a truck
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
v-rob
Developer
Posts: 779
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [mod] Vehicles [vehicles]

by v-rob » Post

Mod seems to crash every time I press E after getting to full speed. No other mods enabled, minetest version 4.16. Only happens when you reach a high speed.
GUI Core Developer | My Best Mods: Bridger - Slats - Stained Glass | To contact me, send a PM

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

Should be fixed now, I forgot to switch over the timer name for boosts.
By the way, that's a nice signature you have there xD
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
v-rob
Developer
Posts: 779
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [mod] Vehicles [vehicles]

by v-rob » Post

It works now! Thanks.
By the way, that's a nice signature you have there xD
Thanks for that, too. I like it myself, and it's very true :)
GUI Core Developer | My Best Mods: Bridger - Slats - Stained Glass | To contact me, send a PM

User avatar
mahmutelmas06
Member
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [mod] Vehicles [vehicles]

by mahmutelmas06 » Post

Could u make all cars be able to take passengers ?
My Mods:

Beverage

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

I could, but it would take away the novelty of using a ute.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
krokoschlange
Member
Posts: 57
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange
Location: get_author_pos() ~= get_viewer_pos()

Re: [mod] Vehicles [vehicles]

by krokoschlange » Post

Another really bad bug: When I get into ute as passenger it just closes the server. No debug.

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

wow ok, thanks for pointing that out, I haven't had an opportunity to test that for a while
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
krokoschlange
Member
Posts: 57
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange
Location: get_author_pos() ~= get_viewer_pos()

Re: [mod] Vehicles [vehicles]

by krokoschlange » Post

just open two windows host a server in one window and in the other one connect to ip 127.0.0.1

User avatar
Andrey01
Member
Posts: 2416
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Vehicles [vehicles]

by Andrey01 » Post

D00Med wrote:Ok, thanks for testing guys.
Yep I'm still working on an update, I'm halfway through making a truck
What about bus? I need much it! For example, they will be colorful and will have different sizes.

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

@krokoschlange oh yeah I forgot about that, thanks.
@Andrey01 I'll work on that next then.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

moi
New member
Posts: 3
Joined: Wed Jun 07, 2017 11:25
GitHub: moi
IRC: moi
In-game: moi-fr

Re: [mod] Vehicles [vehicles]

by moi » Post

Hello, I have a problem with this mod. it does not work.

2017-06-13 20:49:32: ERROR[Main]: ModError: Failed to load and run script from /home/moi/.minetest/mods/vehicles/init.lua:
2017-06-13 20:49:32: ERROR[Main]: /home/moi/.minetest/mods/vehicles/init.lua:7: attempt to concatenate a nil value
2017-06-13 20:49:32: ERROR[Main]: stack traceback:
2017-06-13 20:49:32: ERROR[Main]: /home/moi/.minetest/mods/vehicles/init.lua:7: in main chunk

What should I do ?
Help me please.

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

I'm not sure why that's happening. Were you using any other mods that could have caused a problem?
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

Picocoder
New member
Posts: 3
Joined: Sun Jun 18, 2017 01:37
GitHub: picocoder
IRC: picocoder
In-game: cricket

[mod] Vehicles [vehicles]

by Picocoder » Post

Amazing Mod!!

Although, there are a few changes that could be cool.

- Maybe a "hover" mode for the helicopters and airplanes?
- Maybe a submarine that allows for breathing underwater?
- Maybe an amphibious vehicle or two?

These are just some changes that I think would be fun, the mod is great without them.

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [mod] Vehicles [vehicles]

by D00Med » Post

Those are good suggestions, thanks! :)
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests