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 Discussion / Please help me, before I kill myself!

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 26th Nov 2004 11:20
I am having an extremely agrivating time creating this collision heavy game of mine, Level 1 was working fine, untill I added collision to level 2, now level 2 works fine, but level 1 is broken! You see, in both levels, the white objects are supposed to move the red object left or right when collision is detected, but once I got this feature working on level 2, I returned to level 1 to find it pretty much broken. And I have no idea why! Can anybody help me with this, because I think I will go insane!

Here is the entire code...



I know it is un-organized, but I can understand it, and I am afraid that If I make any drastic changes in layout, I will confuse myself, so I am sticking with this. This game is going to suck, but I will not give up! Please help!

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 27th Nov 2004 11:01
I am not sure why nobody has attempted to answer my question, maybe nobody likes me or something , but please! After the problems that have recently popped up, I am seriously thinking about giving up on this project, because I just cannot get this problem solved. So please, just look the code over, and try to figure this problem out!

I have encountered yet another collision problem on level 1, not all of wave1 die when contacting certain objects. THIS IS KILLING ME! AH!

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 27th Nov 2004 20:10 Edited at: 27th Nov 2004 20:14
I went down trying to change some variables to know what the hell is what.. your OBJET numbers are all over the place.

What is this about?

`Collision for the first wave of enemies
for e=6 to 15
k = object collision(e, 0)
if k > 0 and k < 20
if k <> selection(0)
hide object e
endif
endif
next e


Like K can be anything else other than 1 or 0
I also found something like this.

if object collision(e,0) = 202

well you will never get 202 returned.

If object collision(2,202)=1

I havn't not done any 3d collision.. so I don't know if you need thing like
SET OBJECT COLLISION ON
and
SET OBJECT COLLISION TO BOXES

with it.. just use the BOXES command.

Make it small, make it simpler.. get rid of a level and find a better way of sorting your OBJECT NUMBERS. Don't give rubbish variable names for the FOR loops either.. I can't tell what k or t

anyway.. I got down to here to show you what I mean..


Yes there will be coding problems.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 28th Nov 2004 00:02 Edited at: 28th Nov 2004 00:06
`Collision for the first wave of enemies
for e=6 to 15
k = object collision(e, 0)
if k > 0 and k < 20
if k <> selection(0)
hide object e
endif
endif
next e

the whole K>0 and K<20 part is there because, it is checking for collision between objects 1 to 19.

I'm trying to do two things with the red objects, I am trying to hide them when they contact a blue, green, and grey object, and I am trying to move them left or right if they contact a white object. If I used the code you gave me, the white objects no longer move the red object left or right. But thanks anyway!

Any other suggestians?

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 28th Nov 2004 20:28 Edited at: 28th Nov 2004 21:29
some of your red cubes do move around the white barriers. Some go straight through it. They do move round very quickley aswell in my opinion. It is working but some of your collions are not being recorded or checked.. maybe the for loops are missing them out as they pass through the collision detection?

strip your code of the machine guns and blue boxes like I did. Have the land mines in and also the white barriers. I did notice that as the red cubes start to move.. some of them get hidden without touching anything.. I would look into this phenomenon.

plaster your screen with text outputs and figure out what is happening. good luck.

Yes there will be coding problems.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 29th Nov 2004 02:09 Edited at: 29th Nov 2004 02:42
Ok this is really wierd, After looking over the code I have made several descoveries. Number 1, is that only one of level1's barriers is detecting collision, the second descovery, is that every object in level 2 moves the red object left and right, even though they are not supposed to! Here is the code as of now....



Now here is the really wierd part, notice the object variables set up there....

For e = 321 To 360
For b = 300 To 302
If Object Collision(e,i)
`Do whatever to do when white hit's red here
if mover(e) = 0
if rnd(10) > 5
mover(e) = 5
else
mover(e) = -5
endif
endif
position object e, object position x(e)+mover(e), object position y(e), object position z(e)
else
mover(e) = 0
endif
Next b
Next e

Now notice how I didn't change them when checking collision, the code is checking collision between e and i, even though I never set up a object to be i, yet the collision works , but works a little to much, in fact every object in the level now moves the red objects around, even though only the white objects should . Now it gets even stranger, when I change the (e,i) to (e,b) to check collision the right way, the collision no longer works, and it becomes the same exact problem that level 1 has. Weird! I am thinking that this is happening... instead of checking collision between e and b, it is checking collision between e and everything, that would eplain why everything moves the red object around. But what really gets me, is why when I correct the variables, the collision stops working? Any suggestians?

UPDATE: Ok I might have jumped the gun before, becuase it seems that after the timer reaches 0 or below, the collision for level 2 begins to work correctly, so that is fixed, however the problems from level 1 persist.

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 30th Nov 2004 05:57
Any collision experts care to share some knowledge here?

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 1st Dec 2004 11:30
I really hate to keep bumping this, but man do I want to finish this game so bad, and it hurts to see such unaswered prolems, cripple the development, of what would have been my first game! Please help, all the info is above.

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 1st Dec 2004 21:28
poor sod. its so anoyying when no1...replies...id help if knew how
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 2nd Dec 2004 02:23 Edited at: 2nd Dec 2004 03:06
right. [edit] it still doesn't work. IT seems to think it's hitting certain objects it isn't hitting (possible the hidden red cubes touching the blues later on) and the red can wiggle left and right rapidly moving through the white block. Plus they can always go straight through it anyway. Maybe it's because the mover value has something to do with it (like the mover(e) value stays at 5 or -5 so it never goes back into the position object script). I dunno.. I tried to fiddle with the mover(e) but when I did it cut the FPS dramatically... weird.



Now I know what the objects are numbered.

Your one p= object collision was checking 0 to 20.. which meant if red hit themselves they would dissapear, and seeming you only check once if they are over alpping at the beginning, they could well be.

Also when you bring up the RND command.. you don't record it in a varible. So it makes up a number and does something funny. I'm not sure why it hasn't come up with an error.

Nice selection code by the way. I don't know how it works.

Yes there will be coding problems.
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 2nd Dec 2004 04:10
I found this under my sofa



Yes there will be coding problems.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 2nd Dec 2004 06:09
I will probably just try a workaround, because if I change the collision for the white barriers and red objects on the first level to (e,0) it works, but also moves the reds when hitting every object, however, because the machine gun target is told directly to kill the red objects, it will still kill them, so if I make it so the objects are told exactly what to do, maybe I can just leave it at (e,0) and just use the same trick as with the machine gun nest to everything els. Unfortunatly when trying to check collision between object 1 through five, it brings back an error, when using the following code...

for t=1 to 5
for e= 6 to 15
if object collision (t,e)>0
hide object e
endif
next t
next e

That code, gives an unrecongnized paremeter for the object collision part.

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 4th Dec 2004 07:42
Oh my god, I just realized I am an idiot, you see, I never needed to check collision between the red objects and the white objects to move them, all I had to do was to say that the red objects should move if they touch any object, and then just leave everything els the same, sense all the other collision tries to hide the red objects it continues to hide them, the fact is, that it was working all along, but I jumped to conclusions to early, and did not wait to see what the objects did apon the timer running out, this is when collision for the killer objects is activated, and thus this is what I should have been looking at, yet I let it slip passed me, and the problems rolled in. However, I am once again back on track, and development should increase in pace with this new descovery!

Guns arnt the problem, people are the problem, shoot all the people and guns arnt a problem anymore.
computer
20
Years of Service
User Offline
Joined: 5th Oct 2004
Location:
Posted: 5th Dec 2004 03:47
What about the blue cubes? they should hide the red object. The white blocks move the red objects sideways. I guess you are checking which object they hit then IF'ing if it is blue OR white.

Yes there will be coding problems.

Login to post a reply

Server time is: 2025-05-24 22:18:40
Your offset time is: 2025-05-24 22:18:40