Maya is really good, I exported a (creature) Slime + animation + texture to a .x file and loaded the x file and it contains all the info needed, texture coordinates and animatin frames. Only diferent thing is that the key frames are 10x10 1/5 or something like that. A 10 keyframes animation, must be played at speed = 1000 and frames 1 thrugh 1500, I'm still ooking around the export window to se if there is anything else I can check/uncheck to avoid this.
Moving the character: I think my movement system is wrong or not well designed/coded. I have seeing others with a lot less code on it, mine has too many lines? Wonders why? LOL!
Well at least I had the privilege of seeing one of the creatures walking around + walking animation... cool!
SYNC ON : SYNC RATE 60
MAKE MATRIX 1,1000,1000,25,25
RANDOMIZE MATRIX 1,300
LOAD OBJECT "slime.x",1
MAKE CAMERA 1
POSITION CAMERA 1,0,20,-30
POSITION OBJECT 1,0,0,30
DO
AnimatePlayer()
MovePlayer()
SYNC
LOOP
`!!! ---------------------------------------------------------------- SUB RUTINES !!!~
PlayerCoordenates:
SET CURSOR 10,2
SET TEXT SIZE 3
PlayerX# = OBJECT POSITION X(1)
PlayerY# = OBJECT POSITION Y(1)
PlayerZ# = OBJECT POSITION Z(1)
PlayerAngY# = OBJECT ANGLE Y(1)
PRINT "Player Coordenates"
PRINT PlayerX#
PRINT PlayerY#
PRINT PlayerZ#
PRINT PlayerAngY#
CamX# = CAMERA POSITION X(1)
CamY# = CAMERA POSITION Y(1)
CamZ# = CAMERA POSITION Z(1)
CamAngY# = CAMERA ANGLE Y(1)
PRINT "Camera Coordenates"
PRINT CamX#
PRINT CamY#
PRINT CamZ#
PRINT CamAngY#
RETURN
RutinePlayerMovement:
GOSUB PlayerCoordenates
MOVE OBJECT 1,1
POSITION CAMERA 1,PlayerX#,PlayerY#+40,PlayerZ#-80
POINT CAMERA 1, PlayerX#,PlayerY#+20,PlayerZ#
RETURN
FUNCTION AnimatePlayer
IF UPKEY() OR DOWNKEY() OR LEFTKEY() OR RIGHTKEY()=1
AnimationSpeed = 1000
SET OBJECT SPEED 1,AnimationSpeed
LOOP OBJECT 1,1,1500
ELSE
STOP OBJECT 1
SET OBJECT FRAME 1,1
ENDIF
ENDFUNCTION
FUNCTION MovePlayer()
`----------------------------------------------------------- SINGLE KEY
IF UPKEY()=1
YROTATE OBJECT 1,0
GOSUB RutinePlayerMovement
ENDIF
IF DOWNKEY()=1
YROTATE OBJECT 1,180
GOSUB RutinePlayerMovement
ENDIF
IF LEFTKEY()=1
YROTATE OBJECT 1,-90
GOSUB RutinePlayerMovement
ENDIF
IF RIGHTKEY()=1
YROTATE OBJECT 1,+90
GOSUB RutinePlayerMovement
ENDIF
`----------------------------------------------------------- DOUBLE KEY
IF UPKEY() AND RIGHTKEY()=1
YROTATE OBJECT 1,45
GOSUB RutinePlayerMovement
ENDIF
IF UPKEY() AND LEFTKEY()=1
YROTATE OBJECT 1,-45
GOSUB RutinePlayerMovement
ENDIF
IF DOWNKEY() AND RIGHTKEY()=1
YROTATE OBJECT 1,135
GOSUB RutinePlayerMovement
ENDIF
IF DOWNKEY() AND LEFTKEY()=1
YROTATE OBJECT 1,-135
GOSUB RutinePlayerMovement
ENDIF
`----------------------------------------------------------- CANCELL MULTIPLE KEY
IF UPKEY() AND DOWNKEY()=1
YROTATE OBJECT 1,0
GOSUB RutinePlayerMovement
ENDIF
IF RIGHTKEY() AND LEFTKEY()=1
YROTATE OBJECT 1,90
GOSUB RutinePlayerMovement
ENDIF
IF UPKEY() AND DOWNKEY() AND RIGHTKEY() AND LEFTKEY()=1
YROTATE OBJECT 1,0
GOSUB RutinePlayerMovement
ENDIF
IF UPKEY() AND DOWNKEY() AND LEFTKEY()=1
YROTATE OBJECT 1,-90
GOSUB RutinePlayerMovement
ENDIF
IF UPKEY() AND DOWNKEY() AND RIGHTKEY()=1
YROTATE OBJECT 1,90
GOSUB RutinePlayerMovement
ENDIF
IF DOWNKEY() AND RIGHTKEY() AND LEFTKEY()=1
YROTATE OBJECT 1,180
GOSUB RutinePlayerMovement
ENDIF
`----------------------------------------------------------- SHIFT KEY
ENDFUNCTION
So after coding this stuff
I realized 4 things:
a) I cannot control the camera
b) Im specifying values instead of letting the character turn smoothly
c) Im not using the Wrapvalue()
d) It sucks
Cheers!
Here is a picture of the slime ( Nothing Fancy )
- Just Me!