Why is it that no matter what coordinates I put into the position of enemy (object 1) that he is always in the same position that the main player (object 4) is?
`Setup Client Options
SYNC ON:SYNC RATE 0:HIDE MOUSE
`Create Enemy Player
MAKE OBJECT SPHERE 1,50:COLOR OBJECT 1,RGB(000,255,000):POSITION OBJECT 1,eposx#,Ground#,eposz#
`Create Main Player
MAKE OBJECT SPHERE 2,50:COLOR OBJECT 2,RGB(255,000,000):POSITION OBJECT 2,posx#,Ground#,posz#
`create ammo crate
LOAD OBJECT "crate2.x", 4:POSITION OBJECT 4,199,Ground#,199
`create playing field
MAKE MATRIX 1,1000,1000,50,50
`add texture to matrix
LOAD IMAGE "grass2.jpg",1
PREPARE MATRIX TEXTURE 1,1,1,1
`make matrix the ground
GROUND#=GET GROUND HEIGHT(1,posx#,posz#)+10
`Add limb for intersection checks
MAKE OBJECT SPHERE 9999,10
MAKE MESH FROM OBJECT 1,9999
DELETE OBJECT 9999
ADD LIMB 1,1,1
OFFSET LIMB 1,1,0,0,500
HIDE LIMB 1,1
`Add a second limb for ground checks
ADD LIMB 1,2,1
OFFSET LIMB 1,2,0,-50,0
DELETE MESH 1
HIDE LIMB 1,2
`Define the main variables needed
EnemyHP#=2000` Enemy's Health
Ammo#=1000` Starting Ammo
MaxAmmo#=1000` Maximum amount of Ammo
Clips#=3` Starting Clips
MaxClips#=3` Maximum amount of Clips
JUMPING#=0
JUMP$="Jumping"
posx#=250` Player position
posz#=250` Player position
eposx#=99` Enemy position
eposz#=99` Enemy position
`Start main DO/LOOP
DO
`Camera Positioning
POSITION CAMERA OBJECT POSITION X(1),OBJECT POSITION Y(1),OBJECT POSITION Z(1)
`Movement Controls
IF KEYSTATE(17)=1 THEN MOVE OBJECT 1,.9
IF KEYSTATE(31)=1 THEN MOVE OBJECT 1,-.9
IF KEYSTATE(30)=1 THEN MOVE OBJECT LEFT 1,.3
IF KEYSTATE(32)=1 THEN MOVE OBJECT RIGHT 1,.3
`Space key Controls
IF SPACEKEY()=1 AND JUMPING#=0 THEN JUMP#=1
`JUMP Variable Definition
IF JUMP#=1
JUMP_SPEED#=1
JUMPING#=1
JUMP#=0
ENDIF
`Jumping
IF JUMPING#=1
DEC JUMP_SPEED#,.005
POSITION OBJECT 1,OBJECT POSITION X(1),OBJECT POSITION Y(1)+JUMP_SPEED#, OBJECT POSITION Z(1)
IF OBJECT POSITION Y(1)<=GROUND# THEN JUMPING#=0
ENDIF
`Mouse Camera Movement
CAMY#=CAMY#+MOUSEMOVEX()*.1
CAMX#=CAMX#+MOUSEMOVEY()*.1
IF CAMX#>90 AND CAMX#<135 THEN CAMX#=90
IF CAMX#>270 AND CAMX#<225 THEN CAMX#=90
YROTATE CAMERA CAMY#
XROTATE CAMERA CAMX#
YROTATE OBJECT 1,CAMY#
XROTATE OBJECT 1,CAMX#
`Mouseclick Shooting
IF KEYSTATE(19)=0 AND MOUSECLICK()=1
IF Ammo#>0 THEN DEC Ammo#,1
IF OBJECT EXIST(2)=1
IF Ammo#>0 AND INTERSECT OBJECT (2, LIMB POSITION X(1,1), LIMB POSITION Y(1,1), LIMB POSITION Z(1,1), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0 THEN DEC EnemyHP#,1
ENDIF
ENDIF
`Check if the enemy should die, if so delete it
IF EnemyHP#=0 AND OBJECT EXIST(2)=1 THEN DELETE OBJECT 2
`Reloading (press R)
IF MOUSECLICK()=0 AND KEYSTATE(19)=1 AND Ammo#<MaxAmmo# AND Clips#>0
Reload#=1
ENDIF
`Reloading Part 2 (delay)
IF Reload#=1 THEN INC Time#,.005
IF Time#>=1 THEN Ammo#=MaxAmmo#:DEC Clips#,1:Time#=0:Reload#=0
`Ammo Crate code (obtain ammo from ground)
IF OBJECT EXIST(4)=1
IF Ammo#<MaxAmmo# AND INTERSECT OBJECT (4, LIMB POSITION X(1,2), LIMB POSITION Y(1,2), LIMB POSITION Z(1,2), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0
INC Clips#,(MaxClips#-Clips#)
INC Ammo#,(MaxAmmo#-Ammo#)
DELETE OBJECT 4
ENDIF
ENDIF
`Display text above enemy and crate object
IF OBJECT EXIST(2)=1 THEN CENTER TEXT OBJECT SCREEN X(2),OBJECT SCREEN Y(2)-70,"Enemy Health: "+str$(EnemyHP#)
IF OBJECT EXIST(4)=1 THEN CENTER TEXT OBJECT SCREEN X(4),OBJECT SCREEN Y(4)-20,"Ammo Crate"
`Display our Ammo and Clips on-screen
TEXT 0,SCREEN HEIGHT()-50,"Ammo: "+str$(Ammo#)
TEXT 0,SCREEN HEIGHT()-40,"Clips: "+str$(Clips#)
`Show that we're reloading
IF Reload#=1 THEN CENTER TEXT SCREEN WIDTH()/2,SCREEN HEIGHT()/2,"Reloading..."
`Add a target reticule to the screen
CIRCLE SCREEN WIDTH()/2,SCREEN HEIGHT()/2,5
`Refresh the screen(SYNC) and call the LOOP function
SYNC
LOOP