1. Post #41
    Gold Member
    MrWhite's Avatar
    March 2010
    3,607 Posts
    So basically now, you have a working 1/10 reduction scripted gearbox which works without spazz?

    Oh you, I'll do anything to get that ;)
    I mean, I'll just post the code here, since it's not that complicated. I'm not going to post the exact code I used for that truck, since it was about twice as long, controlled the steering and brakes as well, and was much more poorly written. There's still some slip so it's not a constant 1/10, but it works well enough for a transmission.
    Code:
    @name E2 Transmission
    @inputs [Engine OutputShaft]:entity ShiftUp ShiftDown
    @outputs Gear RPM Ratio Force
    @persist Ratios:table Force Modifier RelativeForce
    @trigger ShiftUp ShiftDown
    
    if(changed(ShiftUp)&ShiftUp&Gear<Ratios:count()){Gear++, soundPlay(0,0,"/engines/trans/default_shift.wav")}
    if(changed(ShiftDown)&ShiftDown&Gear>-1){Gear--, soundPlay(0,0,"/engines/trans/default_shift.wav")}
    runOnTick(1)
    
    Ratios=table(0.1,0.5,1.25,2)
    RelativeForce=50
    
    RPM=abs(OutputShaft:angVel():yaw()/360*60)
    Force=(OutputShaft:angVel():yaw())-(sign(Gear)*Ratio*Engine:angVel():yaw())
    Ratio=Ratios[abs(Gear),number]
    Modifier=sign(Gear)*RelativeForce/Ratio
    
    Engine:applyTorque(vec(0,0,Force*Modifier*Ratio))
    OutputShaft:applyTorque(vec(0,0,-sign(Gear)*Force*Modifier))
    Of course, all you have to do is increase the weight on the engine crankshaft and the output shaft connected to the drive wheels. That will let you increase the RelativeForce, which will ultimately give you less slip and better response. Just note that both of the props that end up getting linked and wired into the expression should rotate on their respective local Z axis, or you'll have to change around lines 15, 19, and 20 and maybe line 14 to properly detect the correct axis of rotation.

    It's pretty simple once you get to understand it.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  2. Post #42
    Quality over quantity.
    Unslinga's Avatar
    August 2010
    885 Posts

    My WIP beetle.

    I mean, I'll just post the code here, since it's not that complicated. I'm not going to post the exact code I used for that truck, since it was about twice as long, controlled the steering and brakes as well, and was much more poorly written. There's still some slip so it's not a constant 1/10, but it works well enough for a transmission.
    Code:
    @name E2 Transmission
    @inputs [Engine OutputShaft]:entity ShiftUp ShiftDown
    @outputs Gear RPM Ratio Force
    @persist Ratios:table Force Modifier RelativeForce
    @trigger ShiftUp ShiftDown
    
    if(changed(ShiftUp)&ShiftUp&Gear<Ratios:count()){Gear++, soundPlay(0,0,"/engines/trans/default_shift.wav")}
    if(changed(ShiftDown)&ShiftDown&Gear>-1){Gear--, soundPlay(0,0,"/engines/trans/default_shift.wav")}
    runOnTick(1)
    
    Ratios=table(0.1,0.5,1.25,2)
    RelativeForce=50
    
    RPM=abs(OutputShaft:angVel():yaw()/360*60)
    Force=(OutputShaft:angVel():yaw())-(sign(Gear)*Ratio*Engine:angVel():yaw())
    Ratio=Ratios[abs(Gear),number]
    Modifier=sign(Gear)*RelativeForce/Ratio
    
    Engine:applyTorque(vec(0,0,Force*Modifier*Ratio))
    OutputShaft:applyTorque(vec(0,0,-sign(Gear)*Force*Modifier))
    Of course, all you have to do is increase the weight on the engine crankshaft and the output shaft connected to the drive wheels. That will let you increase the RelativeForce, which will ultimately give you less slip and better response. Just note that both of the props that end up getting linked and wired into the expression should rotate on their respective local Z axis, or you'll have to change around lines 15, 19, and 20 and maybe line 14 to properly detect the correct axis of rotation.

    It's pretty simple once you get to understand it.
    What do you recommend the Engine and the OutputShaft to weigh? last time I tried to use this (previous version I think but different ratios) it kept spazzing on me...
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Optimistic Optimistic x 1 (list)

  3. Post #43
    Gold Member
    MrWhite's Avatar
    March 2010
    3,607 Posts
    Well, I can usually get by with 200 or so apiece. They should both weigh relatively the same, though, since the same forces are being applied.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  4. Post #44
    Bestest polish IFAPer
    BBOOBBYY!'s Avatar
    February 2007
    5,092 Posts


    car cummin rite up
    Reply With Quote Edit / Delete Windows 7 Romania Show Events Friendly Friendly x 1 (list)

  5. Post #45
    Gold Member
    Jackpody's Avatar
    August 2010
    2,635 Posts
    Was working on this small 3 wheeler but GMod decided to crash before I got to save. Oh well, time to remake what I had. Wasn't too much, it's just generally annoying when GMod cocks up. Also I can't currently do this myself due to schoolwork, but I'd love to see another vehicle build competition here on Facepunch. Looking back at when we had the contraption section (been lurking here since some time back in 09) and I remember seeing monthly competitions. I haven't seen one for about 8 months which was the Jeep towing competition thing, right before the subsection closed. You know, stuff like "Make a vehicle which can do x with y requirements."
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Friendly Friendly x 1 (list)

  6. Post #46
    Uncle Bourbon's Avatar
    November 2011
    4,769 Posts
    Was working on this small 3 wheeler but GMod decided to crash before I got to save. Oh well, time to remake what I had. Wasn't too much, it's just generally annoying when GMod cocks up. Also I can't currently do this myself due to schoolwork, but I'd love to see another vehicle build competition here on Facepunch. Looking back at when we had the contraption section (been lurking here since some time back in 09) and I remember seeing monthly competitions. I haven't seen one for about 8 months which was the Jeep towing competition thing, right before the subsection closed. You know, stuff like "Make a vehicle which can do x with y requirements."
    Competitions are cool. I've only been in one though, the coolest car competition (or something like that, can't remember the name). I got 2nd with my semi
    Reply With Quote Edit / Delete Windows Vista Finland Show Events Friendly Friendly x 1 (list)

  7. Post #47
    One Ear Ninja's Avatar
    November 2009
    2,142 Posts
    Ah, I remember the most innovative vehicle competition. Remember that a lot of competitions fall flat on their faces if you don't offer some kind of prize though. That's kind of why that one was so enjoyable, as the prize was a 5$ game on steam.
    Shame I never got to enter one, as I was a horrible builder back then.

    Edited:

    But just about all of the entries were just amazing
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  8. Post #48
    Uncle Bourbon's Avatar
    November 2011
    4,769 Posts
    Garry should make a "Creations and Contraptions" subforum where you can post anything you've built out of props in gmod.

    i dunno, i just want the contraptions section back
    Reply With Quote Edit / Delete Windows Vista Finland Show Events Agree Agree x 2 (list)

  9. Post #49
    Gold Member
    Jackpody's Avatar
    August 2010
    2,635 Posts
    Uncle Bourbon posted:
    Garry should make a "Creations and Contraptions" subforum where you can post anything you've built out of props in gmod.

    i dunno, i just want the contraptions section back
    I made a 1200 word rant about how GMod General is clogged up and how much we fight for it being clean (especially us people from the contraption section and why we'd like our subsection back) in the Refugee Camp while I was banned. Looking back at it, it seems sort of silly. I tried the best I could but got dumbs. It actually does seem sort of dumb how much I fought for it. I tried my best though, guess we need more firepower.

    It does seem very doubtable that we'd get it back though, we would need some sort of magical event to happen first. Guess we just have to move on and live with what we have.

    Edited:

    but oh god I would not mind it coming back.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Agree Agree x 2 (list)

  10. Post #50
    Quality over quantity.
    Unslinga's Avatar
    August 2010
    885 Posts
    Could we make a poll for people who want the old contraption thread? 20 - 30 votes and we get our subforum back?
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  11. Post #51
    Gold Member
    Jackpody's Avatar
    August 2010
    2,635 Posts
    I'd love to see that but we'd need Garry to agree on it first, which is highly optimistic sadly. We need to keep fighting though, I guess.
    If it was going to happen though, only some selected people (x been here for a year) should be allowed to vote. Or else, we'd see people voting no for the sake of it.

    Also quick question, is my avatar Michael Rosen with a pink background?
    Reply With Quote Edit / Delete Denmark Show Events Agree Agree x 3 (list)

  12. Post #52
    Quality over quantity.
    Unslinga's Avatar
    August 2010
    885 Posts
    I'd love to see that but we'd need Garry to agree on it first, which is highly optimistic sadly. We need to keep fighting though, I guess.
    If it was going to happen though, only some selected people (x been here for a year) should be allowed to vote. Or else, we'd see people voting no for the sake of it.

    Also quick question, is my avatar Michael Rosen with a pink background?
    Yes it is........... is there some kind of deep meaning behind it?
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Funny Funny x 2 (list)

  13. Post #53
    Needs more suspension.
    Dennab
    February 2006
    4,484 Posts

    these maps own
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 3Artistic Artistic x 2Informative Informative x 1Friendly Friendly x 1 (list)

  14. Post #54
    Dennab
    June 2010
    2,040 Posts
    Holos. The tops are all McStrutted because gmod doesn't like recording holos. Scalable too, and actually animates the sliding piston.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Useful Useful x 1 (list)

  15. Post #55
    Quality over quantity.
    Unslinga's Avatar
    August 2010
    885 Posts

    these maps own
    Can't seem to find these maps anywhere...

    That's some nice shocks you have there Red.
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Friendly Friendly x 2 (list)

  16. Post #56
    Toyokunari's Avatar
    October 2009
    983 Posts

    these maps own
    Indeed, the maps looks to be very big also, so I hope its not gonna be laggy when I try them out.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  17. Post #57
    Needs more suspension.
    Dennab
    February 2006
    4,484 Posts
    Can't seem to find these maps anywhere...



    That's some nice shocks you have there Red.
    read the description
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #58
    Dennab
    June 2010
    2,040 Posts
    That's some nice shocks you have there Red.
    Thank you!
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  19. Post #59
    Metacore's Avatar
    June 2011
    215 Posts


    Model = done (not sure about the paint/material)
    Reply With Quote Edit / Delete Windows Vista Netherlands Show Events Winner Winner x 22 (list)

  20. Post #60

    February 2010
    40 Posts
    Started working on some forcer-powered engines because thruster engines were really starting to grind my gears. I'd say its a success.



    The best thing is I can drop it on the ground and let it sit there without fearing it destroying itself or flying off to one corner of the map. (There is a crank case, it's just faded out of view.) And they can be controlled using unmodified code for thruster engines. That's a bonus!

    I can't wait to start on a larger one and make a car.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 8Zing Zing x 1 (list)

  21. Post #61

    July 2008
    850 Posts
    Oversized and overpowered heavy mech


    with working holo gauges
    Reply With Quote Edit / Delete Windows Vista United States Show Events Winner Winner x 2Optimistic Optimistic x 1 (list)

  22. Post #62
    Gold Member
    Jackpody's Avatar
    August 2010
    2,635 Posts
    my fuck, I had this dream about us working together as a team, then getting the contraption subforum re-opened. Literally the second I woke up, I knew it wasn't real. It could be a sign!


    I need to come out more.
    Reply With Quote Edit / Delete Denmark Show Events Optimistic Optimistic x 17 (list)

  23. Post #63
    Gold Member
    MrWhite's Avatar
    March 2010
    3,607 Posts
    Been experimenting with hydraulics moving pistons moving crankshafts. Results in few noticable vibrations due to no forces pushing the block any way. This allowed me to make my all time favorite engine configuration in a form that is actually usable.



    The only problem I'm having now is that the engine redlines much lower than my other engines. I'm nearly sure it's not a timing flaw, so it must just be the hydraulics being stupid.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 2 (list)

  24. Post #64

    February 2010
    40 Posts
    Been experimenting with hydraulics moving pistons moving crankshafts. Results in few noticable vibrations due to no forces pushing the block any way. This allowed me to make my all time favorite engine configuration in a form that is actually usable.

    The only problem I'm having now is that the engine redlines much lower than my other engines. I'm nearly sure it's not a timing flaw, so it must just be the hydraulics being stupid.
    Speaking of redlining, do you have issues with your flywheels spazzing out at over 1900rpm? Once I surpass 1900-2000 rpm my flywheel starts to wobble, and the whole engine will start to surge between 900-3000 rpm, depending on the kind of engine. Nothing I do seems to help the issue.
    Reply With Quote Edit / Delete Windows XP United States Show Events

  25. Post #65
    Gold Member
    MrWhite's Avatar
    March 2010
    3,607 Posts
    I never push my engines up over 1500.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 1 (list)

  26. Post #66
    Calamity's Avatar
    August 2011
    157 Posts
    Been experimenting with hydraulics moving pistons moving crankshafts. Results in few noticable vibrations due to no forces pushing the block any way. This allowed me to make my all time favorite engine configuration in a form that is actually usable.




    The only problem I'm having now is that the engine redlines much lower than my other engines. I'm nearly sure it's not a timing flaw, so it must just be the hydraulics being stupid.
    What is the order? That doesn't seem like 1-2-3-4-5.
    Reply With Quote Edit / Delete Windows 7 Turkey Show Events Agree Agree x 2 (list)

  27. Post #67
    JDB
    JDB's Avatar
    July 2007
    2,854 Posts
    Been experimenting with hydraulics moving pistons moving crankshafts. Results in few noticable vibrations due to no forces pushing the block any way. This allowed me to make my all time favorite engine configuration in a form that is actually usable.


    The only problem I'm having now is that the engine redlines much lower than my other engines. I'm nearly sure it's not a timing flaw, so it must just be the hydraulics being stupid.
    I havent ever touched any engines in gmod but from that picture it looks like your timing is off.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  28. Post #68
    Gold Member
    MrWhite's Avatar
    March 2010
    3,607 Posts
    Of course the timing isn't 1,2,3,4,5. That 'd just be silly. The order is 1,5,2,4,3, which is a proper balanced firing order for an Inline 5 engine. Any engine should never be timed to fire in sequence (I.E, 1,2,3,etc) because it creates unnecessary stress on the crankshaft. Balancing the power out like I did with that engine produces the least amount of stress on the crankshaft.

    Edited:

    Also, just to clarify, the operational redline for the engine is just shy of 1000 RPM. it would be nearly impossible to get that RPM out of an improperly timed engine.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  29. Post #69
    Calamity's Avatar
    August 2011
    157 Posts
    Of course the timing isn't 1,2,3,4,5. That 'd just be silly. The order is 1,5,2,4,3, which is a proper balanced firing order for an Inline 5 engine. Any engine should never be timed to fire in sequence (I.E, 1,2,3,etc) because it creates unnecessary stress on the crankshaft. Balancing the power out like I did with that engine produces the least amount of stress on the crankshaft.

    Edited:

    Also, just to clarify, the operational redline for the engine is just shy of 1000 RPM. it would be nearly impossible to get that RPM out of an improperly timed engine.
    Yeah, i know that it shouldn't be 1-2-3... Well on Inline 5's there is no opposite piston of each piston, so i didnt know how to balance it. That probably will help me. But surprisingly, i have made a V10 in past. It just had 1-2-3.. order and it was pretty much balanced. Have that on my youtube channel:
    Reply With Quote Edit / Delete Windows 7 Turkey Show Events Artistic Artistic x 1Winner Winner x 1 (list)

  30. Post #70
    Dennab
    June 2010
    2,040 Posts
    is there any particular advantage to the tiny tiny crankshafts under 600rpm?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  31. Post #71
    Quality over quantity.
    Unslinga's Avatar
    August 2010
    885 Posts
    Does anyone remember the boat mod thingy someone was working on ages ago?
    Where you could stand on props and not fall off them, not gravity hull btw...
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  32. Post #72

    February 2010
    40 Posts
    is there any particular advantage to the tiny tiny crankshafts under 600rpm?
    Not particularly. The main advantage that I've noticed was simply being able to make a smaller engine due to the smaller stroke of the piston. In my experience they also tend to be slightly less prone to slider spazz on the pistons. But using the 1x1 PHX shafts gives you an engine with much more torque "out-of-the-block" than the platexplate shafts. I would recommend the platexplate for high RPM engines with the intent of gearing it down using an E2 code similar to what MrWhite posted in this thread.

    Also, MrWhite, on the topic of firing orders, is there a specific firing order you use for V8s/I4s? I've always had the sets of pistons which move in unison fire at the same time, but now I'm wondering if I can suck a few more RPMs/HP out of my engines.

    And finally, does anyone know where I can get Wenli's Dyno? The only link I've found for it is dead, and the Autodyno on Garry'smod.org doesn't work above default game speed limits.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  33. Post #73
    Gold Member
    Jackpody's Avatar
    August 2010
    2,635 Posts
    I tried to make a physical engine today, failed like usual. also won't bring it up anymore for now but today marks the half year mark for the removal of the contraption section. RIP.
    Reply With Quote Edit / Delete Denmark Show Events Friendly Friendly x 1Optimistic Optimistic x 1 (list)

  34. Post #74

    February 2010
    40 Posts
    I tried to make a physical engine today, failed like usual. also won't bring it up anymore for now but today marks the half year mark for the removal of the contraption section. RIP.
    If you would like, I could give you some help later tonight. (Probably around 7:30ish PM central time) Or some other time if it's more convenient for you.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #75

    April 2011
    33 Posts
    Stug III i made in about 5 days.
    Put alot of detail on it etc and ended up in about 250 props.
    http://www.youtube.com/watch?v=4gK0s...nd=1&lr=1&ob=0
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  36. Post #76
    Toyokunari's Avatar
    October 2009
    983 Posts
    Stug III i made in about 5 days.
    Put alot of detail on it etc and ended up in about 250 props.
    http://www.youtube.com/watch?v=4gK0s...nd=1&lr=1&ob=0
    I like that tank, I'm one of your viewers who saw that tank just randomly searching youtube.
    Make a video out of it moving, would be cool!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  37. Post #77
    Gold Member
    MrWhite's Avatar
    March 2010
    3,607 Posts
    is there any particular advantage to the tiny tiny crankshafts under 600rpm?
    The main advantage is stability, a higher attainable stable RPM, and an overall decreased vibration level. With this hydraulic engine I'm working with, there's a big difference in vibration with increasing crankshaft diameters.

    I just find that, for what I do, the smaller diameter crankshafts can provide more than enough power for my needs. If you need more power, just scale it up. You can even use PA to place the ropes to keep the profile relatively the same, too.

    Edited:

    Also, MrWhite, on the topic of firing orders, is there a specific firing order you use for V8s/I4s? I've always had the sets of pistons which move in unison fire at the same time, but now I'm wondering if I can suck a few more RPMs/HP out of my engines.
    In Garrysmod, firing order does not dictate overall power, but rather stability and balance. For a V8, I typically let the front and rear pistons on one side fire, then let the middle pistons on that side fire 180 degrees later. I repeat that process on the other side, skewed 90 degrees out of phase, though. You're left with what s basically a flatplane V8, which features an extremely simple timing structure (two if(){}else{} statements, followed by two X=-Y statements) and a perfectly balanced, vibration free cycle.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  38. Post #78
    Gold Member
    mastfire's Avatar
    July 2008
    1,941 Posts
    Stug III i made in about 5 days.
    Put alot of detail on it etc and ended up in about 250 props.
    http://www.youtube.com/watch?v=4gK0s...nd=1&lr=1&ob=0
    the video and the tank is not in good lighting but the map needs to change
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  39. Post #79

    February 2010
    40 Posts
    In Garrysmod, firing order does not dictate overall power, but rather stability and balance. For a V8, I typically let the front and rear pistons on one side fire, then let the middle pistons on that side fire 180 degrees later. I repeat that process on the other side, skewed 90 degrees out of phase, though. You're left with what s basically a flatplane V8, which features an extremely simple timing structure (two if(){}else{} statements, followed by two X=-Y statements) and a perfectly balanced, vibration free cycle.
    Well it looks like I've got it as good as it's going to get then, thanks!
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  40. Post #80
    Reply With Quote Edit / Delete Windows 7 United States Show Events