Is it possible to return a float from the cmd:
Community Forums/General Help/Is it possible to return a float from the cmd:
| ||
I am attempting to create a pivot for some smoke that needs to be attached to a funnel. For testing purposes I have just attached a funnel to a car. I am using the dBodyGetPositionX, Y & Z respectively however I am only able to return integers. I require more precision in order to place my smoke dynamically on top of the funnel. Can anyone please tell me if it is possible to return a float from the following dBodyGetPosition{X,Y,Z} argument ? funnelx=Float dBodyGetPositionX(Car) funnely=dBodyGetPositionY(Car) funnelz=dBodyGetPositionZ(Car) Thanks in advance - BP. |
| ||
I seem to have found a workaround which ties my smoke to my funnel:![]() |
| ||
Not entirely sure where that function comes from, but you can get a function to return a float by sticking a hash (#) at the end of the function declaration, i.e.:funnelx=dBodyGetPositionX(Car) Function dBodyGetPositionX#(entity) ;whatever the function is Return value# End Function Note that further modification may be required if the existing function only operates with integers. |
| ||
thanks for the feedback Gfk. |
| ||
try tform point. im not sure exactly how this works but it worked for me when I used blitz 3d |
| ||
In addition to what gfk already wrote, if the first line of this is the first occurance (ie a declaration) you need a # on the end of that too. ie; funnelx#=dBodyGetPositionX(Car) Although not nessecary i prefer to try and remember to use %#$ for int/float/string declarations and in complex formulas. Also i try and use them throughout, especially # and $, that way i know exactly what they are and because blitz3d does not have stricts(shame!) it helps stop math errors. eg: funnelx=dBodyGetPositionX(Car) funnelx#=funnelx#+10 would throw an error telling me i screwed up on the declaration. |