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 / Matrix Height and collision detect problems.

Author
Message
Yodaman Jer
User Banned
Posted: 26th Oct 2007 17:56
Sorry for my new posts, but I can't find any help on this particular problem that I have.

First, the Matrix height won't work for some reason. And I copied it directly from the help file in DBC.

Like this:


When I try to run it, it flashes this error message:

ARAMETER MISMATCH. SET MATRIX HEIGHT EXPECTS INTEGER, INTEGER, INTEGER, REAL.

The second problem I'm having is with collision detection, but I'll post about that one later, because I think I know what's wrong.
Thanks to anyone who can help me!
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 26th Oct 2007 18:00
SET MATRIX HEIGHT 1, x=0,z=0,x=0,z=1,x=1,z=0,x=1,z=0,x=1,z=1, 100

should be

SET MATRIX HEIGHT [matrix number],[matrix x tile number],[matrix z tile number],[height at this point]

http://jamesmason01.googlepages.com/index.htm
Yodaman Jer
User Banned
Posted: 26th Oct 2007 19:06
Thanks!

Can't figure out my collision detect problem though.
Here's the code.



I also want it to collide with the matrix, obviously I need to if I want to set the Matrix Height to a certain point in the middle.
Can someone please help me with this problem?
Thanks in advance!
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 26th Oct 2007 19:14
To have collision with the matrix, first you need to get the object position x,y and z values (you can do this, judging by your code)

then use the Get Ground Height command to get the ground height at those x and z co-ordinates. Then, run a check to see if the object y position is less than or equal to this height.


This is just the method to do it, but if you want more help with the actual code I can do it, I just don't generally do much actual programming, especially not in 3D, but I'm pretty sure this is how it should work.

http://jamesmason01.googlepages.com/index.htm
Yodaman Jer
User Banned
Posted: 26th Oct 2007 19:19
Can you please type up an example of what you mean? That would be great! Thanks!
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 26th Oct 2007 19:33
Right well... this should work:


Not exactly sure about the syntax of a couple of those commands but I think that's it...

http://jamesmason01.googlepages.com/index.htm
Yodaman Jer
User Banned
Posted: 26th Oct 2007 19:37 Edited at: 26th Oct 2007 19:37
Thanks!! I'll get this tested later..got some things to do. You are my hero of the day!
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 26th Oct 2007 20:22
WOOO! I might not have failed at something!

Also thanks for pumping a much needed post into an otherwise dying forum :s what's up with people on here at the moment?

http://jamesmason01.googlepages.com/index.htm
Yodaman Jer
User Banned
Posted: 26th Oct 2007 21:56
It didn't work..it froze the whole program, and almost made me re-boot. Everything's fine now, though.
Sorry to say that your code didn't work...but should it have slowed my pc down like that? 'Course, It's needing re-booted anyway, but still. Ah well. Thanks for your help.
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 26th Oct 2007 22:25
It should have ended the programme if you hit the floor.

It shouldn't have crashed your computer. Unless I did something very wrong. Replace the end with whatever you want it to do at the end and maybe that'll work. If you're using the original compiler, press F4 to check that I've got all the parameters right and everything.

http://jamesmason01.googlepages.com/index.htm
Yodaman Jer
User Banned
Posted: 26th Oct 2007 22:49
Oh....yeah, I think it might be because I had END twice in the code.
Anyway, I don't think I can use that line you gave me earlier, because it doesn't match something else that I need. I was looking in a tutorial and saw an easier way to do it and where exactly to put it. Thanks for your help!!

Login to post a reply

Server time is: 2025-05-31 21:11:57
Your offset time is: 2025-05-31 21:11:57