Technology (Read Only) > Garry's Mod Contraptions
[Wire] Battle Bots!
Deacon:
Oh man..Now I wish I could wire.
Ἆxule:
--- Quote from: coolzeldad on November 19, 2012, 10:51:44 PM ---This is a good idea... and like i can see spinning things working.
I just built the arena out of fence.
Could have artifical floor if you wanted i suppose, have deathtrapz... but would be a little difficult to keep reliable in gmod probably ;o
Could just have spinning thingies on walls or set locations on floors that activate when touched xD
--- End quote ---
As long as there are other factors in the battles ; )
Loke:
--- Quote from: Deacon on November 19, 2012, 10:56:20 PM ---Oh man..Now I wish I could wire.
--- End quote ---
You could probably do this with basic wire.
Xrain:
--- Quote from: Deacon on November 19, 2012, 10:56:20 PM ---Oh man..Now I wish I could wire.
--- End quote ---
The only wire really used is pretty basic.
My program looked like this:
--- Code: ---@output Brake Clutch Gear ActiveOut Throttle
@Input W A S D Active
interval(1)
if(Active==1)
{
ActiveOut=1
}
else
{
ActiveOut=0
}
if(W==1)
{
Clutch=0
Gear=1
Brake=0
Throttle=100
}
if(S==1)
{
Clutch=0
Gear=2
Brake=0
Throttle=50
}
if(S==0&W==0)
{
Clutch=1
Brake=1
Throttle=0
}
--- End code ---
Now what was all that you ask?
First, it looked for the signal from the Pod controller that someone was sitting in it.
If there was, it started the ACF engine, otherwise it left it off.
Then if W or S were pressed it:
Turned off the brake
Turned off the clutch
Selected the appropriate gear (gear 1 was forward, 2 reverse)
and gave it full throttle
Then if neither were pressed it:
Turned on the brake
Turned off the clutch
Idled the motor
and Voila!
You now have a car that can go forward... reverse... and stop... pretty amazing huh?
Deacon:
no xrain
I don't understand that
brain is now broken
thanks
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version