Game Development Community

Swinging Vine

by Chase Fellhoelter · in Technical Issues · 12/10/2007 (6:12 pm) · 1 replies

I am using TGE 1.5.2 and my end goal is to have a swinging vine the player can attach to with a key press and detach with the same key press or release of that key. So after playing around a bit with a simple box that slides back and forth with a mount node inside it, I have come across a few issues. What I have managed so far is: The player can press "." , which can be set to "e", on collision and mount the node using %obj.mountObject(%col, 0);. (The collision box does not animate however). The player is then mounted and moves with the box. In camera mode you can see the player moving with the box, but in first person and third person it does not always follow the motion of the box. I have added %obj.unmount(); in the Player.cs within Armor::doDismount() that allows spacebar, triggerCount2, (how do I set to "e"?) as a dismount trigger and the player is able to unmount from the box. In addition to just unmounting, I am assuming an impulse should be applied to the character to be more realistic.

Some things I need help with:

1. How can the collision mesh be animated (rotating, scaling, translated) through script (preferably .cs)?
2. How can the mount and unmount function be set to use "E" as the key to press or release?
3. Updating first and third person views while mounted.
4. How would an impulse be applied to the character to follow the tangent of the node?

I appreciate any help you can offer and I am always willing to try a new method.

#1
12/18/2007 (7:00 pm)
You could just use the vine instead of the collision mesh. Have the vine animated, and the mount point on it with all the nessisary collision meshes. I don't think you can unmap spacebar from dismount unless you have the source code, but you could do something like:
function eButton(%val) {
   if(ServerConnection.onVine && %val)
      CommandToServer('jumpOffVine');
}
or maby
function eButton(%val) {
   if(ServerConnection.onVine && %val)
      ServerConnection.player.dismount();
}