|
So I'm making tanks (you noticed?)
The tank layout will be the driver who controls the tank's steering and main gun/machine gun. And then there is a gunner that can hop on and use a machine gun mount.
The driver needs to be able to steer with the WASD keys, controlling speed and turning with them. Then He must click to posistion the main gun and press F to fire, or R to fire machine gun.
Main Problem:
How can I make the gun stay stationary? (So it does not flop around and fall down on an ordinary hinge)
What is the best way to move the tank, (wheels, bodyforce, etc) |
|
hoshi711Join Date: 2008-06-18 Post Count: 746 |
the best tank ive ever seen was made by WingMan8 in his CityPatrol game
very complicated tank that would be difficult to copy, but it should be fairly simply to use certain elements (such as its turret design).
heres some recomendations
1. forget the secondary driver, nobody likes them, nobody uses them.
2. i personally prefer the method of driving by mouseclick, and weapons and steering are both controlled by mouse, but thats your choice
3. use a welded turret, thats the best part of wingmans Tank, his welded turret means it doesnt flop arround and cause crazy spazziness.
so, to do the whole WASD steering, you have to use a tool and use the key down and up event, or you could use a vehicle seat. again, also up to you.
and on the subject of moving the tank. wheels are the best until they spaz out on you. if you can find a way to use wheels without the tank spazzing out then definitly use that method. |
|
|
Alright, so I'm forgetting the secondary placement.
1.But I know there are some games where the gun can move freely and still not flop around.
2.I am using the vehicle seat type, and how can I get rid of the speed bar on the screen?
3.What are some methods of damage to vehicles? |
|
hoshi711Join Date: 2008-06-18 Post Count: 746 |
1. just use a body gyro if you really want to and make sure you dont take off its force factor once the person is done aiming, but again its still subject to spazzing out. I higly reomend usingwelds as you still get all of the aiming caabilities and a lot less lagging
2.I think you can turn it off in the properties but im not really sure on that, if not im sure theres some sort of easy script where when the person its in the seat the script goes into their gui anddeletes the spee bar gui
3. this gets a bit more complicated and actually has a lot more to do with the bullets hitting the tank than it does to do with the actual tank its self. to do this you'de obviously need some intValue to represent the tanks "health" and then in the programming of the bullets you would need to add into the touch detector to see if the part being his is part of a tank and if so sutrct from the tanks health. when dealing with explosions though, this gets a lot more complicated because the explosion will just blow up half the tank no matter what. again WingMan has made the best method for doing vehicle healths. he uses ray casting and fake explosions (i.e. when you die by the explosion it not the actual roblox explosion that kills you but a script he made)
off the of my head, one way you could do this is have an explosion with no blast pressure but the same radius and then use the explosions hit event to check for parts of the tank and subtrac health from he tank and if the tanks health equal zero then make an explosion with some actual blastpressure in it |
|
|
|
The more and more I think of it, my place is just gonna be a coppy of wingman's place.
I'm thinking of using tanks, trucks, and planes, as well as personel weapons.
Each base has gun defences, with Anti air and artillary. |
|
|
I know the ability to show the speed is a property in the VehicleSeat.
Also, cool idea. Sounds good. |
|
|
How can I combine the vehicle seat vehicle with the gun turret to make both controllable? |
|
|
Alright, so I have the "Deca Chassis" inside the plane model. Within the plane model is the gun1, engine, and the script for that part (do I need all the cframes?)
So I tried to redirect the planeflyer script to the vehicle seat.
So here is the model (I'm only listing certain peices)
Model
-Plane
--Parts
---Script,DecaChassis,Engine,Gun1
Here is the code I altered in the planeflyer script:
---------------------
if (list[x].Name == "Plane") then
local weld = list[x]:FindFirstChild("Parts"):FindFirstChild("Deca Chassis") : FindFirstChild("VehicleSeat"):FindFirstChild("SeatWeld")
if (weld ~= nil) and (weld.Part1 == player.Character:FindFirstChild("Torso")) then
return list[x]
end
------------------
I changed the "Seat" to "VehicleSeat" and added the DecaChassis direction in between the two normal ones. Any thoughts? |
|