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 / mouse moveing object help

Author
Message
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 21st Sep 2003 03:23
i am working on a code that will allow me to select a 3d object on a matrix and then click somewhere else and have it move there...Any help on this? Thanx in advance...

Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
zzabb
22
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 21st Sep 2003 08:32
hey so am i (-: but i'm not sure how much help i'll be to you because i'm using pro )-:
i know i know this is the reg db board, but i have both and i like learnin new stuff and ya never know when..... anyway

the command i use to select the object isn't available in reg db but to select the object you may want to try something like,

if OBJECT SCREEN X(Object Number)=mousex() and OBJECT SCREEN y(Object Number)=mousey()
moveobject
endif

i haven't tried it but it should work
one thing you may need to add (+5,-5 or some value) to mousex and mousey because it is a small point and it may be hard to pick your object

to move the object you need to decide whether you want it to go to the new position instantly or do you want to watch it move there

if you want to go instantly

then just position your object to the new location

I don’t know how to get the new location position x,y,z, with your mouse using a matrix, someone else may know???
I made the ground out of objects and I got the location of the ground object and then set the position of the object I wanted to move to that location

If you want to watch your object move then you have to have a loop for your movement
Something like (this isn’t code just the idea)



POINT OBJECT Object Number, selected object X, selected object Y , selected object Z
Set your animation
Do
Loop animation or you could set each frame of animation based on each move
MOVE OBJECT Object Number, 1 (the amount you want to move)

If OBJECT POSITION X(Object Number)= your selected OBJECT POSITION X(Object Number) and OBJECT POSITION y(Object Number)= your selected OBJECT POSITION y(Object Number) and OBJECT POSITION z(Object Number)= your selected OBJECT POSITION z(Object Number) then exit
sync
loop

the caps are because I cut and pasted the commands from the command page in DB
anyway that’s the basics

I haven’t got it perfected yet but it mostly works and that was the logic I followed

good luck

My advice is free -
unfortunately you get what you pay for (-:
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 21st Sep 2003 10:16
thanx, that helped alot i will make a code tonight and tell my results tomorrow....thanx again

Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
zzabb
22
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 21st Sep 2003 10:57
(-:

My advice is free -
unfortunately you get what you pay for (-:
D Man
22
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 21st Sep 2003 13:16 Edited at: 21st Sep 2003 13:16
Why don't you use this code?
http://darkbasicpro.thegamecreators.com/?m=forum_view&t=13689&b=6

God is real, unless declared integer.
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 22nd Sep 2003 04:52
strange...i got an error when using that code...

anyway, i tried it with absolutly no success, so if anyon has another idea or code that would be great thanks

Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 22nd Sep 2003 05:18
from what i read on that link, it is for DBPro (hence, http://darkbasicpro.blahblahblah)
thats prolly the reason why it didnt work

<{^_^<}
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 22nd Sep 2003 07:12
ahhh...that would do it

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 22nd Sep 2003 07:13
btw: if your wondering exactly what this is going to be used for, it will be used for and icewind dale/baulders gate kind of game

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 24th Sep 2003 04:20
anyone have any other help, or should i stop checking this post?

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Sep 2003 06:13
you try reading the other threads? This isn't the first time this question has been asked. Look around, your answer is already out there.

Login to post a reply

Server time is: 2025-05-20 17:38:19
Your offset time is: 2025-05-20 17:38:19