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.

Newcomers DBPro Corner / "Object does not exist" error help..

Author
Message
gormee
13
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 10th Oct 2010 19:11 Edited at: 10th Oct 2010 21:53
Hi all,

I am extremely new to DBPro and I've been getting this error whenever I try to run my code "Runtime Error 7008 - Object does not exist at line 66. Object Number Not Found: 50."

I have included my code and line 66 is referring to this line:
If object collision(player,50)>0

I cant quite see what I'm doing wrong here.. Can someone please point out what I'm doing wrong? Any help would be greatly appreciated

this is my code so far, written by looking at some of the work posted here
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Oct 2010 21:54
Where in your code do you create object 50? If it doesn't exist, then you can't check for collision against it.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
gormee
13
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 11th Oct 2010 05:00
ahh.. silly me i left it out feel so silly

I am also trying to write some code to create random platforms that my player has to jump to..

Anyone know the best implementation for this? The player has to be able to reach the platform so there has to be a limit of sorts on the spawning points of the platforms.

would something like this work?


Should I also create an array to hold all the random platforms? or should I just let DB continuously generate them without worrying?

Thanks in advance!
WRIOR
13
Years of Service
User Offline
Joined: 11th Oct 2010
Location: Ireland
Posted: 12th Oct 2010 17:38
I Wouldn't Continuously generate them as you would run out of memory quite quick.Try Something Like:

Or if You know the positions of where you want your platforms try this



EACH of those would create 10 cubes the first one at random locations, and the second one would read the co-ordinates from the DATA statements hope this is of some help
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 13th Oct 2010 07:51
At first this looks pretty simple but it can become more and more complicated when you actually try to implement.I suggest you to decide if the player should run or climb.You need to make various checks depending of the type of game you choose to make.If it's climb game you need to be sure that the player can jump from any platform to next, so knowing the dimensions of the platform at every new randomization you need to check distance with previous platform to be sure the player can reach the new one.If it's to far you can delete the last platform and make new randomization until you are sure it can be reached or with reajusting the position and then go to next platform creation.If you are lazy to reposition or delete platforms you can just add some booster when the distance check shows that player can't reach at position of last one.I suggest you to make one test level with predefined platforms and run few test with the character jumping or runing so you know what metrics to feed in distance check function and what amplitude to give to functions for placing.You must know what distance the player can jump to, or travel to in mid-air from one platform to other putting in account the gravitational forces that could pull him down.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!

Login to post a reply

Server time is: 2024-09-28 22:28:04
Your offset time is: 2024-09-28 22:28:04