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 / Program will not stay open

Author
Message
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Jul 2004 06:30
y does my program clode strait-away?



SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 9th Jul 2004 06:34
Okay, that's an easy mistake...

Move the Function code to the END of the program. Many folks make the mistake of putting functions too high in their listing.


S.

Any truly great code should be indisguishable from magic.
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Jul 2004 06:46
I know says object aready exists at line 28



CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2004 07:09 Edited at: 9th Jul 2004 07:09
if your do loop executes more than once, that will happen because you have Make Object Cube Z,16 in there. Z is based on a for-next loop which will repeat its numbers every time the code executes it


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Jul 2004 07:21
sorry but it still say object already exists. i've deleted the loop



CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2004 07:51
aha, your cubes and your planes are stepping on each other

both loops that create them both use the same numbers starting at 1


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 9th Jul 2004 10:09
Yeah, given the code you're using, and the fact that both loops step through the Z value Mapsize number of times, you're going to need a more complex formula to define object numbers. Something like X+Mapsize*Z for the first loop, and X+Mapsize*z*2 for the second. (I think my math is right there, but don't count on it!)

Remember, these are just the object numbers...
S.

Any truly great code should be indisguishable from magic.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2004 10:12
or better yet, make a GetFreeObj() function that returns the next free object number...now theres a little challenge for ya


* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 9th Jul 2004 10:16
hehehe. Yeah, I thought about that... but I'm assuming he'd try to reference the objects by map location numbers, so a computed form might be better. (Depends on what you're doing--like anything else.)
S.

Any truly great code should be indisguishable from magic.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Jul 2004 10:39
true Sandra

in case he wants a function, theres one in here:



* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 10th Jul 2004 02:07
I've tried most thing that i can think of with my noob kwnoledge it still say object already exists



SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 10th Jul 2004 04:58
Okay, let's do it the EASY way then....

TRY This code instead;



S.

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2024-09-22 16:28:32
Your offset time is: 2024-09-22 16:28:32