• Mech Legs 201 - Hip Biased Walking Chip
    228 replies, posted
Lol how good are you at it now? Whats a puncuation ?
Ses, I can never seem to catch you on this week. I made a mech with locker feet/hip and two filing cabinets ballsocketed to each other for a testbed mech. It promptly spazzed out. How should I be aligning the hip to the feet? Can the hip jut out from the feet or does it have to be at the same postion (- - - from top)?
[QUOTE=Archer2338;14797414]Ses, I can never seem to catch you on this week. I made a mech with locker feet/hip and two filing cabinets ballsocketed to each other for a testbed mech. It promptly spazzed out. How should I be aligning the hip to the feet? Can the hip jut out from the feet or does it have to be at the same postion (- - - from top)?[/QUOTE] You need to position the chip around about center over the feet. It's not strictly necessary to have a leg system looks like that, but the chip must be over the two feet welded to the hip. I'll point out that after wiring everything up (entity markers, inputs, etc.) you need to reupdate the chip using the expression 2 gate tool. This "records" the entity marker information (relative positions and the like) so it actually knows what to do when you unfreeze it. If things are getting spazzy, you should check your weights. Since you're working with a set of filing cabinets, you're looking at the highest weight being 90. Now, it's possible with this system to get that to work, you're just going to have to reduce Pshd and Mul accordingly to prevent it from flipping the fuck out. The way it sounds to me is that you don't have a knee. It's entirely possible for this to work (I've done setups that use just a swivelling hip and straight up/down trash cans), but I don't suggest it unless you've got some serious hacks regarding advanced ballsocket.
sestze, this walking chip rocks. I've done a huge amount of tweaking the primary values you set up and I'm really like the progress I'm getting. Thanks for being smart and knowing how to wire!!! :)
<derp>
(BUMP) Don't let this guys work go to waste ;).
Genious, will be making some mechs soon enough.
i THINK that a wire link would go [code] @name Hip-Biased Move Chip # Entities @inputs Hip:entity Left:entity Right:entity # Controls @inputs Pod:wirelink # Debug @outputs Fltdbg Vecdbg:vector # Offsets @persist Offsetl:vector Offsetr:vector Hiptrg:vector Hoff Voff Foff Ideall:vector Idealr:vector @persist Yoffl Yoffr Zoff Turnposa:vector Turnposb:vector Turnvec:vector @persist Xoffl Xoffr # Passed Information for Delta @persist Entpos:vector Leg # Forces @persist Forcel:vector Forcer:vector Trig Mul Spr Snap Vtch Ltch Htch Pshd Strp # Wirelinks @persist On For Back TRight TLeft Sprint @trigger all # Explanation of Variables and Application of Chip # Variables # Trig - Step trigger distance. After this distance is tripped # the chip will swap to the other foot. Too much trig means # that your legs often overstep, too little and you end up # with toddler steps # Mul - How fast the step is. Too much and it looks like # something that you should be playing yakkity sax to, # too small and it sort of shuffles like a zombie. # Snap - How fast it turns. I don't need to explain this. # Vtch - Vertical offset distance. More = Higher # Do not fuck with this one unless you know what # you are doing. # Ltch - Lower offset distance. More = Higher friction # Do not fuck with this one unless you know what # you are doing. # Htch - Horizontal offset distance. More = longer # strides. Do not fuck with this one unless you know # what you are doing. # Strp - Hip damping. Actively attempts to stop excessive # yawing. Too much and your contraption will spaz, # too little and you might yaw a little bit (oh no) # Pshd - Hip stabilization. Moves the hip to the rest state # of the hip. Too much and it spazzes out, too little and # it'll fall into itself and bob around a lot. # Spr - Sprint multiplier. Change the value multiplied by # Sprint to make your contraption sprint faster or slower # It's basically applying Mul * Spr force. # Application #1) Put chip on top of the hip, so you can read the chip's text or see it's arrow. #2) Face the chip forward on the hip. #3) Apply 3 entity markers and link them to the hip, left foot, and right foot #4) Wire the entity markers to the chip #5) Reupdate the chip by clicking it with the exp2 gate tool again. #6) Wire inputs and test. interval(20) For = Pod:number("W") TLeft = Pod:number("A") Back = Pod:number("S") TRight = Pod:number("D") Sprint = Pod:number("Sprint") On = Pod:number("Active") Offsetl = entity():toLocal(Left:massCenter()) Offsetr = entity():toLocal(Right:massCenter()) Foff = (Offsetl:x() + Offsetr:x()) / 2 Voff = (Offsetl:z() + Offsetr:z()) / 2 Hoff = (Offsetl:y() + Offsetr:y()) / 2 Entpos = entity():pos() if(first()) { Hiptrg = vec((Offsetl:x() + Offsetr:x()) / 2, (Offsetl:y() + Offsetr:y()) / 2, (Offsetl:z() + Offsetr:z()) / 2) Yoffl = Offsetl:y() Yoffr = Offsetr:y() Zoff = (Offsetl:z() + Offsetr:z()) / 2 Xoffl = Offsetl:x() Xoffr = Offsetr:x() # Trigger Distance Trig = 30 # Foot Force Multiplier Mul = 2.5 # Turning Multiplier Snap = 4 # Vertical, Lower and Horizontal Offsets Vtch = 3 Ltch = 3 Htch = 2 # Horizontal (Yaw) Stabilizer Strp = 1/20 # Hip Stab Pshd = 4 } # Sprint Multiplier Spr = 1 + 0.75 * Sprint if(On) { # Hip Snap Hip:applyForce(Hip:mass() * Pshd * (entity():forward() * (Foff + $Foff * 5 - Hiptrg:x()) + entity():up() * (Voff + $Voff * 5 - Hiptrg:z()) + entity():right() * -1 * (Hoff + $Hoff * 5 - Hiptrg:y()))) # Turning Turnposa = entity():right() * -200 Turnposb = entity():right() * 200 Turnvec = entity():forward() if(abs(TRight - TLeft)) { Hip:applyOffsetForce(Turnposb, Turnvec * Hip:mass() * (TRight - TLeft) * Snap) Hip:applyOffsetForce(Turnposa, Turnvec * Hip:mass() * (TLeft - TRight) * Snap) } Hip:applyOffsetForce(Turnposb, Turnvec * Hip:mass() * entity():angVel():yaw() * Strp) Hip:applyOffsetForce(Turnposa, Turnvec * Hip:mass() * entity():angVel():yaw() * -Strp) # Leg Toggles if((Offsetl:x() - Xoffl > Trig) | (Offsetr:x() - Xoffr < -Trig)) { Leg = 1 } if((Offsetr:x() - Xoffr > Trig) | (Offsetl:x() - Xoffr < -Trig)) { Leg = 0 } if(For & (Leg == 1)) { Ideall = vec(-1 * Xoffl + 0, -1 * Yoffl, -1 * Zoff + Trig * Ltch) Idealr = vec(-1 * Xoffr + -Trig * Htch, -1 * Yoffr, -1 * Zoff - Trig * Vtch) } if(Back & (Leg == 1)) { Idealr = vec(-1 * Xoffr + 0, -1 * Yoffr, -1 * Zoff + Trig * Ltch) Ideall = vec(-1 * Xoffl + Trig * Htch, -1 * Yoffl, -1 * Zoff - Trig * Vtch) } if(For & (Leg == 0)) { Ideall = vec(-1 * Xoffl + -Trig * Htch, -1 * Yoffl, -1 * Zoff - Trig * Vtch) Idealr = vec(-1 * Xoffr + 0, -1 * Yoffr, -1 * Zoff + Trig * Ltch) } if(Back & (Leg == 0)) { Ideall = vec(-1 * Xoffl + 0, -1 * Yoffl, -1 * Zoff + Trig * Ltch) Idealr = vec(-1 * Xoffr + Trig * Htch, -1 * Yoffr, -1 * Zoff - Trig * Vtch) } #WARNING: This particular IF fucks up a lot - good with rayman #not so good with any sort of legitimate construct #if(!For) #{ # Ideall = vec(0, -1 * Yoffl, -1 * Zoff) # Idealr = vec(0, -1 * Yoffr, -1 * Zoff) #} Forcel = entity():pos() - entity():toWorld(Offsetl + $Offsetl * 5 + Ideall) Forcer = entity():pos() - entity():toWorld(Offsetr + $Offsetr * 5 + Idealr) if(For | Back) { Left:applyForce(Forcel * Left:mass() * (Mul * Spr)) Right:applyForce(Forcer * Right:mass() * (Mul * Spr)) } } [/code] That means you dont have to wire "For" to "W" and so on, just wirelink from the pod controller to the sexpression2, and it links them up for you :D I'm on a different computer atm so tell me if this works.
I want to try this out. Might be a good change after two weeks of looking at a tank and trying to get it to work. Also, what is this Applyforce thing? I know Applied Force has to do with applying force on objects(Physics 101), but I'm in the dark about what it is exactly in Wiremod. Does it have to do with the E2 acting like a thruster against the prop it's stuck to? Or does it turn a specific entity into a thruster?
[QUOTE=Killer_Andre;15261621]I want to try this out. Might be a good change after two weeks of looking at a tank and trying to get it to work. Also, what is this Applyforce thing? I know Applied Force has to do with applying force on objects(Physics 101), but I'm in the dark about what it is exactly in Wiremod. Does it have to do with the E2 acting like a thruster against the prop it's stuck to? Or does it turn a specific entity into a thruster?[/QUOTE] You can use it to make any entity a Thruster, you can do an angular force and an offset force as well so you can do all kinds of levitation stuff. You can't use Set Velocity though, but that would probably be cheating.
So it [I]is[/I] a sort of thruster. Ok, I can dig that. Been wanting to build something that uses it for a while now.
It's basically a vector thruster and you have to mark on where you want to put it (As in mark a prop with target finder or ent marker)
[QUOTE=Joazzz;14725208]I cannot hate applyforce because I don't know what it is. But seriously, where do you people learn this Exprsn stuff from?[/QUOTE] It's very similar to LUA. So that means you're doing LUA in a mod for Garry's Mod, that is coded in LUA. Which is, in my opinion, pretty stupid.
Who really cares if this code is bad or not, it's finally easier to make mechs. OP is credit to team.
Hey, just a question, if anyone is willing to help. I've followed the design for the reverse knee mech, and followed the directions to the best of my knowledge. Whenever I get in the mech and press "w" it either takes half a step forward then slids along the ground. Or it starts to do this wierd walk backwards thing. I've played with the different variables quite a bit, but I just can't seem to get it right. If anybody would be kind enough to help me, it would be greatly apreaciated.
Normally I hate using someone else's wire, though getting a thruster-based walkscript in expression down has been kicking my ass. Suppose I'll use this for now. Looks like it took a lot of work, so congrats on getting it to work :D
Hey, I've been fiddling around with this chip here, in the hopes of making a mech, but... There's a problem. [url=http://i42.tinypic.com/wusf3o.jpg]This here's my mech leg test layout.[/url] [url=http://i39.tinypic.com/j9q8no.jpg]The same, but from a different angle so you can see some of the elastics.[/url] It's made by utilizing BaWa's Mech Legs 102 tutorial. That is to say, I attempted to follow it as closely as possible, until the part with the thrusters, because this chip apparently takes care of the thrusting with applied force and whatnot. I managed to give it the chip and put on the entity markers and whatnot correctly(I think), and I managed to revv it up without it flipping out. However, when I attempted to walk forwards or backwards... [url=http://i41.tinypic.com/jqi8tw.jpg]It jumps![/url] [url=http://i39.tinypic.com/10z1e34.jpg]Or, to be exact, flies really turbo fast and really turbo far![/url] So yeah. When I press the forwards or backwards key, the thing just sort of begins flying, sometimes straight up, other times forwards. It also cannot turn. The left and right keys respond, but the legs just sort of... Slightly move to the side. Sometimes not even that. So... What am I doing wrong here?
Turn down the multipliers, like trigger distance etc. and Use adv ballsocket for you're legs instead of elastic, elastic resricts it and might make it spaz out, ABS just works better on the whole anyway.
[QUOTE=Maximash;15451909]Turn down the multipliers, like trigger distance etc. and Use adv ballsocket for you're legs instead of elastic, elastic resricts it and might make it spaz out, ABS just works better on the whole anyway.[/QUOTE] I'll do the turning down, but I'm not so sure about the "replace elastics with advance ballsockets" part. Especially since I have absolutely no idea how to go about doing that. EDIT: Yeah, I tried turning down the values, but now it just floats diagonally at a certain height instead of going up to the heavens. However, now the legs just sort of twitch instead of being in that walking motion while flying around. So... Yeah. Any other ideas?
How low did you set the trigger distance? post all the variables you have it set to atm, like vtch ltch htch etc, post those.
When I spawn the chip, it spawns without the code and an error that says something about line 3 char 1 appears. What causes this? My wire is the latest SVN version.
[QUOTE=Finlander;15451462]Hey, I've been fiddling around with this chip here, in the hopes of making a mech, but... There's a problem. [url=http://i42.tinypic.com/wusf3o.jpg]This here's my mech leg test layout.[/url] [url=http://i39.tinypic.com/j9q8no.jpg]The same, but from a different angle so you can see some of the elastics.[/url] It's made by utilizing BaWa's Mech Legs 102 tutorial. That is to say, I attempted to follow it as closely as possible, until the part with the thrusters, because this chip apparently takes care of the thrusting with applied force and whatnot. I managed to give it the chip and put on the entity markers and whatnot correctly(I think), and I managed to revv it up without it flipping out. However, when I attempted to walk forwards or backwards... [url=http://i41.tinypic.com/jqi8tw.jpg]It jumps![/url] [url=http://i39.tinypic.com/10z1e34.jpg]Or, to be exact, flies really turbo fast and really turbo far![/url] So yeah. When I press the forwards or backwards key, the thing just sort of begins flying, sometimes straight up, other times forwards. It also cannot turn. The left and right keys respond, but the legs just sort of... Slightly move to the side. Sometimes not even that. So... What am I doing wrong here?[/QUOTE] I actually made that tutorial before the chip was released, so it doesnt realy work with the chip. All I can say is dont elastic it.
try putting the chip on the top not the front
Seriously guys I cannot get this to work at all can you guys help?
I got a problem. i wired up my little robot and updated the chip. When i press 8 (forward key) his left leg just slides backwards and his front forwards so all he does is spin. Any help?
so i don't have to use elastics and adv. ballsockets?
[QUOTE=plecy;15803447]I got a problem. i wired up my little robot and updated the chip. When i press 8 (forward key) his left leg just slides backwards and his front forwards so all he does is spin. Any help?[/QUOTE] You sure the chip is facing the right way? [QUOTE=patkick;15806428]so i don't have to use elastics and adv. ballsockets?[/QUOTE] You still have to use advanced ballsockets or axises to fasten the legs together.
Y'know, Ses, I've been meaning to mention this, but your avatar is epic. Offtopic aside, maybe one of the ent markers is faced wrong? Or does that not even matter? [b]Edit:[/b] What I really want to see is an 8 legged mech using this chip!
is an entity marker in wire list? i have no idea what it is.... also i tried using the leg tutorial by bawa, which i know is outdated, but what i dont understand is how to get the props no collided and evenly inside each other and axised/ABSed instead of axised/adv balled to the sides of each other.... i didn't really go far with the tutorial from bawa, because i wanted to make the example for the reversed leg walker in the other tutorial. i believe its the last one down b4 the sketch. can someone help, im an extremely visual person and if anyone could help me out on a server i would very much appreciate it. thanks. :P Edit: you can just add me on steam that would be easier- my steam id is HeyBubba1992 or, The Joker.
ive tried this using very simple props and it just spazes out and starts flying in a random direction, so, how exactly is this chip going to do anything when the legs are just dangleing there with no foreward/reverse orentation on them? just using axises and adv. ballsockets :eng99: [url]http://www.wegame.com/watch/robo_fail/[/url]
Sorry, you need to Log In to post a reply to this thread.