Hello. Ok, the title is a misnomer.
I am not working lol! OK, just got bought the Nuclear Glory Collision program day before yesterday, and it looks like it will be very cool, but I have a few issues. Before I begin, I will say that I have loaded the .dll into the project and loaded the NGCollision.dba just like it said. And I use
DBpro.
First, I get an error (from the debug, not a terminal error) when running that says: "object not defined in collision system: 1". Still trying to figure out the whole defining thing (for some reason, the whole making up numbers and TYPEs is confusing me, I think), but I thought I got it...
Second, my loaded objects are still
really tiny! I substituted the "SetObjScalePro( player, 4000, 4000, 4000 )" command in place of my old "scale object 3, 4000, 4000, 4000", but it does not seem to scale them bigger.
Third, I decided to check the collision anyway, even with the
tiny models. As you can see from the code, I am simply trying to set it so that my player and enemy on screen cannot move through each other or a pillar on the matrix. I am still trying to completely grasp the collision system (I have really only been looking at it for the last day).
Thanks for you help!
Here is the code:
sync on
sync rate 60
backdrop on
fog on
fog distance 4000
set camera range 1,5000
load sound "music misty room loop.wav",1
loop sound 1
load sound "THUMP.wav",2
load sound "9_53.wav",3
rem start Nukin'
StartCollisionPro( 00000000, 000000000, 000000000 )
StartCollisionDebugPro()
rem declare some constants
#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
#constant TYPE_PLAYER = 1
#constant TYPE_OBJ = 17
#constant TYPE_ENEMY = 2
rem set fog
fog color rgb(28,28,28)
color backdrop rgb(28,28,28)
rem make matrix
make matrix 1,10000,10000,20,20
load image "lead.bmp",1
prepare matrix texture 1,1,1,1
position camera 100,0,100
rem load player
player = 1
load object "L-Knight-Idle.x",player
append object "L-Knight-Move.x",player,25
append object "L-Knight-Attack1.x",player,50
append object "H-Knight-Impact.x",player,75
CollisionTypePro( player, TYPE_PLAYER )
SetObjScalePro(player,4000,4000,4000)
yrotate object player,180
fix object pivot player
rem load enemy
monX# = 150
monZ# = 150
rollbug = 3
load object "L-Alien Rollerbug-Idle.x",rollbug
append object "L-Alien Rollerbug-Attack1.x",rollbug,25
CollisionTypePro( rollbug, TYPE_ENEMY )
SetObjScalePro(rollbug,4000,4000,4000)
position object rollbug,monX#,0,monZ#
rem make pillar
pillar = 2
load image "Sandstone_cliff_T.bmp",pillar
make object box pillar,400,10000,400
position object pillar,400,0,400
texture object pillar,2
CollisionTypePro( pillar, TYPE_OBJ )
health = 100
a = 0
rem Begin Collision Detections
rem Define Player to enemy collision
SetCollisionsPro( TYPE_PLAYER, TYPE_ENEMY, ELLIP_2_ELLIP, RESP_SLIDE, DYN_NO_RESP )
rem Define Enemy to player collision
SetCollisionsPro( TYPE_ENEMY, TYPE_PLAYER, ELLIP_2_ELLIP, RESP_SLIDE, DYN_NO_RESP )
rem Define Player to World Objects
SetCollisionsPro( TYPE_PLAYER, TYPE_OBJ, ELLIP_2_ELLIP, RESP_SLIDE, DYN_NO_RESP )
rem Define Enemy to World Objects
SetCollisionsPro( TYPE_ENEMY, TYPE_OBJ, ELLIP_2_ELLIP, RESP_SLIDE, DYN_NO_RESP )
rem run Nuclear Glory
RunCollisionPro()
rem main game loop
Do
rem loop monster1 and get monster's positions
MangleY# = object angle Y(3)
MangleX# = object angle X(3)
loop object 3,1,25
rem set up health bar
set cursor 0,0
box 10,20,health,30,0,255,0,0
rem get last frame
totalz3 = total object frames(3)
totalz = total object frames(1)
print totalz
loop object 1,1,25
Rem Store Object angle Y in aY#
aY# = Object angle Y(1)
Rem Control input for camera
If Upkey()=1
Move object 1,3
loop object 1,25,50
endif
if spacekey()=1
loop object 1,50,75
soundInt = sound playing(2)
rem X if soundInt = 0 then play sound 2
endif
if controlkey()=1
health = health - 1
if health<0 then health = 0
endif
if shiftkey()=1
health = health + 1
if health>100 then health = 100
endif
If Leftkey()=1 then Yrotate object 1,Wrapvalue(aY#-2.5)
If Rightkey()=1 then Yrotate object 1,Wrapvalue(aY#+2.5)
rem move monster1
if scancode() = 2
move object 3,1.75
endif
rem move monster1 back
if scancode() = 3
move object 3,-1.75
endif
rem attempt to rotate monster1 on Y axis
if scancode() = 4
Yrotate object 3,wrapvalue(MangleY#+1.5)
endif
if scancode() = 5
Yrotate object 3,wrapvalue(MangleY#-1.5)
endif
rem make monster1 test attack
if scancode() = 6
loop object 3,25,50
soundInt2 = sound playing(3)
if soundInt2 = 0 then play sound 3
endif
Rem get player object position and store in X# and Z#
X# = Object position x(1)
Z# = Object position z(1)
rem store monster1 position
monX# = object position x(3)
monZ# = object position z(3)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,100,cZ#
Rem point the camera at the player object
Point camera X#,50,Z#
Rem Refresh Screen
Sync
Loop
"I attribute the quarrelsome nature of the Middle Ages young men entirely to the want of the soothing weed."
-Jerome K. Jerome(1859-1927),Writer