I made a map in mapscape (I also tried 3DWS) and I can load it fine into my engine and there is collision, but the map is to big, it makes the player look like a mouse, because the world is too big (screenshot attached of this). Whenever I use the scale object command to make it smaller it works, but you fall through the floor and there is no collision. I am using Sparky's Collision, I can't progress any further with my engine or making maps until I can solve this dilema. Here is my entire code
sync on : sync rate 60
hide mouse
autocam off
perform checklist for display modes
for c=1 to checklist quantity()
width=checklist value a(c)
height=checklist value b(c)
next c
set display mode width, height, 32
if check display mode(width, height, depth)=1
endif
radius# = 7.0
gravity# = -0.1
slope# = 0.5
ground = 1
jumptimer = 0
gosub Make_Level
gosub Make_Player
gosub Make_Weapons
do
if inkey$()="v" and vtimer<timer() then vtimer = timer()+300 : view = 1-view
positionCameraToObject(2,view)
text 0, 0, "x = "+str$(object position x(2))
text 0, 20, "y = "+str$(object position y(2))
text 0, 40, "z = "+str$(object position z(2))
text 0, 60, "x rot = "+str$(object angle x(2))
text 0, 80, "y rot = "+str$(object angle y(2))
text 0, 100, "z rot = "+str$(object angle z(2))
text 0, 140, "Touching Ground: "+str$(ground)
text 0, 120, "FPS: "+str$(screen fps())
yrotate object 2,object angle y(2)+mousemovex()/3.0
xrotate object 2,object angle x(2)+mousemovey()/3.0
oldx# = object position x(2)
oldy# = object position y(2)
oldz# = object position z(2)
angy# = object angle y(2)
vx# = 0
vz# = 0
if vy#=0 and jumptimer=0 then vy# = vy# + 10*gravity# else vy# = vy# + gravity#
if keystate(32)=1 then vx# = vx# + cos(angy#) : vz# = vz# - sin(angy#)
if keystate(30)=1 then vx# = vx# - cos(angy#) : vz# = vz# + sin(angy#)
if keystate(31)=1 then vx# = vx# - sin(angy#) : vz# = vz# - cos(angy#)
if keystate(17)=1 then vx# = vx# + sin(angy#) : vz# = vz# + cos(angy#)
if ground=1
if spacekey()=1 and jumptimer=0 then vy# = vy# + 3.0 : jumptimer = 20
endif
x# = oldx#+vx#
y# = oldy#+vy#
z# = oldz#+vz#
collide = sc_SphereCastGroup(1,oldx#,oldy#,oldz#,oldx#,oldy#+vy#,oldz#,radius#,0)
if collide>0
ny# = sc_getCollisionNormalY()
if abs(ny#)>slope#
oldy# = sc_getStaticCollisionY()
else
x# = x# - oldx# : z# = z# - oldz#
oldx# = sc_getCollisionSlideX()
oldy# = sc_getCollisionSlideY()
oldz# = sc_getCollisionSlideZ()
x# = x# + oldx# : z# = z# + oldz#
endif
if ny#>slope#
ground = 1
vy# = 0
else
ground = 0
if ny#<-slope# then vy# = gravity#
endif
else
oldy# = oldy# + vy#
ground = 0
endif
if ground = 1 and jumptimer>0 then dec jumptimer
collide = sc_SphereSlideGroup(1,oldx#,oldy#,oldz#,x#,oldy#,z#,radius#,0)
if collide>0
x# = sc_getCollisionSlideX()
oldy# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
vx# = 0
vz# = 0
endif
position object 2,x#,oldy#,z#
sc_updateObject 2
if mouseclick() = 1
play sound 1
play object 3, 130, 189
set object speed 3, 38
endif
if mouseclick() = 1
play sound 3
play object 4, 111, 135
set object speed 4, 38
endif
if mouseclick() = 1
play sound 5
play object 5, 140, 186
set object speed 5, 38
endif
if mouseclick() = 1
play sound 7
play object 6, 111, 135
set object speed 6, 38
endif
if keystate(2)=1
play object 4, 20, 40
play sound 4
set object speed 4, 38
hide object 3
hide object 5
hide object 6
show object 4
endif
if keystate(4)=1
play object 3, 20, 32
set object speed 3, 38
hide object 4
hide object 5
hide object 6
show object 3
endif
if keystate(3)=1
play object 5, 20, 45
set object speed 5, 38
hide object 4
hide object 3
hide object 6
show object 5
endif
if keystate(5)=1
play object 6, 20, 40
set object speed 6, 38
hide object 4
hide object 3
hide object 5
show object 6
endif
sync
loop
Make_Level:
load object "C:dr6 Engine v1dataworldstest_world.dbo", 1
`scale object 1, 10, 10, 10
load effect "C:dr6 Engine v1datashaderslight_map.fx", 1, 0
set object effect 1, 1
sc_setupComplexObject 1, 1, 2
return
Make_Player:
make object sphere 2, radius#*2
position object 2, 0, 50, 0
sc_setupObject 2, 0, 1
return
function positionCameraToObject(obj,thirdPerson)
position camera object position x(2),object position y(2),object position z(2)
rotate camera object angle x(2),object angle y(2),object angle z(2)
if thirdPerson=1
pitch camera down 10
move camera -30
endif
endfunction
Make_Weapons:
load object "C:dr6 Engine v1datamodelsweaponsold_crossbowHUD.x", 3
load object "C:dr6 Engine v1datamodelsweaponscommon_swordHUD.x", 4
load object "C:dr6 Engine v1datamodelsweaponswooden_bowHUD.x", 5
load object "C:dr6 Engine v1datamodelsweaponsmaceHUD.x", 6
rotate object 3, 0, 180, 0
position object 3, 0.5, -1, 2
scale object 3, 30, 30, 30
rotate object 4, 0, 180, 0
position object 4, 0.5, -1, 2
scale object 4, 30, 30, 30
rotate object 5, 0, 180, 0
position object 5, 0.5, -1, 2
scale object 5, 30, 30, 30
rotate object 6, 0, 180, 0
position object 6, 0.5, -1, 2
scale object 6, 30, 30, 30
load image "C:dr6 Engine v1datamodelsweaponsold_crossbowgun_D2.dds", 1
load image "C:dr6 Engine v1datamodelsweaponscommon_swordgun_D2.dds", 2
load image "C:dr6 Engine v1datamodelsweaponswooden_bowgun_D2.dds", 3
load image "C:dr6 Engine v1datamodelsweaponsmacegun_D2.dds", 4
texture object 3, 0, 1
texture object 4, 0, 2
texture object 5, 0, 3
texture object 6, 0, 4
load sound "C:dr6 Engine v1datamodelsweaponsold_crossbowfire.wav", 1
load sound "C:dr6 Engine v1datamodelsweaponscommon_swordfire.wav", 3
load sound "C:dr6 Engine v1datamodelsweaponscommon_swordselect.wav", 4
load sound "C:dr6 Engine v1datamodelsweaponswooden_bowfire.wav", 5
load sound "C:dr6 Engine v1datamodelsweaponswooden_bowreload.wav", 6
load sound "C:dr6 Engine v1datamodelsweaponsmacefire.wav", 7
lock object on 3
disable object zdepth 3
lock object on 4
disable object zdepth 4
lock object on 5
disable object zdepth 5
lock object on 6
disable object zdepth 6
hide object 3
hide object 5
hide object 6
loop object 3, 40, 80
loop object 4, 41, 83
loop object 5, 60, 100
loop object 6, 41, 83
return
if memblock exist(1) then delete memblock 1
I tried increasing the radius of the players collision sphere and it worked to some extent, it made the player bigger but you could't move because the collision sphere was so big.