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 Professional Discussion / make static object ....,.

Author
Message
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 12th Nov 2011 08:42 Edited at: 26th Jun 2012 07:32
why not working?


translated translator yandex or google
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 12th Nov 2011 12:04
Replace:


With:


Then it runs atleast.
The variable 'o' wasn't declared/initialized anywhere, which means o = 0(null). And 0 is not a valid object number.

29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 12th Nov 2011 12:21 Edited at: 12th Nov 2011 12:23
Hi, pavelsv2000dlp.

When I ran your code I got the error: Runtime Error 7006 - Object number illegal at line 17

This is because the object number of the box you created was zero. This is not allowed.

In your code the variable "o" (used of the object number of the box) is zero as you have not given it a value. If you give it a value then the object will be created.

The next problem I found was that the size of the box is to big appear on the screen (I'm not sure why this is). I changed the size to 5000,10,5000 and the box can be seen.
edit I just saw enderleit's post and he did not report this problem so it might just be my version of DBP

One other point, you do not need the SYNC command at line 91. It is unecessary and causes the pint commands at line 95 to flicker.

I have modified your code and it works. I have added a line in the give the variable "o" a value of 1 (line 14). I have resized the box (line 18). I have removed the first SYNC command.





I hope this is of help to you.
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 12th Nov 2011 12:33
I just fixed the runtime error.

29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 12th Nov 2011 13:15
In which case the size of the box may be a problem. I did think that 10000 units was too big.

The camera range would have a default setting of 3000 units and I wonder if the this would have clipped the entire object.

If you remove the MAKE STATIC OBJECT command then you can see the box when it is 10000 units big so I'm guessing that the entire static object is removed if it any part of it goes beyond the camera's range.
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 12th Nov 2011 14:42 Edited at: 12th Nov 2011 16:06

don't save!!!
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 12th Nov 2011 17:56
Is that from some tutorial that you are trying to use?

Anyways, right under the comments:


So then 'o' would be initialized to 1.

greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 12th Nov 2011 22:45


This Work!
29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 12th Nov 2011 22:59
I'm glad your code works.

Login to post a reply

Server time is: 2026-07-09 22:02:11
Your offset time is: 2026-07-09 22:02:11