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.

Author
Message
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 15th Sep 2004 08:49
Well, I have a huge part of my simple program completed, as in Game Numero Uno. But, now there's a problem, collision. I've got Nuclear Glory and all the good stuff, and it loads and all that good stuff. But I'm not exactly sure how to say "If object collision=1 then glue object to limb 1,0,i" It always comes up saying that "Object at line 64 (where that collision thing is) doesn't exist" But it does. Before I start the loop I have the "for object..... etc." Take a look. Advice would be nice.



Note*: I do have the NG code I just didn't put it in for all those stalkers looking for a ripped deal.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 15th Sep 2004 09:59
Replace:

With:


Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 15th Sep 2004 10:26 Edited at: 15th Sep 2004 10:30
Oh great, now I feel really stupid, thanks for the help, I'll check'er out.

Edit: It didn't work the cube ran into the sphere and stoped for a second then the cube was suddenly in front of the sphere...So no luck yet.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Sep 2004 10:37
Just a question why do you have NGC and not using it at all? Might want to use something like this. Though you will have to reposition the limbs so they are behind the cube.


Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 15th Sep 2004 10:55 Edited at: 15th Sep 2004 11:03
Well I'm not sure how to use it that's why. I don't exactly understand the commands in the help file or how to use them. But thanks for the code I'll try it.

Edit: Code works, but doesn't do what I want to do. When the cube hits a sphere I want the sphere to stick to the cube, or if its easier, just to be like snake and go behind the cube and follow it around.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Dot Merix
20
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 15th Sep 2004 11:01
I just bought the nuclear glory commands the other day myself Rennekon.. so it's all pretty new to me aswell.. I found out after printing the 14 pages worth of the 3d shooter code, and looking over it slowly, i've really come to understand a lot more on how to use it

And in general, a lot more about how much better my programming structure can be. I suggest doing so aswell.

- Merix
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Sep 2004 11:12
Cool. I'll update the code with some comments if you like. Basically you need to Use the startcollisionspro command, declare the constants for your types (which you make up like Type_Box or Type_Sphere) along with the constants from the example,load your objects, set your collisions with setcollisionspro, set your ellipsizemodepro, set collision types to your object with collisiontypepro, and then (if you want to use an ellip for testing and the object you will be moving like te player needs to be ellip) you set its ellip size for testing with SetObjRadiusPRO. Then you call RunCollisionPRO() once per loop just before your sync command. This will let the collision run. You can then use the other commands to find out what object hit wat and where using the examples in the help file. Make sure your ngcdll is in the same folder as your exe and make sure to include the ngcdba file in your project.

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 15th Sep 2004 19:40
I would greatly appreciate the comments .

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 16th Sep 2004 05:29
Glad it helped Merix

Also, it's important to note that the NGC has a "sticky" response mode where the object will stop moving when it collides with the target. So... it's not something you have to custom program. Just setup the NGC code properly and you're all set with sticky collision.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 16th Sep 2004 05:51
Thanks for the comments. Nuclear Glory, could you explain this "sticky" response code. I looked at the FPS thing and understood the entire thing. Great documentation on it. But I'm not exactly sure what the different types of collision are, (ellipsoid,poly) Could those be explained?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Sep 2004 06:04 Edited at: 16th Sep 2004 06:11
Here are some comments. Hope it helps.


[edit] Ellip collision is where a ellipsoid is created for the actual collision for the object. Its size is determined by setobjradiuspro().

Poly collision is where you test the actual polygons of the model to see if they are hitting the ellip.

Also NGC will only test from an ellip to an ellip or from an ellip to poly in the v2.** series. One of your objects has to be an ellip. Ellip collision is faster than poly so you could set both of them to ellip but with such small objects I don't think it will matter much. You only get a boost from checking very complex objects as ellips.

Also the ellip will not rotate with the player in this series of NGC either. Hopefully alot of this will change with the v3.** series.

[edit2] Sticky response is like DBP's built in collision I believe. Meaning the 2 objects will not slide against one another but will stop dead in their tracks when they collide. I think this is correct. I have never had to use sticky collision.

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 16th Sep 2004 06:32
But what exactly is an Elipsoid? (thanks for the comments on the code)

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Sep 2004 06:41 Edited at: 16th Sep 2004 06:43
An ellipsoid is like a sphere but it can be sort of cigar shapped. If its sizes are all equal like setobjradiuspro 10,10,10 it is the shape of a 10 unit diameter sphere in DBP. The sizes go x,y,z so for a taller ellipsoid like a player standing you could do something like setobjradiuspro 10,24,10 makeing the spherical type ellip 10 wide, 24 tall, 10 deep.

[edit] Imagine a box with the corners rounced off so it is rounded with no sharpe edges. Sort of.

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 16th Sep 2004 06:46
So an ellipsoid is like a 3 Ellipse. Interesting (should of guessed that).


So back to the code,
Quote: "I have never had to use sticky collision.
"
Ok, but do you know how to use it. I didn't see anything about it in the manual for NG.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Sep 2004 07:16
Sticky is just the response, like SLIDE or NONE. It simply means when collision occurs, the objects stops dead in it's tracks.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 16th Sep 2004 07:49
So I'd program it to have no extrastensial response so it'd stop right?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Sep 2004 10:59 Edited at: 16th Sep 2004 11:03
I don't know what you would want to do with sticky collision but you just replace

with

No need for special programming your object will just stop moving when it hits an object with a collision type set to Sphere_Type.

[edit] Here is an example though you would want to recode your camera to stop moving when your object stops.


Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 16th Sep 2004 11:09
Hmm, no change in the collision as far as I could tell. The cube hits the sphere and the sphere moves somewhere above the cube randomly as far as I could tell.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Sep 2004 11:42
thats because you are adding it as a limb still. You can use any type of collision for that as that code deactivates the collision once it becomes a limb. did you run the code i just posted?

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 16th Sep 2004 12:18
Yes I ran the code you posted, and it gave me the results stated above.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Sep 2004 12:33
wierd it doesn't do that on my machine.

nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 16th Sep 2004 14:48
Try running the "old_demo.dbpro" example in the package. After running it, change line 91 to:



And you will now notice that the camera sticks when it hits a wall. This is sticky-response in action.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 17th Sep 2004 07:55
Ok, that works, the camera stops dead when it hits the walls, so would I use the same general code for mine?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 17th Sep 2004 07:56
This may be off topic but does anyone have a simple collsion code, because I need one to implment into my RPG.

Got anime?I do.
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 17th Sep 2004 08:00
Well, I'd suggest getting Nuclear Glory, its the best around and will solve a lot of problems.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 17th Sep 2004 08:26
I just mean a basic one, I've got the NG demo, but it don't work.

Got anime?I do.
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 17th Sep 2004 08:55
What do you mean by
Quote: "it don't work"


John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 17th Sep 2004 09:58
Exactly what I said. It doesn't work.

Got anime?I do.
Dot Merix
20
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 17th Sep 2004 10:00
You asked for simple collision code.. did you try the example files that came with NGC?

- Merix
nuclear glory
20
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 17th Sep 2004 16:47
Quote: "Ok, that works, the camera stops dead when it hits the walls, so would I use the same general code for mine?"


Yep, same general setup. It's a good example to pick apart to learn how it works. Then you can apply it to anything.

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 19th Sep 2004 11:34
Well I want the object to attach itself to the other object, is there some NG code for that?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 19th Sep 2004 12:44
I would attach it like you are doing. You just need to work out where you want to reposition it so they will all be in a line.

Login to post a reply

Server time is: 2024-09-23 00:18:43
Your offset time is: 2024-09-23 00:18:43