About the scripting side of dynamic objects...
In maniascript, the class describing dynamic objects is CSmObject.
When manipulating dynamic objects, the important thing to have in mind is that, at any moment, an object is in a given "status", namely
To change the status of an object, use the corresponding method
- SetPosition(Vec3) or SetPositionAndVel(Vec3, Vec3)
E.g. if a given item was previously "InWorld", a call to the method "SetAnchor" will change its status to "OnAnchor". In other words, calling more than one of these methods during the same frame is useless: only the last method call will be taken into account.
You can access the status of an object with the field Status, which returns a CSmObject::EStatus.
When the status is OnPlayer, the field Player gives you which player currently owns the object. Having this field Null is equivalent for the status not to be "OnPlayer".
When the status is OnAnchor, the field Anchor gives you which anchor currently holds the object. Having this field Null is equivalent for the status not to be "OnAnchor".
Here is a short description of what the various statuses mean.
The object is linked to a player.
It is not present in the world - in other words, the object only exists "virtually".
If the field "Throwable" is set to True, then next time the player will use the "shoot" button (presumably, the left click of the mouse) the object will be thrown, which lead to 2 remarks
1. Its status will switch from "OnPlayer" to "InWorld",
2. The direction of the throw is given by the players aim, and the force by the field CSmPlayer.ThrowSpeed
A player throws all objects with the same speed. If the player owns several throwable objects, all of them will be thrown at the same time, with the same speed and the same direction.
When a player throws an object, he/she does not fires any projectile (like a rocket). He/She has to lift his/her finger and press the fire button again to do so.
The object is linked to an anchor defined by the map. Physics does not apply here - the object does not move until its status changes to "InWorld". This presumably will be the status of objects at the beginning of the match if you want them to have a fixed position in the map.
The object is somewhere in the world, visible, and subject just like us to the tough laws of physics. You can get the coordinates of an object with the field CSmObject.Position, and its velocity with CSmObject.Vel.
Any call to the method "SetPosition" or "SetPositionAndVel" will set the status of an object to "InWorld". The object is "teleported" at the given position, and the given speed vector will be applied. You will probably have to be careful not to set the position inside of a wall or somewhere not reachable.
If a player touches the object, it reacts like any other item by generating a PlayerTouchesItem event.
Notice that objects are not affected by special blocks such as trampolines or jump pads, and do not either bounce on players or other objects.
The object is nowhere, but can be accessed later on.