Marisa Kirisame wrote:ZScript is also prone to breaking if you aren't careful. I see you got a save error there.
I guess it'll go away after I export F3DFloor.
I think it's because the FLineTraceData struct contains the F3DFloor entry (
here), despite it not being exported... Interestingly enough, the TraceResults struct has the F3DFloor piece commented out.
HAL9000 wrote:I'm curious how you did the tank controls/handling/logic in Zscript, and the md3 model.
WASD for Tank Body, mouse for the Tank Turret? and I guess tank is made from 2(or more)md3 models controlled together by zscript?
I was planing to do something similar with AT-ST for my project....but the problem was controlling 2 different models at the same time.
You're essentially correct...
The tank is actually a separate player class; I overrode a bunch of the base PlayerPawn functions to tweak the handling and performance. The tank is split into three actors - the base, the turret, and the gun, with the relative position of each part controlled via SetOrigin and angle/pitch/roll calculated relative to the other pieces.
The tank re-uses the standard player control bindings.
Forward/back move the tank forward and back. By default, movement automatically will align with the angle of the player camera, with handling for turning the body to align with the direction of movement. The 'run' key allows you to override this "auto-steering" and manually control the base of the tank separately from the turret if you want (essentially skipping the "align the tank base to the camera's angle" step and letting you move in one direction while aiming the turret in another...
Left/right strafe turn the tank body left and right, and can be used to steer while moving forward/back.
Left/right turn (or mouselook left/right) turn the viewpoint camera around the tank. This affects the direction of the turret, but the turret is actually independent - it moves at a set, slower speed, and eventually "catches up" to where the camera is aimed, so you can look all around at normal mouselook speed, and the turret will move at a realistic pace behind you.
Look up/look down (or mouselook up/down) control the pitch of the cannon; primary fire sets off the cannon, and secondary fire triggers the fixed machine gun on the front of the tank.
Currently, holding down 'use' lets you exit the tank, and you can 'use' the tank again to get back inside.
To give you an idea of how it handles - in Torm's gameplay clip, based on how the tank is moving, he was only using the mouselook and forward/back controls to move. All of the the turning of the tank base was handled automatically.