Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Help please - Error "Bob does not exist" ?????

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 2nd May 2008 01:50
I have started geting a random error "Bob does not exist" I have no idea what this is and am unable to debug it.

Any guidance as what "Bob" is and how to resolve the issue o prevent this error.. thx
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 2nd May 2008 04:18 Edited at: 2nd May 2008 04:19
This problem happened to me.
A Bob is another word for sprite, and it was used as a keyword in old versions of DBC.
When the DBC creators made a new version with sprites instead of bobs, they replaced all the Bobs in the complier and replaced them with sprite.
But they forgot to change that! It happened to me, and I was confused, too.
Can you post the code? That would help a lot.


Kirby is in my avatar because he rules. Live with it!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd May 2008 14:58
Your problem is probably something like this:



If you use the command sprite x() or sprite y() the sprite has to exist, or you get that error.

Oooooops!!! I accidentally formated drive c.
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 2nd May 2008 19:13
with 6000 lines of code can't post it but at least I can focus on the sprites now and check they are implemented correctly... thx guys
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 3rd May 2008 01:33
Actually here is probably where error is, but can't see it

Graphic_Race_Setup:

WayPointCounter = 0

REM Image mapping, correct car to position i.e Image 25 (Driver Schumacher) =leader

Car(20)=24
Car(0)=25
Car(1)=26
Car(2)=27
Car(3)=28
Car(4)=29
Car(5)=30
Car(6)=31
Car(7)=32
Car(8)=33
Car(9)=34
Car(10)=35
Car(11)=36
Car(12)=37
Car(13)=38
Car(14)=39
Car(15)=40
Car(16)=41
Car(17)=42
Car(18)=43
Car(19)=44

CarPos20=0
CarPos0=0
CarPos1=0
CarPos2=0
CarPos3=0
CarPos4=0
CarPos5=0
CarPos6=0
CarPos7=0
CarPos8=0
CarPos9=0
CarPos10=0
CarPos11=0
CarPos12=0
CarPos13=0
CarPos14=0
CarPos15=0
CarPos16=0
CarPos17=0
CarPos18=0
CarPos19=0

REM Starting positions on Grid
Car0Lead=14
Car1Lead=12
Car2Lead=10
Car3Lead=8
Car4Lead=7
Car5Lead=7
Car6Lead=6
Car7Lead=6
Car8Lead=6
Car9Lead=6
Car10Lead=5
Car11Lead=5
Car12Lead=4
Car13Lead=4
Car14Lead=3
Car15Lead=3
Car16Lead=2
Car17Lead=2
Car18Lead=1
Car19Lead=0

Load Image "misc/CarSC.bmp",24:`Safety CAR
Load Image "misc/Car0.bmp",25:`CAR No.1
Load Image "misc/Car1.bmp",26:`CAR No.2
Load Image "misc/Car2.bmp",27:`CAR No.3
Load Image "misc/Car3.bmp",28:`CAR No.4
Load Image "misc/Car4.bmp",29:`CAR No.5
Load Image "misc/Car5.bmp",30:`CAR No.6
Load Image "misc/Car6.bmp",31:`CAR No.1
Load Image "misc/Car7.bmp",32:`CAR No.1
Load Image "misc/Car8.bmp",33:`CAR No.1
Load Image "misc/Car9.bmp",34:`CAR No.1
Load Image "misc/Car10.bmp",35:`CAR No.1
Load Image "misc/Car11.bmp",36:`CAR No.1
Load Image "misc/Car12.bmp",37:`CAR No.1
Load Image "misc/Car13.bmp",38:`CAR No.1
Load Image "misc/Car14.bmp",39:`CAR No.1
Load Image "misc/Car15.bmp",40:`CAR No.1
Load Image "misc/Car16.bmp",41:`CAR No.1
Load Image "misc/Car17.bmp",42:`CAR No.1
Load Image "misc/Car18.bmp",43:`CAR No.20
Load Image "misc/Car19.bmp",44:`CAR No.21

Gosub LoadWayPoints

Return



Graphic_Race:
REM When car in Pits n=0 for that car, waypoint = 0

For m= 0 to NumWaypoints

Gosub Menu


REM graphic race display

REM Safety Car

Carx(20)=(WayPoints(CarPos20,0))
Cary(20)=(WayPoints(CarPos20,1))



REM LEAD CAR
Carx(0)=(WayPoints(CarPos0,0))
Cary(0)=(WayPoints(CarPos0,1))

REM 2nd CAR
Carx(1)=(WayPoints(CarPos1,0))
Cary(1)=(WayPoints(CarPos1,1))

REM 3rd CAR
Carx(2)=(WayPoints(CarPos2,0))
Cary(2)=(WayPoints(CarPos2,1))

REM 4th CAR
Carx(3)=(WayPoints(CarPos3,0))
Cary(3)=(WayPoints(CarPos3,1))

REM 5th CAR
Carx(4)=(WayPoints(CarPos4,0))
Cary(4)=(WayPoints(CarPos4,1))

REM 6th CAR
Carx(5)=(WayPoints(CarPos5,0))
Cary(5)=(WayPoints(CarPos5,1))

REM 7th CAR
Carx(6)=(WayPoints(CarPos6,0))
Cary(6)=(WayPoints(CarPos6,1))

REM 8th CAR
Carx(7)=(WayPoints(CarPos7,0))
Cary(7)=(WayPoints(CarPos7,1))

REM 9th CAR
Carx(8)=(WayPoints(CarPos8,0))
Cary(8)=(WayPoints(CarPos8,1))

REM 10th CAR
Carx(9)=(WayPoints(CarPos9,0))
Cary(9)=(WayPoints(CarPos9,1))

REM 11th CAR
Carx(10)=(WayPoints(CarPos10,0))
Cary(10)=(WayPoints(CarPos10,1))

REM 12th CAR
Carx(11)=(WayPoints(CarPos11,0))
Cary(11)=(WayPoints(CarPos11,1))

REM 13th CAR
Carx(12)=(WayPoints(CarPos12,0))
Cary(12)=(WayPoints(CarPos12,1))

REM 14th CAR
Carx(13)=(WayPoints(CarPos13,0))
Cary(13)=(WayPoints(CarPos13,1))

REM 15th CAR
Carx(14)=(WayPoints(CarPos14,0))
Cary(14)=(WayPoints(CarPos14,1))

REM 16th CAR
Carx(15)=(WayPoints(CarPos15,0))
Cary(15)=(WayPoints(CarPos15,1))

REM 17th CAR
Carx(16)=(WayPoints(CarPos16,0))
Cary(16)=(WayPoints(CarPos16,1))

REM 18th CAR
If DriversRunning>17:Carx(17)=(WayPoints(CarPos17,0)):Endif
If DriversRunning>17:Cary(17)=(WayPoints(CarPos17,1)):Endif

REM 19th CAR
If DriversRunning>18:Carx(18)=(WayPoints(CarPos18,0)):Endif
If DriversRunning>18:Cary(18)=(WayPoints(CarPos18,1)):Endif

REM 20th CAR
If DriversRunning>19:Carx(19)=(WayPoints(CarPos19,0)):Endif
If DriversRunning>19:Cary(19)=(WayPoints(CarPos19,1)):Endif


REM Variable for gap should be the 6 above.....

REM CAR0 is Leader

If SC=1 then Sprite 21,Carx(20)-5,Cary(20)-10,Car(20)

Sprite 1,Carx(0)-5,Cary(0)-10,Car(0)
Sprite 2,Carx(1)-5,Cary(1)-10,Car(1)
Sprite 3,Carx(2)-5,Cary(2)-10,Car(2)
Sprite 4,Carx(3)-5,Cary(3)-10,Car(3)
Sprite 5,Carx(4)-5,Cary(4)-10,Car(4)
Sprite 6,Carx(5)-5,Cary(5)-10,Car(5)
Sprite 7,Carx(6)-5,Cary(6)-10,Car(6)


If DriversRunning>7:Sprite 8,Carx(7)-5,Cary(7)-10,Car(7)
Elseelete Sprite 8
Endif

If DriversRunning>8:Sprite 9,Carx(8)-5,Cary(8)-10,Car(8)
Elseelete Sprite 9
Endif

If DriversRunning>9:Sprite 10,Carx(9)-5,Cary(9)-10,Car(9)
Elseelete Sprite 10
Endif

If DriversRunning>10:Sprite 11,Carx(10)-5,Cary(10)-10,Car(10)
Elseelete Sprite 11
Endif

If DriversRunning>11:Sprite 12,Carx(11)-5,Cary(11)-10,Car(11)
Elseelete Sprite 12
Endif

If DriversRunning>12:Sprite 13,Carx(12)-5,Cary(12)-10,Car(12)
Elseelete Sprite 13
Endif

If DriversRunning>13:Sprite 14,Carx(13)-5,Cary(13)-10,Car(13)
Elseelete Sprite 14
Endif

If DriversRunning>14:Sprite 15,Carx(14)-5,Cary(14)-10,Car(14)
Elseelete Sprite 15
Endif

If DriversRunning>15:Sprite 16,Carx(15)-5,Cary(15)-10,Car(15)
Elseelete Sprite 16
Endif

If DriversRunning>16:Sprite 17,Carx(16)-5,Cary(16)-10,Car(16)
Elseelete Sprite 17
Endif

If DriversRunning>17:Sprite 18,Carx(17)-5,Cary(17)-10,Car(17)
Elseelete Sprite 18
Endif

If DriversRunning>18:Sprite 19,Carx(18)-5,Cary(18)-10,Car(18)
Elseelete Sprite 19
Endif

If DriversRunning>19:Sprite 20,Carx(19)-5,Cary(19)-10,Car(19)
Elseelete Sprite 20
Endif

rem Adjust to make game / laps run slower from 120 norm ?

If SC=0
Wait 40
Endif

If SC=1
Wait 300
Endif




rem add on track detection and for in pits
REM leverage main on track code

Rem Car0 Lead Calculation

If CarPos20=>NumWaypoints then Carpos20=0
If CarPos0=>NumWaypoints then Carpos0=0
If CarPos1=>NumWaypoints then Carpos1=0
If CarPos2=>NumWaypoints then Carpos2=0
If CarPos3=>NumWaypoints then Carpos3=0
If CarPos4=>NumWaypoints then Carpos4=0
If CarPos5=>NumWaypoints then Carpos5=0
If CarPos6=>NumWaypoints then Carpos6=0
If CarPos7=>NumWaypoints then Carpos7=0
If CarPos8=>NumWaypoints then Carpos8=0
If CarPos9=>NumWaypoints then Carpos9=0
If CarPos10=>NumWaypoints then Carpos10=0
If CarPos11=>NumWaypoints then Carpos11=0
If CarPos12=>NumWaypoints then Carpos12=0
If CarPos13=>NumWaypoints then Carpos13=0
If CarPos14=>NumWaypoints then Carpos14=0
If CarPos15=>NumWaypoints then Carpos15=0
If CarPos16=>NumWaypoints then Carpos16=0
If CarPos17=>NumWaypoints then Carpos17=0
If CarPos18=>NumWaypoints then Carpos18=0
If CarPos19=>NumWaypoints then Carpos19=0



REM TO ADD on track calculation
REM Car20 Lead Calculation
For lead= 1 to Car20Lead
CarPos20=CarPos20+1
Next lead
Car20Lead=1



REM Car0 Lead Calculation
For lead= 1 to Car0Lead
CarPos0=CarPos0+1
Next lead
Car0Lead=1


REM Car1 Lead Calculation
For lead= 1 to Car1Lead
CarPos1=CarPos1+1
Next lead
Car1Lead=1


REM Car3 Lead Calculation
For lead= 1 to Car2Lead
CarPos2=CarPos2+1
Next lead
Car2Lead=1


REM Car4 Lead Calculation
For lead= 1 to Car3Lead
CarPos3=CarPos3+1
Next lead
Car3Lead=1

REM Car5 Lead Calculation
For lead= 1 to Car4Lead
CarPos4=CarPos4+1
Next lead
Car4Lead=1


REM Car6 Lead Calculation
For lead= 1 to Car5Lead
CarPos5=CarPos5+1
Next lead
Car5Lead=1


REM Car7 Lead Calculation
For lead= 1 to Car6Lead
CarPos6=CarPos6+1
Next lead
Car6Lead=1


REM Car8 Lead Calculation
For lead= 1 to Car7Lead
CarPos7=CarPos7+1
Next lead
Car7Lead=1

REM Car9 Lead Calculation
For lead= 1 to Car8Lead
CarPos8=CarPos8+1
Next lead
Car8Lead=1


REM Car10 Lead Calculation
For lead= 1 to Car9Lead
CarPos9=CarPos9+1
Next lead
Car9Lead=1


REM Car11 Lead Calculation
For lead= 1 to Car10Lead
CarPos10=CarPos10+1
Next lead
Car10Lead=1


REM Car12 Lead Calculation
For lead= 1 to Car11Lead
CarPos11=CarPos11+1
Next lead
Car11Lead=1

REM Car13 Lead Calculation
For lead= 1 to Car12Lead
CarPos12=CarPos12+1
Next lead
Car12Lead=1


REM Car14 Lead Calculation
For lead= 1 to Car13Lead
CarPos13=CarPos13+1
Next lead
Car13Lead=1


REM Car15 Lead Calculation
For lead= 1 to Car14Lead
CarPos14=CarPos14+1
Next lead
Car14Lead=1


REM Car16 Lead Calculation
For lead= 1 to Car15Lead
CarPos15=CarPos15+1
Next lead
Car15Lead=1

REM Car17 Lead Calculation
For lead= 1 to Car16Lead
CarPos16=CarPos16+1
Next lead
Car16Lead=1


REM Car18 Lead Calculation
For lead= 1 to Car17Lead
CarPos17=CarPos17+1
Next lead
Car17Lead=1


REM Car19 Lead Calculation
For lead= 1 to Car18Lead
CarPos18=CarPos18+1
Next lead
Car18Lead=1


REM Car20 Lead Calculation
For lead= 1 to Car19Lead
CarPos19=CarPos19+1
Next lead
Car19Lead=1

remstart

Delete Sprite 1
Delete Sprite 2
Delete Sprite 3
Delete Sprite 4
Delete Sprite 5
Delete Sprite 6
Delete Sprite 7
Delete Sprite 8
Delete Sprite 9
Delete Sprite 10
Delete Sprite 11
Delete Sprite 12
Delete Sprite 13
Delete Sprite 14
Delete Sprite 15
Delete Sprite 1
Delete Sprite 17
Delete Sprite 18
Delete Sprite 19
Delete Sprite 20
remend

Next m

Return
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd May 2008 02:49 Edited at: 3rd May 2008 03:34
1. Use the Code button when posting code!

2. Learn how to use arrays with For..Next loops to reduce excessive variable declaration lines!



Could be written as:



(The same goes for your most of your other large line variable blocks). For example, your whole 478 line snippet above could be written in 91 lines:



I've highlighted the line I think might be a problem...

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 5th May 2008 05:01
6000 lines halted by a missing BOB...
Read my sig :p

it is almost certain that you've called for some data from a bob that doesn't exist yet.
I'm pretty sure BOB is still a command, but yes it's the same as a SPRITE.

It is far better to complete a 10 line program than to start a 10,000 line program.
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 5th May 2008 18:34
TDK and all, thanks for your help, learned a lot here thx

Login to post a reply

Server time is: 2026-07-06 00:09:50
Your offset time is: 2026-07-06 00:09:50