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 Professional Discussion / stupid move object

Author
Message
AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 07:45 Edited at: 26th Sep 2003 07:48
If you move an object to a negative position with any of the move object commands it puts a decimal and a bunch of numbers when you use object position x(), y(), or z(). Why?


indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Sep 2003 08:17
I dont think you apply the grey matter enough mate with your problems.

anyway here is a sample to look at regarding this.


perhaps its to do with the print command not displaying a correct result.




http://www.lunarpixel.com
It's already tomorrow in Australia
AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 18:14
If you ran my program the problem should have been obvious. Your code still doesn't fix it.

ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Sep 2003 20:32
there problem fixed:



AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 22:16
That doesn't really fix anything but... I dunno. It wouldn't fix what i'm using it for in a game.

ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Sep 2003 22:35
it fixes the decimal and 'bunch of numbers' bit, what are you trying to do anyway? then we could help better


AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 22:42
I want to use the move object commands and have object position x(), y(), z() return integers. If the problem can't be fixed I guess I will just use position object.

malcom2073
23
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 26th Sep 2003 22:44
You have to set object position X() to a variable then use the variable. or do int(object position x()) as the object position xyz commands return real numbers, not integers.
AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 22:57
It should be returning integers in the program I wrote, but it's not.

AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 26th Sep 2003 23:16 Edited at: 26th Sep 2003 23:19
I found the problem! I tried using position object with sin and cos and it still didn't work, but it worked when I used int with sin and cos. Yeah!

ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Sep 2003 23:22
object position x/y/z returns a real value, so you put it into a variable which can only hold integers, which is exactly what my code did.


indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 27th Sep 2003 00:00 Edited at: 27th Sep 2003 00:01
I actually looked at your code, dont assume otherwise.
My example produces integer based values here with 5.0

Perhaps its the version of DBP your using.

Your reply and forum name are not exactly charming.

http://www.lunarpixel.com
It's already tomorrow in Australia
AnalSauceMonkey
23
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 27th Sep 2003 01:13 Edited at: 27th Sep 2003 01:16
ReD_eYe, yeah, thanks for trying to help but that's not exactly what I was looking for. I already fixed the problem.

indi, thanks also, but either your code is wrong or it has something to do with the version I'm using (5.1b), because your example doesn't return integers.

Login to post a reply

Server time is: 2026-07-25 07:01:40
Your offset time is: 2026-07-25 07:01:40