Author Topic: Help on how to hide a playertype's feet and make a weapon use zombie animations  (Read 1705 times)

http://www.mediafire.com/download/ohppc2ba7njyblf/Player_XCOM.zip
I see no more errors in the console, but none of the playertypes or weapons are selectable.
Edit: I've just noticed that the MaxDamage fields don't have a semicolon and equals symbol as they should. So that explains that.

Additionally, I want to know if my method to hide the Floater's foot nodes was correct or not, and if not, how to fix it.
I also want to know how to give my weapons the properties of having both of the player's hands raised,
and make them use the rapid click animation, as Rotondo's old zombies did.

I tried searching for help on this matter, which is where I got the Floater's foot node hiding script from, but I've probably incorrectly implemented it, and for the rest, I'm just not sure what exactly to search for.
« Last Edit: May 13, 2016, 01:29:45 AM by Brixmon »

You have to call the hideNode in a function. Not in the datablock declaration. I'd suggest doing it in PlayerFloater::onAdd(%data, %player) and then packaging, parenting, and doing it in PlayerFloater::onNewDataBlock(%data, %player). You should also package player::unHideNode(%player, %node); and if they're using your datablock and trying to hide one of the foot nodes, don't parent it. If they're hiding all of the nodes then you should call hideNode on the feet again. You should also hide RPeg and LPeg just incase.

For raising both hands just do:
Code: [Select]
function YOURWEAPONIMAGE::onMount(%data, %obj, %slot)
{
parent::onMount(%data, %obj, %slot);

%obj.playThread(1, armReadyBoth);
}

I believe the rapid click animation is activate2. Just do it like above but use onFire instead of onMount.

You have to call the hideNode in a function. Not in the datablock declaration. I'd suggest doing it in PlayerFloater::onAdd(%data, %player) and then packaging, parenting, and doing it in PlayerFloater::onNewDataBlock(%data, %player). You should also package player::unHideNode(%player, %node); and if they're using your datablock and trying to hide one of the foot nodes, don't parent it. If they're hiding all of the nodes then you should call hideNode on the feet again. You should also hide RPeg and LPeg just incase.

For raising both hands just do:
Code: [Select]
function YOURWEAPONIMAGE::onMount(%data, %obj, %slot)
{
parent::onMount(%data, %obj, %slot);

%obj.playThread(1, armReadyBoth);
}

I believe the rapid click animation is activate2. Just do it like above but use onFire instead of onMount.

Going to be honest, I have very little idea what you said, except the weapon animations.
All I know about Torquescript in Blockland has been from dissecting and editing existing add-ons.
Could you provide me with some example code for the node hiding?

Bump.
I've managed to get the weapon animations working, though with some weirdness. Copying the Sword's state animation code has proven odd and I've only just managed to get things working. If someone could take a look at my weapon code and tell me if anything's wrong with it, that'd be nice.
As for the Floater's feet, I have no idea how to package or parent things. I've put the function in there, but the rest of what you said is greek to me.

I updated the file with my changes. Haven't tested it yet.

for the floater, you'd need
Code: [Select]
function PlayerFloater::onAdd(%data, %player)
{
Parent::onAdd(%data, %player)

%player.hidenode("RFoot");
%player.hidenode("LFoot");
%player.hidenode("RPeg");
%player.hidenode("LPeg");
}

for the floater, you'd need
Code: [Select]
function PlayerFloater::onAdd(%data, %player)
{
Parent::onAdd(%data, %player)

%player.hidenode("RFoot");
%player.hidenode("LFoot");
%player.hidenode("RPeg");
%player.hidenode("LPeg");
}
Finally got around to testing this, got a strange syntax error:
Code: [Select]
Loading Add-On: Player_XCOM (CRC:-353607457)
Add-Ons/Player_XCOM/Player_Floater.cs Line: 31 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^maxBackwardCrouchSpeed = 2;

^maxSideCrouchSpeed = 2;

^

^airControl = 3;

^minImpactSpeed = 35;

^speedDamageScale = 0.5;



^uiName = "Alien Floater";

^showEnergyBar = false;

};



function PlayerFloater::onAdd(%data, %player)

{

^Parent::onAdd(%data, %player)



^%player.##h##idenode("RFoot");

^%player.hidenode("LFoot");

^%player.hidenode("RPeg");

^%player.hidenode("LPeg");

}
>>> Error report complete.

ADD-ON "Player_XCOM" CONTAINS SYNTAX ERRORS
I'm not sure what it's trying to say here. The RFoot hidenode looks the same as the others. Is it saying the "h" is wrong?

I see what went wrong, I forgot a semicolon after the Parent::. Use this code:
Code: [Select]
function PlayerFloater::onAdd(%data, %player)
{
Parent::onAdd(%data, %player);

%player.hidenode("RFoot");
%player.hidenode("LFoot");
%player.hidenode("RPeg");
%player.hidenode("LPeg");
}

I see what went wrong, I forgot a semicolon after the Parent::. Use this code:
Code: [Select]
function PlayerFloater::onAdd(%data, %player)
{
Parent::onAdd(%data, %player);

%player.hidenode("RFoot");
%player.hidenode("LFoot");
%player.hidenode("RPeg");
%player.hidenode("LPeg");
}
It still doesn't work. The player still has feet.

onAdd only gets called when your player is first created, if they're created using that datablock. onNewDataBlock is called when the player's datablock changes to your datablock. Even if you do both of these, the player can unhide their feet by updating their avatar. The easiest way would be to do what I said. I'll try to explain it better when I have time.