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 / Object doesn't exist...wait yes it does?

Author
Message
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 4th Sep 2004 06:46
I'm making a tiny game(finally) but I'm having a bit of trouble with my code.

At the position object... it says that the object doesn't exist, but i told it to make a cube 1,10(as you can see)

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 4th Sep 2004 06:59
cubey#=get ground height(1,cubex#,cubez#)
position object 1,cubex#,cubey#,cubez#

the format for object position y is:

objectheight#= object position y(object number)

the 1 in get ground height is the matrix number, not your object
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 4th Sep 2004 07:12 Edited at: 4th Sep 2004 11:23
Ok that works, now, I want some type of system to keep the cube on the matrix, so it goes up when the matrix goes up etc. And some type of gravity so when it goes up, it should come down, but slowly, not abrubtly.

Edit: What I ment by the cube going up, was like the cube jumping.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Ocean Runner
21
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 4th Sep 2004 07:15 Edited at: 4th Sep 2004 07:16
Your problem is that you don't need object position y in the y value check in position object.

If you get rid of that, then it should wark fine. (so that you just have get ground height)

The reason this is is because is because you are having it get the y position of object [insert height of matrix here]!

EDIT: Dang, late. Well, for your other problem, have you checked out the binary moon tutorials? They have a great section on doing just what you want with the cube.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 4th Sep 2004 07:18
I'll check and report back if it worked. Thankyou.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 4th Sep 2004 07:36

That's the new code. It includes a gravity function, but when I try to run the program it says the matrix exceeds the limits. Now I know for a fact it does NOT esxceed the limits and, before i put the function in that aspect was fine. Any advice?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 4th Sep 2004 11:23
I've been changing the function to no avail. It still has a problem with the matrix size no matter how big it is. Any help?

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: 4th Sep 2004 14:36 Edited at: 4th Sep 2004 14:57
Just a quick glance but try this.

Always put your functions at the very bottom of your program outside of loops and call them from the loop.

[edit] Just wondering if you have DBP or DBC? This compiles fine in DBP.

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 5th Sep 2004 02:06
I'm using DBP, and that code you posted runs, but then windows brings up an annoying error saying it had to close.

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: 5th Sep 2004 04:27
Wierd it runs fine here. What version of DBP do you have? I am using 5.6 beta2

Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 5th Sep 2004 09:53
You want the object to travel along the matrix right? Well then try this code:



You need to get the height of the matrix every loop, otherwise it won't know how high it is at the cube's new position. You should also always position the object after finding the new coordinates, otherwise it'll lag the game a tiny bit and everytime the user presses a key, it won't update until the next loop. Also, I'm not sure why you need a gravity function because the 'Get Ground Height' command will pull the object back down as well.

However, the reason your function wasn't working would be because you're never calling it in your program. The function must be at the bottom of the code and you must call it somwhere in the loop by typing "gravity(-10)" - It basically works just like a command.


"Computers are useless they can only give you answers."
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 5th Sep 2004 12:22
Still no good. I just get a windows error asking me if i want to file an error report. My comp specs aren't that great. XP Home Pentium 3 498 MHz 128 Ram and some type of video and sound card that are old. My parents are bargain people and like to use stuff to maximum overuseage. We only have 12 Gigs on this thing, not that great.

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: 5th Sep 2004 12:30
I wonder if your graphics card can handle it. Have you tried making the matrix like 100,100,10,10 to see if it helps?

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 5th Sep 2004 12:41
I set it to 100,100,10,10 and still it shut itself down. Arg I really need a new comp.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 5th Sep 2004 14:48 Edited at: 5th Sep 2004 14:48
Let's make sure it's the matrix that is doing it lol. Can you run this?



If anything, it'll probably be the graphics card.


"Computers are useless they can only give you answers."
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 6th Sep 2004 08:39
Actually I think I figured out the problem. I was logged onto multiple accounts with several programs open and it couldn't get enough memory to make it run. Cause now it works fine.


Next question... So far my idea for the game is you(cube) go around shooting at spheres(remake). So now how do I make spheres appear in random places around the board?

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: 6th Sep 2004 10:24
Here is an example.


Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 6th Sep 2004 12:55
Hmm, not quite working right.

Check that code. It says that the sphere already exists, but i dunno. What should I do?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 6th Sep 2004 13:34
Oh and a seperate question. I want to have it so if the cube touches a sphere it makes particles like the sphere is welding itself to the cube. Then I want the sphere to stick to the cube. I'm guessing for that second part (sphere--->cube) would be use append object blah blah. But I've never used particles so I have no idea where to begin there.

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: 6th Sep 2004 14:27 Edited at: 6th Sep 2004 14:33

change this to this as you have already made cube 1 so you will have to start the sphere number as 2


And for your second set of questions.
I haven't used DBP's built in collision commands that much so unless you want to use Nuclear Glory Collision I won't be much help here. I gave up on DBP's collision long ago. Though it may be better now. As far as the particles when you find out the location of the collision you can pretty much just copy paste the particle code from the particle example in DBP and use that location of collision to give you a start. There are several particle examples in the codebase as well. You can attach the 2 objects using the DBP limb commands or 3d math commands. I think limbs would be easier. But, I really don't know exactly what you are planning.

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 6th Sep 2004 21:10
I can see that it's a bit vague. I'm trying to do a little sortof snake game in 3d using a matrix etc. But, there's a twist and the spheres can stick to the cube at various angles corners etc.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?

Login to post a reply

Server time is: 2024-09-22 23:39:00
Your offset time is: 2024-09-22 23:39:00