In threads commands like:
%obj.playThread(2, shiftAway);
What does the 2 in it mean? I couldn't figure it out.
It's the slot that thread is playing in.
If you play another thread in slot 2, shiftAway will stop, and then that one called will play instead.
Generally, you would stop a thread by using .playThread(2, root);
I know there's a setVelocity command; I've already used it. But is there some way to simply add velocity? I tried
%obj.addVelocity("# # #")
But it didn't work
Because addVelocity is a function created specifically for the events system, You may have to add a client as a second arg.
In function headers like:
function tbhVehicle::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e)
What do the variables %this.%obj,%col,%a etc. mean? (yes, I took that from the Tank script)
%this, or the first argument of the function, is the object that the function was called on. In this case, the tbhVehicle.
%obj usualy references an object. In this case, I believe it means the vehicle that called the function, because %this in this case is used for the datablock.
%col usually references the target object in a collision function.
The rest are generally not important, but if you wish to really know what they are, experiment with echos.
The names of these arguments do not matter. I could rewrite the entire function to follow this:
function tbhVehicle::onCollision(%poop,%frog,%duck,%apple,%baby,%code,%dog,%elephant)
and still produce the same result.
The only thing that matters is the order and how you use it.
As for your last question, I'm not sure. I haven't worked on vehicles.