Closed VanessaE closed 8 years ago
Ye Gods! Someone uses this mod on their server! And that someone is "famous"! ;)
Since it uses (mostly) the same code, do you have a problem if I convert this whole mess over to use my lib_mount mod? I really dislike code duplication. I will make these fixes first though as lib_mount will need added robustness before it is ready to handle mobs/vehicles/whatever else you care to ride.
Always happy to hear any suggestions you have.
It wouldn't bother me any, since it's not my code or models being put to use anyway. :stuck_out_tongue_winking_eye: Seems like a good idea in fact.
Also as a side note, seems @paramat added a fourth "paint job" to his microcars mod since your derivation came about. Might want to consider integrating that update.
F1 and 126r done. CAR01 is not an easy one to deal with. The model is offset and the collision box rotates around this offset 'center'. I can easily fix the model and do various adjustments to the player position and eye_offset but the car texture gets all funked up. I am not good with Blender Uvmap/texture stuff. If I fix the model do you know someone who can fix the textures?
Edit: I pushed up the best I can do without fixing the model. God help any passenger... they might end up breathing wall.
The offset is just because the object's origin is misplaced, and the code is trying to compensate for it. This pull request should fix it: https://github.com/blert2112/vehicle_mash/pull/3
Along with this is a rewrite of how the various CAR01 cars are defined, so that they can all start from the same base definition.
EDIT: I had to make a few attempts to catch all of the CAR01 vehicles, that was the reason for the (now deleted) message regarding what I thought was an engine bug. :-) It seems to be all sorted out now.
Meanwhile, I really wish Minetest could rotate the collision box to follow the entity. :confused:
I added the 'Car55' texture, a car for Celeron55.
Thank you for fixing the CAR01 model. :) I added Paramat's yellow mesecar and updated all his images. I am not a fan of global objects in Lua so I changed what you provided to use locals. There is a small problem I am having with the mesecars, they are driving sideways. Had this problem before but can't remember where, when, or why. Tweaked all speed/braking/turning values.
The sideways cars happened to me when I edited the CAR01 model - I think on exporting, blender swapped which direction in the .x file corresponded with which direction in Minetest, so I just rotated the frickin' thing to avoid any further issue. :smile:
Oh when turning, it might be a good idea, when the yaw is close enough to a 45 degree increment (say within a couple of degrees either way), to snap exactly to the 45 degree increment, so that the player doesn't have to repeatedly adjust their heading when going down long, straight roads.
Blender confuses me greatly. Some information just doesn't get imported so Blender seems to fill in the blanks with it's defaults. The Mesecars are not models though, they are "cubes" so I can't just rotate the model. No worries though, soon enough I will figure it out, I am updating the 'driving' code so it will get worked out. I can try to add 45 degree snaps but it might introduce a case of the jerks and make it difficult to control when trying to break out of a snap target.
I have converted this mod over to use the lib_mount mod instead of it's own control code. It is working well but in so doing I found the reason the Mesecar was driving sideways... my code was borked in places. I fixed it and now the Mesecar work great. One problem I had now was the other cars were now driving sideways. I had previously rotated the F1 and 126r models so I went in to Blender and changed the rotation again. I went in to rotate the CAR01 model back but, again, I can't get the texture to work. Would you please rotate the CAR01 model back to work with this new code... see the "model_rotation_fix" branches of this mod and the "model_rotation_fix" (not a typo, I named the branches the same) of the lib_mount mod. If you have time to do this I would greatly appreciate it. (Or tell me the secret so I can do it.)
Load the model, rotate it, then go into Edit Mode and select all polys. Press Ctrl-N. If the car suddenly gets dark and bluish, press Shift-Ctrl-N once or twice until the whole thing is properly light-colored like the cube Blender starts with.
Go into Object mode, right click the model (so that it's the only thing selected) and export it.
(apologies if you already know what those functions do :smile:)
Didn't work. I tried your steps to fix it but I still ended up with a fubar texturing. No biggie, I added a tiny bit of code to compensate. I have everything done that you have asked for except snapping, that's going to take some work. I need to check over the collision boxes and some minor details and I will push the updates. Probably tomorrow.
Wow, you make it sound like a work assignment! heh :smile: Glad you're able to get things sorted out, sorry that model didn't work.
Ok, it seems like everything is working nicely. If you crash while driving too fast you will be automatically detached, your car will be destroyed, and you will take damage. Requires lib_mount.
sweet! :smile:
Something else I noticed, if you hold the spacebar for a second or two, the mod switches the CAR01 model into a mode where your view yaw is locked to the yaw of the car. You might want to consider making that the default for all of the cars. It's just that useful. :)
I always disliked that mode. It was always quite jerky. I am now using the spacebar for flight but let me see if I can shoehorn that feature back in and smooth it out some.
Oops! Passengers are currently disabled. I forgot to add that code. I'll have it fixed later this evening.
Hmm, I guess it is in. Time to fire up the server and see if it works.
It doesn't quite work. A passenger can get in, but then he or she has control of the car, and I as the driver can't get out or destroy the car. I have to sign off to get out. At least, for the CAR01 model.
Also, sometimes I see cars sliding sideways - looks like there's a directional variable or something getting shared between the different kinds of cars.
Poop! My reef tank lighting system is currently in pieces all over the dinning room table. If I don't rebuild it soon my wife is going to kill me. I will get to these issues as soon as I can.
Ok, got the power and control system back together and reprogrammed, that's enough for one night. I took a look at the sideways problem... it is with lib_mount. The sideways moving cars should be fixed now. You were right, it was because of a shared variable. Both vehicle_mash and lib_mount got a lot of changes that I forgot to commit last week so update both (and mobs_horse if you use it). Looking into the passenger problem after a snack.
I believe it to be fixed... passenger cannot drive, driver can exit car, only owner can drive, only owner or player with the protection_bypass priv can "pick up", owner is determined by placer
updates to both vehicle_mash and lib_mount (and horse)
typo on init.lua line 129:
loadfile(mpath.."/mese_Yellow.lua")(table.copy(mesecar_def))
^
Should be a lowercase "y", PR #5.
I've found a few relatively minor usability issues in this mod:
Some users are complaining that the car is hard to drive - I think this can be mostly solved by the above changes to the braking distance and collision box, mostly so that vehicles can turn corners easier at speed, and handle narrow roads better.