I still want to be able to look around (like full 360 turning), is this still possible with static shape mounting?
EDIT:
I am getting sleepy, the time to not post anymore, i just remembered you just need to set the control object to the player if i remember correctly.
I am trying it out right now.
EDIT2:
Logically you cannot change your aim horizontally while mounted to a staticshape.
Changing it to a bot now. Familiar territory too.
EDIT3:
Welp, turns out that works, kinda, still had trouble with a couple of things.
The only big problem is that this immobilizing needs to happen while keeping the jet button pressed.
However, this immediately unmounts you from anything.
Can i do something to prevent this? Am i doing something wrong/missing?
My test code so far (without it happening when jetting, i just started jetting and then called the function):
datablock PlayerData(groundLockedArmor)
{
renderFirstPerson = false;
emap = false;
isInvincible = 1;
className = Armor;
shapeFile = "base/data/shapes/empty.dts";
aiAvoidThis = true;
//maxDamage = 200;
//boundingBox = vectorScale("3.75 3.75 5.75", 2); //2.5 2.5 2.4", 4
//crouchBoundingBox = vectorScale("3.75 3.75 5", 2); //2.5 2.5 2.4", 4
maxForwardSpeed = 0;
maxBackwardSpeed = 0;
maxSideSpeed = 0;
maxForwardCrouchSpeed = 0;
maxBackwardCrouchSpeed = 0;
maxSideCrouchSpeed = 0;
maxForwardWalkSpeed = 0;
maxBackwardWalkSpeed = 0;
maxSideWalkSpeed = 0;
maxUnderwaterForwardSpeed = 0;
maxUnderwaterBackwardSpeed = 0;
maxUnderwaterSideSpeed = 0;
jumpForce = 0;
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
jetEmitter = "";
jetGroundEmitter = "";
jetGroundDistance = 4;
};
package testPackage
{
function Armor::onUnMount(%this,%player,%obj,%a,%b,%c,%d,%e,%f)
{
if (isObject(%player) && %player.getState() !$= "Dead" && %obj.isGroundLock )
{
return 0;
}
Parent::onUnMount(%this,%player,%obj,%a,%b,%c,%d,%e,%f);
}
};
activatePackage(testPackage);
function lockInPlace(%obj, %time)
{
if (!isObject(%obj))
return 0;
echo("LockingInPlace");
%client = %obj.client;
%groundPos = %obj.getPosition();
%ground = new AIPlayer()
{
datablock = groundLockedArmor;
position = %groundPos;
scale = "1 1 1";
owner = %obj;
isGroundLock = 1;
};
missionCleanup.add(%ground);
if (isObject(%client))
%ground.minigame = %client.minigame;
echo(%ground);
%succes = %ground.mountObject(%obj, 0);
if (%succes)
{
if (isObject(%client))
{
%client.setControlObject(%obj);
}
else
{
%obj.setControlObject(%obj);
}
if (%time > 0)
{
schedule(%time, echo, "Unmounting");
%ground.schedule(%time, delete);
}
return 1;
}
echo("Mounting result:" SPC %succes);
return 0;
}
function unlockMovement(%obj)
{
if (!isObject(%obj))
return 0;
%mount = %obj.getObjectMount();
if (isObject(%mount))
{
%mount.delete();
return 1;
}
return 0;
}