[Mod] Car extension for StreetsMod (ALPHA)[cars]

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

[Mod] Car extension for StreetsMod (ALPHA)[cars]

by webdesigner97 » Post

Please note: This mod is abandoned. A new project ("vehicles") has been created @GitHub

Hello everyone,
although there are already some car mods, I release the indev version of my very own one. It does not base on other mods, like boats or hovercraft; it was coded completely by me.
Using melkor's car01 model, it focusses on realistic physical behaviour. Well, at least it will do this one day (it isn't perfect yet). The goal is to improve them step by step and once the mod works well, it will be added to my StreetsMod.

Spawn the car using /spawnentity streets:melcar

Licenses:
./models : CC-BY-NC-SA
Code: CC-BY-SA

Download:
Github Repo
Download zip from GitHub

Image
Two Melcars meeting at an intersection

Image
Driver's perspective

The cars:

Melcar:
Image
Maximimum speed: 35 n/s = 126 kn/h (nodes/second; kilonodes/hour)
Acceleration Factor: 6.25
Deceleration Factor: 4.5
BrakeFactor: 9
Stepheight: 0.5
Gears: automatic (N, D (R)) <- not yet available

Videos[{U]


(Might not be up-to-date)
Riding a Melcar (May 19, 2014)
Rubenwardy riding a melcar (May 17, 2014)
Last edited by webdesigner97 on Thu Feb 02, 2017 19:24, edited 12 times in total.

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

Testing now. :) I'm glad to see you got through with this.

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

philipbenr wrote:Testing now. :) I'm glad to see you got through with this.
Yes, I am very very proud. Sometimes, the car goes crazy, but at least it drives :D

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

by philipbenr » Post

Problem: how do I enable? I have tried many different ways....

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

philipbenr wrote:Problem: how do I enable? I have tried many different ways....
Oops, forget to explain that... I'll add it to first post :O

i love minetest
Member
Posts: 13
Joined: Thu Nov 28, 2013 15:17
Location: uk
Contact:

by i love minetest » Post

it won't load or run the mod what should it be named as
if you need any more information please don't hesitate to pm me or email me

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

i love minetest wrote:it won't load or run the mod what should it be named as
This mod is indev. I wouldn't suggest you using it XD

Anyway, unzip it into the mods directory; rename it 'cars'.

Now fire up minetest, go to the mod config, enable this mod, open your world, type /spawnentity streets:melcar

If it works, gimme a high five.

---------------------------------------------------------------------------------

I checked out the code. It is the neatest code I've ever seen for a mod XD. Great work!

In https://github.com/webdesigner97/cars/b ... t.lua#L166 , you might want to set the deceleration rate by checking which block it is on. You could try setting a higher decel rate for stuff like sand and a lower one for asphalt.

And in here: https://github.com/webdesigner97/cars/b ... t.lua#L139
You could try changing the acceleration vector's angle, or add a perpendicular vector to the acceleration vector.
Last edited by hoodedice on Fri Dec 06, 2013 06:13, edited 1 time in total.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

hoodedice wrote:
i love minetest wrote:it won't load or run the mod what should it be named as
This mod is indev. I wouldn't suggest you using it XD

Anyway, unzip it into the mods directory; rename it 'cars'.

Now fire up minetest, go to the mod config, enable this mod, open your world, type /spawnentity streets:melcar

If it works, gimme a high five.

---------------------------------------------------------------------------------

I checked out the code. It is the neatest code I've ever seen for a mod XD. Great work!

In https://github.com/webdesigner97/cars/b ... t.lua#L166 , you might want to set the deceleration rate by checking which block it is on. You could try setting a higher decel rate for stuff like sand and a lower one for asphalt.

And in here: https://github.com/webdesigner97/cars/b ... t.lua#L139
You could try changing the acceleration vector's angle, or add a perpendicular vector to the acceleration vector.
Yes, different decels for differetn nodes are planned. And thx for the compliment :D All this vector stuff is quite new to me and I think I need to learn a lot about it, but one day this will be a real working car mod.

Edit: The interesting part of this mod is that I can try to use what I learned in my physics class :D
Last edited by webdesigner97 on Fri Dec 06, 2013 11:02, edited 1 time in total.

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

The interesting part of this mod is that I can try to use what I learned in my physics class :D
=D How did you guess I knew about vectors on my end? Physics ofcourse!
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

Wow, that's a nice car!
Would it be possible to change the yaw of a player too while pressing left or right?
Irritates me a bit when only the car turns, but not me :3
Last edited by Krock on Fri Dec 06, 2013 12:56, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

Krock wrote:Wow, that's a nice car!
Would it be possible to change the yaw of a player too while pressing left or right?
Irritates me a bit when only the car turns, but not me :3
Sure, will be added as soon as the physics work :)

i love minetest
Member
Posts: 13
Joined: Thu Nov 28, 2013 15:17
Location: uk
Contact:

by i love minetest » Post

webdesigner97 wrote:
hoodedice wrote:
i love minetest wrote:it won't load or run the mod what should it be named as
This mod is indev. I wouldn't suggest you using it XD

Anyway, unzip it into the mods directory; rename it 'cars'.

Now fire up minetest, go to the mod config, enable this mod, open your world, type /spawnentity streets:melcar

If it works, gimme a high five.

---------------------------------------------------------------------------------

I checked out the code. It is the neatest code I've ever seen for a mod XD. Great work!

In https://github.com/webdesigner97/cars/b ... t.lua#L166 , you might want to set the deceleration rate by checking which block it is on. You could try setting a higher decel rate for stuff like sand and a lower one for asphalt.

And in here: https://github.com/webdesigner97/cars/b ... t.lua#L139
You could try changing the acceleration vector's angle, or add a perpendicular vector to the acceleration vector.
Yes, different decels for differetn nodes are planned. And thx for the compliment :D All this vector stuff is quite new to me and I think I need to learn a lot about it, but one day this will be a real working car mod.

Edit: The interesting part of this mod is that I can try to use what I learned in my physics class :D

yay it worked ps how do I delete it
if you need any more information please don't hesitate to pm me or email me

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

i love minetest wrote: yay it worked ps how do I delete it
The ride? Keep punching it. To see the remaining health it has, watch the debug console.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
qwrwed
Member
Posts: 326
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Post

hoodedice wrote:To see the remaining health it has, watch the debug console.
Or press F5 (and look at the car).

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

As already said, this mod is not meant to be used on "real" worlds. It isn't finished ^^

neron
Member
Posts: 82
Joined: Sat Dec 22, 2012 20:22

by neron » Post

Any new updates to this awesome mod?

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

neron wrote:Any new updates to this awesome mod?
Currently not, but pls don't think it's dead. I just don't have the time to continue at the moment...

jacobwellz
New member
Posts: 8
Joined: Sat Apr 12, 2014 15:08

by jacobwellz » Post

Wornt work just says fails to run or load and if I change it to cars the file when it's loading it just quits me please help

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

Although the mod is quite unstable, crashes should not appear. Can you provide a full error message from the debug.txt?

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

Re: [Mod] Car extension for StreetsMod (indev, unstable)[car

by webdesigner97 » Post

Update, Update!

The first alpha version (Download from GitHub) is available for public testing. Please don't use this in your "real playing worlds", it might cotain bugs.

What changed?
-> Rework acceleration to not use self.object:setacceleration() which caused odd behaviour
-> Remove gears and RPM
-> Tweaked Physics
-> Added a HUD

Please feel free to test it and please report bugs here or in the GitHub Repo, thanks!

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

Re: [Mod] Cars for StreetsMod (TESTERS NEEDED)[cars]

by webdesigner97 » Post

Update to master: Added automatic gears (D, N). R coming soon.

Download latest Zip to check it out.

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

by webdesigner97 » Post

Fixed car driving in wrong direction. I calculated the speed vector in a method that only works with degrees, but Minetest uses radians.

Fun fact: A melcar needs 8.5 nodes to stop from high speed.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

by rubenwardy » Post

Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

by webdesigner97 » Post

rubenwardy wrote:I made a video.

https://www.youtube.com/watch?v=jRZ9gtHWqlc
Really cool! I'll add it to first post later (with credits!)

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

by Jordach » Post

I figured out something with the cars moving if you have multiple out:

Use

Code: Select all

 local variablename = "string text or number"
Once the variables are local, they will NOT ACT AND INTERFERE WITH OTHER CARS OF THE SAME COLOUR!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests