i am trying to create bullets in my FPS but when i click the firing button, darkbasic says that the object doesn't exist. I know it does because i created it and i am looking at it right now.
`-------- Title: My First FPS-----------------------------------
`-------- Author: Krimzon DestinE-------------------------------
`-------- Date: October 15, 2005--------------------------------
`Setup Client Options
SYNC ON:SYNC RATE 0:HIDE MOUSE: AUTOCAM OFF:RANDOMIZE TIMER()
`---------------------------------------------------------------
`------------------Main Variables-------------------------------
`---------------------------------------------------------------
` CWeapon = Current Weapon
global CWeapon=0
`weapon
type weapon
name as string
ammo as integer
maxammo as integer
clips as integer
maxclips as integer
bulletlife as integer
bulletdamage as integer
bulletspeed as integer
endtype
`weapon array
dim weapon(3) as weapon
weapon(0).name="Unarmed"
weapon(1).name="Rifle"
weapon(1).ammo=50
weapon(1).maxammo=50
weapon(1).clips=5
weapon(1).maxclips=5
weapon(1).bulletlife=25
weapon(1).bulletdamage=200
weapon(1).bulletspeed=10
weapon(2).name="Shotgun"
weapon(2).ammo=8
weapon(2).maxammo=8
weapon(2).clips=6
weapon(2).maxclips=6
weapon(2).bulletlife=50
weapon(2).bulletdamage=500
weapon(2).bulletspeed=10
weapon(3).name="Rocket Launcher"
weapon(3).ammo=10
weapon(3).maxammo=10
weapon(3).clips=3
weapon(3).maxclips=3
weapon(3).bulletlife=100
weapon(3).bulletdamage=2000
weapon(3).bulletspeed=100
`Define the main variables needed
PlayerHP=2000`----------Player's Health
MaxPlayerHP=2000`-------Player's Max Health
EnemyHP=2000`-----------Enemy's Health
MaxEnemyHP=2000`--------Enemy's Max Health
ArmorHP=500`------------Armor Health
play_out = 0`-----------Tells when player has gone off matrix
`---------------------------------------------------------------
`------------------In Game Objects------------------------------
`---------------------------------------------------------------
`Create Main Player
MAKE OBJECT SPHERE 1,50:COLOR OBJECT 1,RGB(255,000,000):POSITION OBJECT 1,RND(1000),Ground#+25,RND(1000)
`Create Enemy Player
MAKE OBJECT SPHERE 2,50:COLOR OBJECT 2,RGB(255,000,000):POSITION OBJECT 2,RND(1000),Ground#+25,RND(1000)
`create rifle
MAKE OBJECT CUBE 3,10:COLOR OBJECT 3,RGB(000,000,255):POSITION OBJECT 3,100,Ground#+5,160
`create rocket launcher
MAKE OBJECT CUBE 4,10:COLOR OBJECT 4,RGB(000,000,255):POSITION OBJECT 4,100,Ground#+5,190
`create shotgun
MAKE OBJECT CUBE 5,10:COLOR OBJECT 5,RGB(000,000,255):POSITION OBJECT 5,100,Ground#+5,220
`create armor
MAKE OBJECT CUBE 6,10:COLOR OBJECT 6,RGB(000,255,000):POSITION OBJECT 6,100,Ground#+5,250
`create bullets
for b=10 to 999
make object sphere b,1
color object b,rgb(200,100,50)
position object b, camera position x(),camera position y(),camera position z()
hide object b
next b
`---------------------------------------------------------------
`------------------Main Do/Loop---------------------------------
`---------------------------------------------------------------
DO
`---------------------------------------------------------------
`------------------Info Display---------------------------------
`---------------------------------------------------------------
`Add a target reticule to the screen
CIRCLE SCREEN WIDTH()/2,SCREEN HEIGHT()/2,5
`Camera Positioning
POSITION CAMERA OBJECT POSITION X(1),OBJECT POSITION Y(1)+10,OBJECT POSITION Z(1)
`---------------------------------------------------------------
`------------------Shooting-------------------------------------
`---------------------------------------------------------------
`Mouseclick Shooting
if keystate(19)=0 AND mouseclick()=1 AND weapon(CWeapon).bulletlife > 0 AND weapon(CWeapon).ammo > 0
show Object b
move object b,weapon(CWeapon).bulletspeed
if object exist(b)=1 and weapon(CWeapon).bulletlife > 0
dec weapon(CWeapon).bulletlife
endif
if weapon(CWeapon).bulletlife = 0
dec weapon(CWeapon).ammo,1
endif
`IF weapon(CWeapon).ammo>0 THEN DEC weapon(CWeapon).ammo,1
if object collision (b,0)
dec enemyhp, weapon(CWeapon).bulletdamage
endif
`If intersect object (2, limb position x(1,1), limb position y(1,1), limb position z(1,1), play_x#, Play_y#, PLay_z#)>0 then dec enemyhp,weapon(CWeapon).bulletdamage
if CWeapon>0
TEXT 0,SCREEN HEIGHT()-50,"Ammo: "+str$(weapon(CWeapon).ammo)
TEXT 0,SCREEN HEIGHT()-40,"Clips: "+str$(weapon(CWeapon).clips)
endif
ENDIf
`Show that we're reloading
IF Reload=1 THEN CENTER TEXT SCREEN WIDTH()/2,SCREEN HEIGHT()/2,"Reloading..."
`Reloading (press R)
IF MOUSECLICK()=0 AND KEYSTATE(19)=1 AND weapon(CWeapon).ammo<weapon(CWeapon).maxammo AND weapon(CWeapon).clips>0
Reload=1
ENDIF
SYNC
LOOP