Finishing up shooting, I have the paintball splat ending up where I want it to, but I still have errors, I get the message "Collision idnex out of range: 1". Can somebody please try to help me fix this?
#include "include/NGCollision.dba"
sync on
hide mouse
set ambient light 70
`****************************************
`Nuclear Glory Variables
`****************************************
StartCollisionPRO(cantTELL,cantTELL,cantTELL)
StartCollisionDebugPRO()
#Constant TYPE_NGC_ELLIP=1
#Constant TYPE_NGC_MESH=2
#Constant ELLIP_2_ELLIP=1
#Constant ELLIP_2_POLY=2
#Constant RESP_STICK=1
#Constant RESP_SLIDE=2
#Constant RESP_SLIDE_NO_SLOPES=3
#Constant RESP_SLIDE_NO_GRAV=4
#Constant RESP_NONE=5
#Constant DYN_NO_RESP=1
#Constant DYN_RESP=2
#Constant DYN_RESP_LOCK=3
#Constant DYN_RESP_LOCK_NOTURN=4
forward=3
backward=-2
strafe=2
pitch=3
turn=2
distance = 60
fieldOBJ = 1
playerOBJ = 2
gun1obj = 3
gun2obj = 4
gun3obj = 5
gun4obj = 6
gun5obj = 7
gun6obj = 8
gun7obj = 9
gun8obj = 10
gun9obj = 11
gun10obj = 12
curGUNnum = 1
curGUN = curGUNnum + 2
splatOBJ = 13
curBALL = 1
bulletOBJ = 14
paintballs = 100
ballnum = 1
`****************************************
`Load Media
`****************************************
load image "gun1.bmp",100
load image "media/2Dart/paint_red.bmp",100
load image "media/2Dart/paint_green.bmp",101
load image "media/2Dart/paint_blue.bmp",102
load image "media/2Dart/splat.bmp",103
load object "media/3Dart/xball.3ds",fieldOBJ
rotate object fieldOBJ,270,90,0
fix object pivot fieldOBJ
`load image "level.bmp",2
`texture object 2,2
load object "player.3ds",playerOBJ
rotate object playerOBJ,270,90,0
fix object pivot playerOBJ
hide object playerOBJ
load object "media/3Dart/gun1.3ds",gun1obj
texture object gun1obj,100
lock object on gun1obj
rotate object gun1obj,270,75,0
position object gun1obj,0.5,-1,5
disable object zdepth gun1obj
hide object gun1obj
load object "media/3Dart/gun2.3ds",gun2obj
texture object gun2obj,100
lock object on gun2obj
rotate object gun2obj,270,75,0
position object gun2obj,0.5,-1,5
disable object zdepth gun2obj
hide object gun2obj
load object "media/3Dart/gun3.3ds",gun3obj
texture object gun3obj,100
lock object on gun3obj
rotate object gun3obj,270,75,0
position object gun2obj,0.5,-1,5
disable object zdepth gun3obj
hide object gun3obj
make object plain splatOBJ,50,50
texture object splatOBJ,103
set object transparency splatOBJ,1
hide object splatOBJ
make object sphere bulletOBJ,2
color object bulletOBJ,rgb(255,128,0)
` define collision types
#Constant EYES=3
#Constant WORLD=2
#Constant PLAYER=1
#Constant ENEMY=4
#Constant BALL=5
`set collision types
SetCollisionsPRO(EYES,WORLD,ELLIP_2_POLY,RESP_SLIDE,DYN_NO_RESP)
SetCollisionsPRO(EYES,ENEMY,ELLIP_2_ELLIP,RESP_SLIDE,DYN_NO_RESP)
SetCollisionsPRO(PLAYER,WORLD,ELLIP_2_POLY,RESP_SLIDE_NO_GRAV,DYN_NO_RESP)
SetCollisionsPRO(PLAYER,ENEMY,ELLIP_2_ELLIP,RESP_SLIDE,DYN_NO_RESP)
SetCollisionsPRO(ENEMY,PLAYER,ELLIP_2_ELLIP,RESP_SLIDE,DYN_NO_RESP)
SetCollisionsPRO(ENEMY,ENEMY,ELLIP_2_ELLIP,RESP_SLIDE,DYN_NO_RESP)
SetCollisionsPRO(ENEMY,WORLD,ELLIP_2_POLY,RESP_SLIDE_NO_GRAV,DYN_NO_RESP)
SetCollisionsPRO(BALL,WORLD,ELLIP_2_POLY,RESP_SLIDE_NO_GRAV,DYN_NO_RESP)
SetCollisionsPRO(BALL,ENEMY,ELLIP_2_POLY,RESP_SLIDE_NO_GRAV,DYN_NO_RESP)
` assign collision types
CollisionTypePRO(playerOBJ,PLAYER)
CollisionTypePRO(fieldOBJ,WORLD)
CollisionTypePro(bulletOBJ,BALL)
` set scales
SetObjScalePRO(fieldOBJ,5000,5000,5000)
SetObjScalePRO(playerOBJ,5000,5000,5000)
SetEllipOffsetPRO(playerOBJ,0,object size y(playerOBJ)/2,0)
Rem *****************
Rem ****Main Loop****
Rem *****************
do
show object curGUN
Rem ****Movement****
xang#=wrapvalue(xang#+(mousemovey()/pitch))
yang#=wrapvalue(yang#+(mousemovex()/turn))
if xang#>80 and xang#<180 then xang#=80
if xang#<300 and xang#>180 then xang#=300
rotate object playerOBJ,0,yang#,0
if upkey()=1 then move object playerOBJ,forward
if downkey()=1 then move object playerOBJ,backward
if leftkey()=1 then move object left playerOBJ,strafe
if rightkey()=1 then move object right playerOBJ,strafe
Rem ****Position Camera****
position camera object position x(playerOBJ),30,object position z(playerOBJ)
rotate camera xang#,yang#,0
Rem ****Shooting****
y#=camera angle y()
if mouseclick()=1 and shot=0
inc shots,1
hide object bulletOBJ
position object bulletOBJ,object position x(curGUN),object position y(curGUN)+10,object position z(curGUN)
show object bulletOBJ
yrotate object bulletOBJ,y#
shot=1
endif
if shot=1
move object bulletOBJ,30
far=far+1
endif
if far>=200 and shot=1
hide object bulletOBJ
far=0
shot=0
endif
Rem ****Collision****
RunCollisionPRO()
colOBJ=CollisionHitObj(bulletOBJ, 1)
x#=CollisionHitX(bulletOBJ, 1)
y#=CollisionHitY(bulletOBJ, 1)
z#=CollisionHitZ(bulletOBJ, 1)
if object collision(bulletOBJ,colOBJ)=1
hide object splatOBJ
position object splatOBJ,x#,y#,(z# - 1)
show object splatOBJ
shot=0
far=0
endif
sync
loop