Hey guys,
So iv been using dark basic professional for a while til i came across extends so i bought started trying it out and then started implementing its real time skybox feature into my game
Then i came across a bug that is not even letting me start my demo,
I attached the source on this post so please take a look at that right here:
Rem Project: jungler
Rem Created: Wednesday, September 22, 2011
Rem Author: Tokyomage (Arman)
Rem ***** Main Source
set window title "jungler by arman"
SET DISPLAY MODE 1024,768,32
hide mouse
sync on
autocam off
sync rate 55
set text font "Verdana"
backdrop off
set text size 14
AI Start
phy start
phy enable debug
` @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
` @@@@ sky sphere + camera @@@@@
` @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
make camera 1
position camera 1, 7, 8.6, 20
set camera range 1, 200000
SET SHADOW LIGHT 0,100,100,100,1000
POSITION LIGHT 0,100,100,100
SET LIGHT RANGE 0,1000
fog on
rts fog on
rts setup skybox "RTS_snowmountain", 1
rts set clock 0,0,1.0
rts set wind speed 0.0001, 0.0005
mountainline = RTS get loaded object (9)
` @@@@@@@@@@@@@@@@@@@@@
` @@@@ anims (help) @@@
` @@@@@@@@@@@@@@@@@@@@@
`swat guy (plr)
`1=idle
`2=move
`3=attack
`4=impact
`5=die
` @@@@@@@@@@@@@@@@@@
` @@@@ variables @@@
` @@@@@@@@@@@@@@@@@@
`camera vars:
global camheight as integer
camheight = 15
`animation vars:
`swat guy (plr)
swatObjectWalking = 0
swatObjectidle = 0
`inventory vars
KeyPressed = 0
ShowInventory = 0
`plr vars
plrhealth= 100
plrmajyk= 0
plrgold= 23
` @@@@@@@@@@@@@@@
` @@@@ models @@@
` @@@@@@@@@@@@@@@
`all npc`s
`swat guy (plr)
load object "files/models/swat/H-SWAT-Idle.x",1
YROTATE OBJECT 1,180
fix object pivot 1
point object 1 ,0,0,180
position object 1, 7, 7, 20
SET OBJECT COLLISION ON 1
phy make rigid body static mesh 1
phy set rigid body ccd 1, 1
load object "files/models/swat/H-SWAT-Move.x",6
SET OBJECT COLLISION ON 6
phy make rigid body static mesh 6
phy set rigid body ccd 6, 1
load object "files/models/swat/H-SWAT-Die.x",7
SET OBJECT COLLISION ON 7
phy make rigid body static mesh 7
phy set rigid body ccd 7, 1
swatIdleStartframe = 0
append object "files/models/swat/H-SWAT-Idle.x", 1, total object frames(1)+1
swatIdleFinalFrame = Total Object Frames(1)
swatmoveStartFrame = Total Object Frames(1) + 1
Append Object "files/models/swat/H-SWAT-Move.x", 1,Total Object Frames(1) + 1
swatmoveFinalFrame = Total Object Frames(1)
swatDieStartFrame = Total Object Frames(1) + 1
Append Object "files/models/swat/H-SWAT-Die.x",1, Total Object Frames(1) + 1
swatDieFinalFrame = Total Object Frames(1)
`all phy based obj`s
make object cube 8, .4
position object 8, 6, 9, 23
phy make rigid body dynamic box 8
phy set rigid body gravity 8, 1
SET OBJECT COLLISION TO BOXes 8
make object cube 9, .5
position object 9, 9, 9, 23
phy make rigid body dynamic box 9
phy set rigid body gravity 9, 1
SET OBJECT COLLISION TO BOXes 9
rem key quest
make object cube 10, 1
position object 10, 5, 9, 23
phy make rigid body dynamic box 10
phy set rigid body gravity 10, 1
SET OBJECT COLLISION TO BOXes 10
`zombie enemie
load object "files/models/zombie/H-Zombie-Move.x",2
fix object pivot 2
point object 2 ,3,0,180
position object 2, 0, 7, -18
loop object 2
`quest guy
load object "files/models/villager/H-Cyborg-Idle.x",12
fix object pivot 12
point object 12 ,5,0,300
position object 12 ,8, 7, 23
loop object 12
`all trees
load object "files/models/snowytree1/snowy tree.x",3
fix object pivot 3
point object 3 ,3,0,180
position object 3, 7, 7, 20
set alpha mapping on 3,99
SCALE OBJECT 3, 10, 10, 10
phy make rigid body static mesh 3
` @@@@@@@@@@@@@@@@@@@@@@
` @@@@ particles/fx @@@@
` @@@@@@@@@@@@@@@@@@@@@@
load image "files/particles/snow.PNG",3
make snow particles 1, 3, 500,7,14,20, 10,10,10
load effect "files/shaders/frozen.fx", 1, 1
set object effect 12, 1
` @@@@@@@@@@@@@@@
` @@@@ maps @@@@@
` @@@@@@@@@@@@@@@
load object "files/maps/mountain village 1/area.x",4
point object 4 ,3,0,180
position object 4, 7, 7, 20
SCALE OBJECT 4, 1.4, 1.4, 1.4
phy make rigid body static mesh 4
` @@@@@@@@@@@@@@@@
` @@@@ sounds @@@@
` @@@@@@@@@@@@@@@@
load sound "files/sounds/footsteps/snow.WAV",1
` @@@@@@@@@@@@@@@
` @@@@ music @@@@
` @@@@@@@@@@@@@@@
load music "files/music/snowamb.wav",1
` @@@@@@@@@@@@@@@@@
` @@@@ textures @@@
` @@@@@@@@@@@@@@@@@
`inventory
load image "files/images/inventory/inventory.PNG",6
`key quest
load image "files/images/keyquest/crate.PNG",7
load image "files/images/keyquest/key.PNG",9
`swat guy (plr)
load image "files/textures/swat/swat.DDS",1
texture object 1,1
`zombie enemie
load image "files/textures/zombie/zombie.DDS",2
texture object 2,2
`quest guy
load image "files/textures/villager/cyborg.DDS",8
texture object 12, 8
`crates
load image "files/textures/box/crate.JPG",5
texture object 8,5
texture object 9,5
texture object 10,5
` @@@@@@@@@@@@@@@@@@@
` @@@@ objshading @@@
` @@@@@@@@@@@@@@@@@@@
`swat guy (plr)
SET SHADOW SHADING ON 1,-1,200,1
`zombie enemie
SET SHADOW SHADING ON 2,-1,200,1
`quest guy
SET SHADOW SHADING ON 12,-1,200,1
`snowytree1
SET SHADOW SHADING ON 3,-1,200,1
`mountain village 1
SET SHADOW SHADING ON 4,-1,200,1
` ####@@@@@@@@@@@@@@@#####
` #####!!MAIN CODE!!######
` ####@@@@@@@@@@@@@@@#####
do
TEXT 10,60,"Health: "+ STR$(plrhealth)
center text object screen x ( 8 ), object screen y ( 8 ) - 50, "empty crate"
center text object screen x ( 9 ), object screen y ( 9 ) - 50, "empty crate"
center text object screen x ( 10 ), object screen y ( 10 ) - 50, "crate"
control camera using arrowkeys 1,.2,1
if keystate (44)=1
Play Object 1, swatDiestartFrame, swatDieFinalFrame
endif
if keystate (45) = 1
Play Object 1, swatIdleStartframe, swatIdlefinalframe
endif
if upkey()=1 and swatObjectWalking = 0
MOVE OBJECT 1,.10
play sound 1
loop Object 1, swatmoveStartFrame, swatmoveFinalFrame
swatObjectWalking = 1
else
swatObjectWalking = 0
ENDIF
if leftkey()=1
turn object left 1,2
loop Object 1, swatmoveStartFrame, swatmoveFinalFrame
swatObjectWalking = 1
ENDIF
if rightkey()=1
turn object right 1,2
loop Object 1, swatmoveStartFrame, swatmoveFinalFrame
swatObjectWalking = 1
else
swatObjectWalking = 0
ENDIF
if downkey()=1
MOVE OBJECT 1,-.10
loop Object 1, swatmoveStartFrame, swatmoveFinalFrame
swatObjectWalking = 1
else
swatObjectWalking = 0
ENDIF
if upkey()=0 and downkey()=0 and leftkey()=0 and rightkey()=0 and swatObjectidle = 0
loop Object 1, swatidleStartFrame, swatidleFinalFrame
swatObjectWalking = 1
else
swatObjectidle = 0
endif
if inkey$() = ""
KeyPressed = 0
endif
if Inkey$() = "i" and KeyPressed = 0
if ShowInventory = 0
ShowInventory = 1
else
ShowInventory = 0
endif
KeyPressed = 1
endif
if ShowInventory = 1
Paste image 6, 300, 300
TEXT 390,690,"" + str$(plrgold)
TEXT 530,690,"" + str$(plrhealth)
TEXT 695,690,"" + str$(plrmajyk)
endif
IF OBJECT COLLISION(1,10)=1
Paste image 7, 300, 300
Paste image 9, 347, 400
ENDIF
RTS update skybox
B3D update billboards
loop music 1
phy update
sync
LOOP
:The problem: So when i run and compile my code i am unhappy to see a "runtime error 7007 - object already exists at line 85" error.
What i think: I believe that
at line 37:"rts setup skybox "RTS_snowmountain", 1" in it, at the end where you see the number is supposed to be a camera type. But i believe it is perceiving it as an object, meaning
at line 85"load object "files/models/swat/H-SWAT-Idle.x",1" it apparently takes that camera type as object.
Just my opinion, if you have any ideas then please feel free to post any ideas on how i can fix this.
Thanks,
-Tokyomage
.....the feel of solitude hurts inside....