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 / Making an array to handle object types

Author
Message
spiderlance
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location: Perth, Australia
Posted: 9th Jan 2009 09:56 Edited at: 9th Jan 2009 13:41
I'm having some trouble making this work, basically I need to create different types of objects for my game (floor, walls, interactives, etc). I'm trying to organise them using an array, but I'm having some trouble, heres the code.


The game compiles but straight away I get runtime error 7006: object number illegal

Thanks in advance to anybody who can help me

Statistics show that loss of life is the leading cause of death in America.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jan 2009 13:26
You have called your array floor, but then used ground in the code later.

spiderlance
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location: Perth, Australia
Posted: 9th Jan 2009 13:40
lol just a typo. it does it even if the names are the same.

none of the tutorials I've looked at have told me how to do this.

Statistics show that loss of life is the leading cause of death in America.
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 9th Jan 2009 14:04


This will produce that error because the value assigned to the floor part of your type is zero, and you cant have an object zero. So to fix it you simply need to initialize the floor(n).floor number to a number greater than zero.

Login to post a reply

Server time is: 2024-11-25 12:48:17
Your offset time is: 2024-11-25 12:48:17