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 / irritated by collision

Author
Message
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 14th Oct 2006 08:41
i made a object tht i move around with arrow keys called object 2

i made 300 random objects called "b"
i put global collision detecton on

then i put

If 1=object hit/collision (tried both) (2,b)
move object -200
endif

it gives me an error that states that object does not exist in the "if objectt hit (2,b)line.

te Only problem is IT DOES EXIST! i dont understand why tis is happening.

anyone have any idea?

dont hate people who rip you off,cheat and get away with it, learn from them
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 14th Oct 2006 14:29
OH. Apparently you are not understanding the FOR-NEXT command. The FOR-NEXT command will cycle one variable through a set of numbers. So, by saying

FOR b = 1 to 300
make object cube b,10
NEXT B

you are creating 300 objects with the object numbers 1,2,3,4,5,6,7,8,9,10,11,12,13,14 etc. all the way to 300. Another example:

FOR b = 1 to 10
circle 100,100,b
next b

What that would do is that first it would make a circle with a radius of 1 (because b=1). Then, when it hits the NEXT b it goes back to the FOR b = 1 to 10 thing, this time making b equal to 2. So, when we make the radius of the circle b (which is now 2) it makes a circle with a radius of 2 this time. Then, it goes back and makes it 3, then 4,5,6,7,8,9 and finally 10. After 10 it moves on past the NEXT b thing. Why 10? because that is what we said in the "FOR b = 1 to 10" thing. We said b should cycle through all of the numbers from 1 to 10.


FOR-NEXT is not a grouping command. All it does is cycle a variable (in this case b) through a defined set of numbers (in this case the numbers 1 to 300)

Hopefully that'll solve the problem

Ummm...
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 14th Oct 2006 18:14
i used the for-next sucsessfully to create random objects and i also used it to sucsessfully texture them. i also used the same to activate collision detection. but its just so... messed up

I know DBC ad some good collisio examples but i dont have DBC where can i get these examples?

dont hate people who rip you off,cheat and get away with it, learn from them
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Oct 2006 20:13 Edited at: 14th Oct 2006 20:14
have you checked what 'b' is when it stops, its possiblely 301 or 0

Dark Physics makes any hot drink go cold.
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 14th Oct 2006 20:41
b is supposed to be a number between 3, and 300

dont hate people who rip you off,cheat and get away with it, learn from them
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Oct 2006 20:47
Post some code. That'll remove all doubt as to what is going wrong.

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Oct 2006 20:48
well get your code to show what 'b' is before get to the bit of code that stops.

something like



Dark Physics makes any hot drink go cold.
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 14th Oct 2006 21:44
wait!,so you have to do the collision in the main loop is that it?

dont hate people who rip you off,cheat and get away with it, learn from them
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 15th Oct 2006 08:01
I FIGURED IT OUT!

you have o stae what happens when objects collide in an for nex loop inside the main( do loop)loop

my mistake was that i didnt put into afor-next loop in the first place

dont hate people who rip you off,cheat and get away with it, learn from them

Login to post a reply

Server time is: 2024-11-12 14:15:19
Your offset time is: 2024-11-12 14:15:19