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 / My character falls through my matrix

Author
Message
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 21st Dec 2008 23:17
I have a problem with my character falling through my matrix. I need him to be able to move around the matrix and go up and down, left and right with it. Hint: I need it to be like real ground on Earth! you can actually walk on it! You dont fall through. My matrix already is the folowing! My characters # is 1

rem create a MATRIX
MAKE MATRIX 6,2000.0,2000.0,30,30
position matrix 6,-1005,2,-1005
rem Texture landscape
PREPARE MATRIX TEXTURE 6,99,1,1
rem Randomise landscape
RANDOMIZE MATRIX 6,35.0
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd Dec 2008 00:47 Edited at: 22nd Dec 2008 01:01
What kind of game is it E.G. 3rd person, First person?

So you alread have gravity set up?

Well pretty much how i did it was if the player wasn't jumping or above the ground position the player at PlayerX#,GroundY#,PlayerZ#.
To get the groundY# look up Get ground height in the Help Files. i don't remember the exact syntax cuz i'v been using sparky's dll for my collision so i can use .x maps

if he is jumping or above the groundY#(falling) Then position him at PlayerX#,PlayerY#,PlayerZ#
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Dec 2008 08:20
Hello!

Look at the command "get ground height". It will get the ground height at the current position of the player on the X and Z axis, and return the Y position.

TheComet

Peachy, and the Chaos of the Gems

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Dec 2008 16:12
Don't know why someone approved this when its the same as a thread you posted an hour before?
Please be patient.


Goke of the day: I coded an AI replica of Steve Irwin. It crashed because of a string array.
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 22nd Dec 2008 23:40
That still doesnt work. My character still falls through the floor when the game starts. The code for that section looks like this:

MAKE MATRIX 6,2000.0,2000.0,30,30
position matrix 6,-1005,2,-1005
rem Texture landscape
PREPARE MATRIX TEXTURE 6,99,1,1
rem Randomize landscape
RANDOMIZE MATRIX 6,35.0

rem Activate and distance fogging
FOG ON
FOG COLOR -5
FOG DISTANCE 5000

REM OBJECT CREATION

Rem Player Character
make object cylinder 1,50
scale object 1,100,140,100
texture object 1,1
PlayerX#=Object position X(1)
PlayerZ#=Object position Z(1)
PlayerY#=Get Ground Height(6,PlayerX#,PlayerZ#)
Position object 1,PlayerX#,PlayerY#,PlayerZ#

make object cylinder 99,50

make mesh from object 1,99
delete object 99

add limb 1,1,1
offset limb 1,1,0,25,0
scale limb 1,1,100,1,100
texture limb 1,1,99
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 29th Dec 2008 03:21
PlayerY#=Get Ground Height(6,PlayerX#,PlayerZ#)
try to change it to
PlayerY#=Get Ground Height(1,PlayerX#,PlayerZ#)

**StigDesign** cheap 3D Modell Pack`s at www.stigdesign.piczo.com (for Home&Comersial use)soon other aplication`s
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 29th Dec 2008 03:44
isn't that number for the number of the matrix?

yup just checked the help.

Quote: "SYNTAX
Return Value=GET GROUND HEIGHT(Matrix Number, X, Z)"


he numbered his matrix as number 6. i don't recall why but he explained it in one of his posts.
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 29th Dec 2008 04:00
oh sorry i thinked wrong sorry

**StigDesign** cheap 3D Modell Pack`s at www.stigdesign.piczo.com (for Home&Comersial use)soon other aplication`s
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Dec 2008 12:19 Edited at: 29th Dec 2008 12:23
Can you post the hole code? And this time use the Code snippit?


Thanks,

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 29th Dec 2008 19:16
haha ya code wouldbe usefull

Login to post a reply

Server time is: 2026-07-05 18:17:49
Your offset time is: 2026-07-05 18:17:49