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 / Need Help on Making a matrix and object at the same time

Author
Message
Swapfox98
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location:
Posted: 6th Aug 2004 22:58

I've make one matrix and one object but the second object keeps comming up as "runtime error70077:object already exists at line 32".
Please read my code and tell me what i need to fix.
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 6th Aug 2004 23:39
Your problem is in your for/next loops. You keep creating the same object 200 times. Every object must have a separate object number.


Instead, your loop should go like this:


So instead of creating object number 2 200 times, change your loop to go from 2 to 200 (we are starting with object number 2 because you already used up object number 1) and create an object number with each of those numbers. Like this:


Now to make your next set of 200 spheres, we will need to do a loop that starts at 201 and goes to 400:


And now for your next 200 spheres, we will start with object number 401 and go to 600...


That should work for getting your objects properly created.

Swapfox98
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location:
Posted: 7th Aug 2004 00:25

Thanks,it worked.
Swapfox98
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location:
Posted: 7th Aug 2004 00:47
Function not working
I go over the object but my ammo won't increase.
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 8th Aug 2004 04:42 Edited at: 8th Aug 2004 04:43
Your problem is that the variable "ammo" isn't a global variable. So every time you call the function, "ammo" is set to 0, you add 1 to it, and you're ammo stays at 1.

You need a global variable to keep track of your ammo. I assume you're using DBC. In DBC, you have to use arrays for global variables. So, near the first of your code, type


Now, just go through your code and wherever it says "ammo" change it to "ammo(0)".



Hope this works.

Swapfox98
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location:
Posted: 9th Aug 2004 00:19
It worked but now my bullets won't apear.

Login to post a reply

Server time is: 2024-11-27 04:44:11
Your offset time is: 2024-11-27 04:44:11