Game Development Community

Correct way to approach script to "boost" a wheeled vehicle?

by Lee Latham · in Torque Game Engine · 10/27/2006 (4:42 pm) · 7 replies

I am a novice torque scripter, and I'd appreciate it if I could get some feedback on the approach I'm trying to take to create a "boost" for a wheeled vehicle. Basically, I'd like the player to get a big increase, say, in engineTorque when they hit a mapped key.

What I'm contemplating doing is creating a script function under the WheeledVehicle class which changes the datablock values for the car. Then binding a key to a commandToServer to execute this function.

But...I'm not so confident in my grasp of the structure of the engine, and I'd really could use some feedback about whether I'm on the right track...any feedback would be much appreciated!

P.S. A pointer to a resource that does this that I could study would be great--I have been searching....

#1
10/28/2006 (5:27 am)
Why dont you just create a new .cs file and name it something, then type in something like i dont know what ever that it will boost your speed then, in default.binds add the function to a key
#2
10/28/2006 (1:43 pm)
Well, that's kindof what I had in mind. I guess my question is whether it's possible/correct to alter datablock values? I guess I'm confused because my understanding is that the datablock gets sent only once from server to client. So I was wondering if it _could_ work. Or if there is another general technique that should be used...?

I'm really just getting my bearings on how all the pieces play together....
#3
10/28/2006 (2:13 pm)
Quote:my question is whether it's possible/correct to alter datablock values?

No. Datablocks are immutable, once the game has started. You'll have to use another method.
#4
10/28/2006 (2:18 pm)
Thanks. Is there an obvious other method? I presume there's more than one way to skin this cat?
#5
10/28/2006 (2:41 pm)
Yeah Lee, there is. I can not think of one without at least touching a bit of C++ though. Sorry.
#6
10/28/2006 (6:05 pm)
Fair enough, Stefan, thanks. Very helpful to know that, just the same.

I can do ALMOST everything...but delving into real coding will have to wait for another project, for me.

Probably!
#7
12/13/2006 (2:57 pm)
With a little help from a friend, discovered the ApplyImpulse command. Works great from script, now!