Author Topic: Need help with player throwing Script  (Read 3037 times)

1) That if test requires three things: They cannot be larger than your scale if you're to pick them up. They also must use the standard player model (so you cannot pick up Horses or Tank Turrets, for example). Finally, you need to be able to either be in their minigame with weapon damage on or own their spawn brick (if applicable) in order to pick them up.

2) Those three lines tell the client of who you're picking up, if it exists (i.e. if it's not a bot) to spectate the person holding them. It's almost like /spy'ing them, but you cannot click to exit the view. Just a simple cosmetic effect to make being grabbed not fling your camera everywhere if you were in first person still.

3) Yes, if they're less than half your scale you'll only hold them with one arm. Otherwise you'll hold them with both your arms. It's really just another cosmetic effect, but it looks very odd when not implemented, since a small player lying down (death1) doesn't reach your other arm.

4) That's not getting their position, it's setting their transform. That transform specifies them to turn perpendicular to the player holding them and angle themselves just right to make the holding look proper, so that they're not sticking straight out or into the player. Refer to this picture:



5) The return 1's and 0's are to tell the function calling it, if any, that it either passed or failed. If the person is successfully thrown or grabbed when their respective functions are called, then it will return 1. This allows you to implement simple code such as this to manage grabbing/throwing:

Code: [Select]
package ThrowMod
{
function Player::activateStuff(%this)
{
if(!%this.attemptThrow())
{
if(!%this.attemptGrab())
return Parent::activateStuff(%this);
}
}
};
activatePackage(ThrowMod);
« Last Edit: June 13, 2010, 11:54:42 AM by Truce »

-snip-

Reaaly sorry about the bump, but I didn't feel like starting a new topic about a small question over something that doesn't matter and I've never really needed to use before.

If you read this again truce, could you post the code for the "grabbed" mode of the observer datablock?