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 / Stopping an object.

Author
Message
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 7th Aug 2006 23:50
Don't let the title follow you. This question has to do with stopping a DB make object. U know like a sphere or a cude.

I managed to get the whole object position variable thing down pretty good. I've made a program that once the object reaches a certain point the other object moves also but i don't see a command to stop the sphere object from moving. I suppose i could add a variable but i don't think that would stop the object from moving. if you need anything else let me know

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Aug 2006 00:13
Hello,

I'm not sure what you mean but I'm assuming that once an object has started moving, you can't get it to stop and you are using the MOVE OBJECT command.

Look at this code example:



The sphere will move infinitely forward because I set the forward flag to 1 when the up key was pressed. Because it's in the loop it will just keep moving. So I have to change forward to something else to stop the movement:



Now the sphere will only move forward when you press the up key. When you release it, the forward flag is set to 0.

I don't know if this is what you were talking about.

Enjoy your day.
flock
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 8th Aug 2006 03:04
You could have:



Have the speed integer set above zero then once the object reaches a point then rewrite speed to 0. I'm assuming that you're talking about stopping a 3D object not controlled by the user.

a.k.a. "flockhound"
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 8th Aug 2006 05:36
Post your code so that we can see what is happening.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2006 01:49
an easy way to do it is this:



Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 9th Aug 2006 07:42


basically i'm trying to make a 3d object stop once it reaches a certain point. now i looked in the help files and there was a stop object but that's not what i'm looking for since stopping the object stops the animation, not the object itself basicly i need a way that works for both Darkbasic objects and .x models. thanks for all your help. i've managed to learn alot by my self but i mostly got help from you guys

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Aug 2006 10:27
hello,

I think I see. When the up key is pressed, your xv variable increases. Once it reaches 1000, your sphere starts moving at 10 units per loop. If I press the down key, that will decrease xv, and if it falls below 1000, the sphere stops.

Actually, everybody was pretty right on with their solutions to your problem without ever seeing your code! You have to put a limit on how far you want the sphere to move.

You can do it in many different ways. Since your using Move Object, your basing the movement on which way the object is facing. You can use minimal commands to just create a scaler so that when it reaches a certain value, you could set pos = 0. I didn't have your media so I created a bunch more spheres:



Enjoy your day.
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 9th Aug 2006 15:10
thanks, that's exactly what I needed. those models come from the half life SDK. they come in Max format and i just exported Gordon to .X format. Btw, i've found a tutorial on how to do Lightmapping with max so that's something to be happy about...

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack

Login to post a reply

Server time is: 2025-05-25 06:21:09
Your offset time is: 2025-05-25 06:21:09