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 / Pointing and moving objects

Author
Message
Yodaman Jer
User Banned
Posted: 13th Jan 2009 20:46
I'm having a bit of trouble figuring out how to point my elevator object so that it moves only along the y axis while staying perfectly oriented. What I mean is, I can point it so that it moves along the y axis, but it screws up the rest of the orientation if I leave like:

point object obj#,0,180,0

I've tried other variations to make it correct, but it simply doesn't work. Had anyone ever created a game using elevators and do you know how to get the object to point so that it stays oriented perfectly yet can move up and down?

Thanks in advance!

BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Jan 2009 20:49
Can't you just position the object above where it is?

Position object obj#,object position x(obj#),object position y(obj#)+1,object position z(obj#)

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Yodaman Jer
User Banned
Posted: 13th Jan 2009 20:57
No, that doesn't work. I need the object to be pointed so that it moves up and down, and not pointing it causes it to move to the left, along the x axis. I need the code to be like this:



It's the point object command that's messing with me. I can't point it so that the object keeps its correct orientation while still being able to move up-and-down the y axis.

Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Jan 2009 21:58 Edited at: 13th Jan 2009 22:04
you don't need to point the object or use move object lol. all you need to do is use variables and set the x and z variables to the objects position inside the loop then set the y variable to whatever the start y is outside the loop then in the loop use position object command and position it at your x y and z variables then when you need to move it up and down just add to the y variable like this




That is a working example of a elevator up/down arrows moves the elevator and W/S moves camera. mouselook. there you have it lol
Yodaman Jer
User Banned
Posted: 13th Jan 2009 22:29
OK, I see what you're doing (and it's great!), but now when I run it inside my program I get an error: "Object does not exist".

Here's the bit of code that you wrote and I put it in (with slight modifcation):




Is there something I'm missing? Should I just continue using 'elevator' as the object number?

Yodaman Jer
User Banned
Posted: 13th Jan 2009 22:30 Edited at: 13th Jan 2009 22:31
Oh! I'm an idiot....sorry....I didn't save the modified .dba with my media.... Should work now...lol.


Wait, upon further inspection, I DID save it with my media...hmm. Darn. I was hoping it was only that simple!

Yodaman Jer
User Banned
Posted: 14th Jan 2009 00:52
Uh....Yeah, I AM an idiot..this is what I get for programming since 9:30....

I see that I have still have some of it programmed to move object 100...except that object 100 was originally the platform which was replaced by caleb's code. Therefore, object #100 DOES NOT EXIST, though I still have it programmed to move..., hence the error message I keep getting. *sigh*.

I also spotted some spots that I forgot to add caleb's code to. Now that I have added it and have finally spotted the bug, I think it will work. If it didn't, that would be really odd.

I would like to apologize for my superior idiocy, apparently I can't seem to get rid of lines of code for objects that don't exist.

To make up for it, I'll give you all some coffee:



Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th Jan 2009 05:44
LOL it's cool ya ifbi program for to long I miss stuff 2. I did notice that the position object command wasn't there that I saw (I don't think) well good job spotting it! Let me know if you get it to work (well I know it does it works here hahaha)
Yodaman Jer
User Banned
Posted: 14th Jan 2009 22:10
Yes, it works! I got it to work last night (after adding the position object command), well after a bit of a break (and eating dinner). Thanks for your help!

Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Jan 2009 04:54
any time thats what these forums are for. without these forums i would be nowhere hahaha

Login to post a reply

Server time is: 2026-07-05 11:52:03
Your offset time is: 2026-07-05 11:52:03