I am a total newbie and I have started to make my first game this involves a character walking around a landscape collecting things, doing missions etc. I have started by making a randomised matrix and then using the code from the tutorial which makes the 3d character walk around the screen. However I don't what to use the strange model that has been provided and wish to change this to something more exciting. I know to do this you need to change the file name in the load object command, i also know you need to change some of the parameters. These are the parameter I think you have to change.
append object - start frame (2nd parameter)
loop object - starts and end frame (2nd and 3rd parameter respectively)
set object speed - speed value (2nd parameter)
set object frame - frame number (2nd parameter)
But, the thing is that i don't know what you have to change these numbers too. Could somebody explain how i should work out what numbers to use.
Could someone also explain how i would include the animation of someone attacking/hitting/punching to my code.
Here is my code.
rem make matrix
make matrix 1,1000,1000,10,10
randomize matrix 1,50
rem Load 3D object and append walking data to it
LOAD OBJECT "idle.x",1 : APPEND OBJECT "walk.x",1,100
YROTATE OBJECT 1,180 : FIX OBJECT PIVOT 1
rem Loop 3D object animation from 0 to 20 (idle)
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,10
rem Activate manual syncronization
SYNC ON
rem Begin loop
DO
rem Modify character angle based on left/right keys
stage=0
IF LEFTKEY()=1 THEN a#=a#-8.0
IF RIGHTKEY()=1 THEN a#=a#+8.0
a#=wrapvalue(a#)
rem Modify character position based on up/down keys
IF UPKEY()=1 THEN x#=NEWXVALUE(x#,a#,3) : z#=NEWZVALUE(z#,a#,3) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-3) : z#=NEWZVALUE(z#,a#,-3) : stage=1
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,20
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,40
ENDIF
oldstage=stage
ENDIF
rem Update character position and angle
POSITION OBJECT 1,x#,get ground height(1,x#,z#)+5,z#
YROTATE OBJECT 1,a#
rem Position camera off center
POSITION CAMERA x#,y#+100,z#-150
rem Refresh screen
SYNC
rem End loop
LOOP
Thanks
Jozers