package directionaljet
{
function Armor::onTrigger(%this, %player, %slot, %val)
{
parent::onTrigger(%this, %player, %slot, %val);
while(%slot == 4 && %val == 1)
{
%player.addVelocity(%player.getEyeVector());
}
}
};
activatePackage(directionaljet);
This crashes the game. I'm assuming this is because you can't put the eyevector right into addVelocity and expect it to work.
So, how do I change the eyeVector into a number that can be put there?
Lol, don't use a while loop. Just use a schedule, in a different function. I'll write something up, sec.
Edit: Here you go, try this:
package directionaljet
{
function Armor::onTrigger(%this, %player, %slot, %val)
{
parent::onTrigger(%this, %player, %slot, %val);
if(%slot == 4 && %val == 1)
{
%player.directionalJet(1);
}
else
if(%slot == 4 && %val == 0)
{
%player.directionalJet(0);
}
}
};
activatePackage(directionaljet);
function player::directionalJet(%this,%bool)
{
if(%bool)
{
cancel(%this.djl);
//assuming this is correct.
%this.addVelocity(%player.getEyeVector());
%this.djl = %this.schedule(1,directionalJet,%bool);
}
else
{
return 0;
}
}