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.

Author
Message
x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 30th Dec 2007 03:16
I have 5 wav files, that I am trying to get 1 at a time to play when the vehicle hits a certain speed.
I am changing the sounds with the Volume control command but I dont know how to get the vehicle speeds that I want to use for changing the sounds. How can I find out the vehicles speed so I can get my wav files to play when I need them to?
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 31st Dec 2007 02:00
teach you a neat trick i learned from one of the other forums a couple years back. If you type the partial name of a command in the editor and hit <ctrl>+<space> it brings up all the commands that start with the previous text. That is how i found this command for you i typed in "phy get" and a scrollable window popped up showing me all the return value commands for dark physics. It is also great for those realy long commands where you only have to type part of it and then grab it from the scrolling window.



float = phy get vehicle motor force ( ID )
Parameters

ID
identification number of the vehicle

Returns

motor force of a vehicle

Description

The motor force of a vehicle represents how much force is being applied to the motor. For example, if 0.0 is returned then no force is
being applied whereas if 100.0 is returned then a considerable amount of force is being applied to the motor and thus the vehicle will be
moving at quite some speed.

x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 1st Jan 2008 02:20
I keep getting a error when I try to use it.
"Command Line Out Of Place"

No matter where I put it, is there something I am missing cause of the Float command?
thebulk71
18
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 3rd Jan 2008 02:40 Edited at: 3rd Jan 2008 02:45
"command line out of place" usually means that you have an IF statement that isn't ended with an ENDIF. It also occurs when you have a "FOR i=x to x" command that isn't ended by a "NEXT i".

Search for DBA tidy on these forums and you'll be able to automatically format your text and see the nested commands nicely...

hope this advice is relevant and useful. I'm not saying you're a noob, cos i'm sure you already know this, i just felt the need to type

(edit)
Having re-read your post, You are using a command that returns a variable. this means you have two ways of typing it, see the following snippet:
x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 7th Jan 2008 00:40
Thanks for the help, I just had to add in my code to stop the wav from repeating itself. Now I just need to figure out how to setup the vehicle so it is MANUAL shift.
x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 18th Jan 2008 08:05
Ok, I got it to read the Force that the vehicle is moving at.



But the problem is when I press the Up key the reading goes right to the Max vehicle force. It doesnt read the force that the vehicle is moving at untill it reaches its max force.

x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 26th Jan 2008 21:24
I am trying something new. I am trying to get the speed to change according to the velocity but I just cant get it to work. Can anyone help me out with this?



deadlyduck
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: United Kingdom
Posted: 28th Jan 2008 13:02
Hi x_THOR_x
haven't tried your code, but one thing that jumps out at me is:-

Quote: "
if vel() = 15 then set sound volume 1,0 : Play sound 5 : set sound volume 2,100 : set sound speed 2,18000+(vel*975)
if vel() = 20 then set sound volume 2,0 : pLAY SOUND 5 : set sound volume 3,100 : set sound speed 3,18000+(vel*900)
if vel() = 25 then set sound volume 3,0 : Play Sound 5 : set sound volume 4,100 : set sound speed 4,18000+(vel*850)
"


vel() this is an array or function, can't see it set up anywhere, did you mean to type vel?
x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 28th Jan 2008 21:35
Yes I did, sorry about that.



x_THOR_x
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 2nd Feb 2008 13:57
Anyone have any ideas on this? Please !!

Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 2nd Feb 2008 15:43
Text out the Vel value.. I guess its something like 0.002534
and not 25 or 15 you must multiple it with some value to get non decimal values. I think the multiply was something like 3.64 i dont remeber really anymore.


Click For Details!

Login to post a reply

Server time is: 2024-05-20 01:14:39
Your offset time is: 2024-05-20 01:14:39