javascript:insertSmiley('

')
OK first off Ive developed a robotic simulator that has a mouse and keyboard option, but its meant for 3 joysticks (2 for the arms, and a steering wheel and pedals combo for movement.) I have included code which disables the joystick, anyone who wants to help develop joystick code needs to re-implement and assign joysticks via the control device section...I need a lot of help on this project, and any suggestions, or sample code is appreciated...Ive included the whole program as far on the download button... If you want to help please post to this forum, and include a name you want in the credits, as this will very likely be published to some degree...also include a description of each idea(portion of the project) you are helping with...
`H.A.R.M. - ( Heavy Armored Robotic Mech )
`Designed by Christopher S. Johnson AKA: YZ
`Developed for UNITUS at HOLY SCIENTIFIC LABS (all rights reserved) (c) 5/2/2012
`Various codes included with permissions from The Game Creators forums at: www.thegamecreators.com (community of programmers) Thanks for all your help!!!
`INSTRUCTION SET: (under construction)
SET DISPLAY MODE DESKTOP WIDTH(), DESKTOP HEIGHT(), 32
maximize window
hide mouse
`Background Music Track
LOAD MUSIC "FinalStage.mp3",1
LOOP MUSIC 1
`Ground
make matrix 1,1000,1000,50,50
randomize matrix 1,20
LOAD IMAGE "ground1.jpg",1
PREPARE MATRIX TEXTURE 1,1,1,1
update matrix 1
`Collision Events Handler
SET GLOBAL COLLISION ON
CALCULATE AUTOMATIC COLLISION
SYNC
`Armored Mech
LOAD OBJECT "HARM1.x",1
POSITION OBJECT 1,500,0,500
SCALE OBJECT 1,50,50,50
SET OBJECT cull 1,0
TURN OBJECT LEFT 1,180
SET OBJECT COLLISION TO BOXES 1
`Cannon projectile
projectile=10
MAKE OBJECT sphere projectile, 5
SET OBJECT COLLISION TO SPHERES projectile
`Target Box
MAKE OBJECT BOX 2,100,400,100
POSITION OBJECT 2,500,0,800
SET OBJECT COLLISION TO BOXES 2
`Main - 1st person perspective camera
MAKE CAMERA 1
POSITION CAMERA 1,LIMB POSITION X(1,1),LIMB POSITION Y(1,1),LIMB POSITION Z(1,1)
COLOR BACKDROP 1,rgb(50,50,70)
TURN CAMERA LEFT 1,360
`Secondary - 3rd person perspective camera
MAKE CAMERA 2
POSITION CAMERA 2,object position x(1),object position y(1)+20,object position z(1)-100
set camera view 2, 10, 10, 300, 300
point CAMERA 2,object position x(1),object position y(1),object position z(1)
JOY START
global speed# as float
global movement as integer
speed#=0.00
movement=0
`SET CONTROL DEVICE INDEX 0
`SET CONTROL DEVICE "WingMan Force 3D"
`SET CONTROL DEVICE INDEX 1
`SET CONTROL DEVICE "WingMan Attack 2"
`SET CONTROL DEVICE INDEX 2
`SET CONTROL DEVICE "Guillemot Corporation"
do
`Key Movements
movement=0
if keystate(17)=1 then speed#=curvevalue(-1,speed#,10) : movement=1
if keystate(31)=1 then speed#=curvevalue(1,speed#,10) : movement=1
if keystate(30)=1 then turn OBJECT left 1,1
if keystate(32)=1 then turn OBJECT right 1,1
if keystate(30)=1 then turn CAMERA left 1,1
if keystate(32)=1 then turn CAMERA right 1,1
JOY POLL ALL
`Left Arm + Cannon
if keystate(21) =1 then ROTATE LIMB 1,17,0, wrapvalue(LIMB ANGLE Y(1,17)+0.5),0
if keystate(35) =1 then ROTATE LIMB 1,17,0, wrapvalue(LIMB ANGLE Y(1,17)-0.5),0
if keystate(22) =1 then ROTATE LIMB 1,20,0, wrapvalue(LIMB ANGLE Y(1,20)+0.5),0
if keystate(36) =1 then ROTATE LIMB 1,20,0, wrapvalue(LIMB ANGLE Y(1,20)-0.5),0
if joy y(0) =-1 then ROTATE LIMB 1,17,0, wrapvalue(LIMB ANGLE Y(1,17)+0.5),0
if joy y(0) =1 then ROTATE LIMB 1,17,0, wrapvalue(LIMB ANGLE Y(1,17)-0.5),0
if joy x(0) =1 then ROTATE LIMB 1,20,0, wrapvalue(LIMB ANGLE Y(1,20)+0.5),0
if joy x(0) =-1 then ROTATE LIMB 1,20,0, wrapvalue(LIMB ANGLE Y(1,20)-0.5),0
`Left Cannon Operations
if JOY SCANCODE(0)=1 then POSITION OBJECT projectile, LIMB POSITION X (1,21),LIMB POSITION Y (1,21),LIMB POSITION Z (1,21)+10
if JOY SCANCODE(0)=0 then MOVE OBJECT projectile,30
JOY POLL ALL
`Right Arm + Cannon
if keystate(23) =1 then ROTATE LIMB 1,11,0, wrapvalue(LIMB ANGLE Y(1,11)+0.5),0
if keystate(37) =1 then ROTATE LIMB 1,11,0, wrapvalue(LIMB ANGLE Y(1,11)-0.5),0
if keystate(24) =1 then ROTATE LIMB 1,14,0, wrapvalue(LIMB ANGLE Y(1,14)+0.5),0
if keystate(38) =1 then ROTATE LIMB 1,14,0, wrapvalue(LIMB ANGLE Y(1,14)-0.5),0
if joy y(1) =1 then ROTATE LIMB 1,11,0, wrapvalue(LIMB ANGLE Y(1,11)+0.5),0
if joy y(1) =-1 then ROTATE LIMB 1,11,0, wrapvalue(LIMB ANGLE Y(1,11)-0.5),0
if joy x(1) =1 then ROTATE LIMB 1,14,0, wrapvalue(LIMB ANGLE Y(1,14)+0.5),0
if joy x(1) =-1 then ROTATE LIMB 1,14,0, wrapvalue(LIMB ANGLE Y(1,14)-0.5),0
`Right Cannon Operations
if JOY SCANCODE(1)=1 then POSITION OBJECT projectile, LIMB POSITION X (1,15),LIMB POSITION Y (1,15),LIMB POSITION Z (1,15)+10
if JOY SCANCODE(1)=0 then MOVE OBJECT projectile,30
JOY POLL ALL
`Torso and Legs
SET CONTROL DEVICE INDEX 2
SET JOYSTICK DEADZONE 100
if joystick slider a()>-99 then speed#=curvevalue(-1,speed#,10) : movement=1
if joystick slider a()>-99 then MOVE OBJECT 1,wrapvalue(1) : movement=1
if joystick down()=1 then move object 1, -1
if joystick down()<1 then STOP OBJECT 1
move object left 1, joystick left()-joystick right()
move camera left 1, joystick left()-joystick right()
if joystick left() then TURN OBJECT LEFT 1,1
if joystick right() then TURN OBJECT RIGHT 1,1
if joystick left() then TURN camera LEFT 1,1
if joystick right() then TURN camera RIGHT 1,1
if joy x(2) =-1 then TURN OBJECT LEFT 1,1
if joy x(2) =1 then TURN OBJECT RIGHT 1,1
if JOY Y(2) =-1 then MOVE OBJECT 1,1
if JOY Z axis(2) <-1 then MOVE OBJECT 1,-1
if JOY scancode(2) =1 then ROTATE LIMB 1,3,wrapvalue(LIMB ANGLE X(1,3)+0.5),0,0
if JOY scancode(2) =2 then ROTATE LIMB 1,3,wrapvalue(LIMB ANGLE X(1,3)-0.5),0,0
JOY POLL ALL
`Target / Projectile collision detection
if OBJECT HIT (projectile,2) then move object projectile,-30
`Mouse and Movement Calculations
if movement=0 then speed#=curvevalue(0,speed#,10)
move object 1,speed#
yROTATE OBJECT 1,wrapvalue(object angle y(1)-(mousemovex()/0.8))
xROTATE OBJECT 1,wrapvalue(object angle x(1)-(mousemovey()*0.2))
`Ground to Object collision detection
position object 1,object position x(1),get ground height(1,limb position x(1,1),limb position z(1,1))+2.5,object position z(1)
`Camera Directions
SET CAMERA TO FOLLOW 1,LIMB POSITION X(1,1),LIMB POSITION Y(1,1)+2,LIMB POSITION Z(1,1)-3,0,-5,-5,1,0
SET CAMERA TO FOLLOW 2,object POSITION X(1),object POSITION Y(1)+30,object POSITION Z(1)-70,0,0,0,1,0
sync
LOOP
This is a list of things that need fixing, or concepts waiting to be produced, feel free to attempt a fix on anything you see fit:
(WIP)
Need collision detection corrected...
Need projectile positioning and firing corrected...
(projectile must fire from the end point of limbs 15, and 21 respectively.)
(projectile must travel continuously each time trigger is pulled.)
(projectile must not only fire in one direction, it must fire respective to the direction of its aiming position.)
need sound effects(tractor,thrusters,cannon, and missile firing, etc)...
need camera to turn correctly with machine hull(no glitching)!!!
build animated tractor system for robot base...
develop 4x port missile system (fire via 4x button on steering wheel)...
use L&R side "buttons" on under steering wheel for "animated dual thruster operation"...
develop "live" HUD overlay system(radar,targeting system,velocity readout,cannon & missile ammo count)...
use top portion of joystick buttons 2-4 for target selection (button 4 via cycle), and ammo type selection (buttons 2&3).
attempt to create an option for POV on joystick 1(Left Arm)...
use joystick throttle for arm upper arm (shoulder) rotational experimentation...
try to change steering wheel stick-shift to pitch top portion of hull up and down respectively...
volume control for music background with HUD indication...(lower right corner?)
sky for environment...
target hit- explosion animation event...
attempt proper analog calculations for more accurate variation in acceleration for pedal press...
voice confirmation system for various selections...(like a "target acquired voice" or "cannon armed voice" during selection phase.)
Thanks for your cooperation!!!javascript:insertSmiley('

')
C.S.J. - Holy Scientific/UNITUS

CSJ 7000