UE1 - UT Methods to toggle player mesh/skin

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

-pnp-

New Member
May 25, 2013
3
0
0
quebec
Hi.
I'm working on a custom pickup inventory item (suit to protect in vacuum zone)
This pickup has to change pawn's mesh/skin to the new ones (suit is "putted on') as well as set back original mesh / skin (suit is "putted off")

I didn't find any explanation how to perform 'direct' mesh toggle by a pickup ..
so
- what is general method to change player's mesh ?
- new multiskin array is assigned automatically or i have to use some function ?

i tried this:
Code:
Owner.Mesh=LodMesh'Botpack.Boss';
but it doesn't work ...:(
Hope there is some solution for this ...
 

BashBox

Just a casualty of unreal
Feb 26, 2011
18
0
0
Code:
class legopickup expands pickup;
// turm the player owner into the selected model .
var playerpawn p;
var shieldbelteffect sb;

function PickupFunction(Pawn Other)
{   // can modify to let PAWN do the same!
  if (other.isa('bot') )
  {
   //other.say("im a bot and i picked up the lego skin.!",'Event',false);
  }
}

function timer()
{
  if (owner.isa('playerpawn') )
  {
   playerpawn(owner).consolecommand ("behindview 0");
  }
}

state activated
{
function beginstate()
{
   //p = playerpawn(other);
    playerpawn(owner).Mesh=LodMesh'lego.lego';
    playerpawn(owner).MenuName="TTeddyX";
    playerpawn(owner).Skin=Texture'jlego';
    playerpawn(owner).consolecommand ("behindview 1");
    playerpawn(owner).MultiSkins[0]=Texture'jlego';
    playerpawn(owner).MultiSkins[1]=Texture'jlego';
    playerpawn(owner).MultiSkins[2]=Texture'jlego';
    playerpawn(owner).MultiSkins[3]=Texture'jlego';
    // fix the shieldbelteffect
     foreach AllActors(class'shieldbelteffect', sb)
     {
      if (sb.owner == playerpawn(owner)  && sb != none)
      {
      sb.mesh = LodMesh'lego.lego';
      }
     };
    // reset the behind view after a second!
    settimer(1,false);
}

function endstate()
{
    playerpawn(owner).Mesh=PlayerPawn(Owner).Default.mesh;
    playerpawn(owner).MenuName=PlayerPawn(Owner).Default.menuname;
    playerpawn(owner).Skin=PlayerPawn(Owner).Default.skin;
    playerpawn(owner).consolecommand ("behindview 1");
    playerpawn(owner).MultiSkins[0]=PlayerPawn(Owner).Default.MultiSkins[0];
    playerpawn(owner).MultiSkins[1]=PlayerPawn(Owner).Default.MultiSkins[1];
    playerpawn(owner).MultiSkins[2]=PlayerPawn(Owner).Default.MultiSkins[2];
    playerpawn(owner).MultiSkins[3]=PlayerPawn(Owner).Default.MultiSkins[3];
    // fix the shieldbelteffect   - was easyier the finding invintory.
    foreach AllActors(class'shieldbelteffect', sb)
    {
    if (sb.owner == playerpawn(owner)  && sb != none)
    {
    sb.mesh = PlayerPawn(Owner).Default.mesh;
    }
    };
    // reset the behind view after a second!
    settimer(1,false);

}
}


defaultproperties
{
 mesh=LodMesh'lego.lego'
 Skin=texture'jlego'
 pickupviewmesh=LodMesh'lego.lego'
 activatesound=Sound'AmbModern.OneShot.hiss2'
 bStatic=False
 bRotatingPickup=True
 PickupSound=Sound'UnrealShare.Pickups.GenPickSnd'
 RespawnTime=1.00
 MultiSkins(0)=Texture'jlego'
     MultiSkins(1)=Texture'jlego'
     MultiSkins(2)=Texture'jlego'
     MultiSkins(3)=Texture'jlego'
     PickupMessage="You got lego costume!"
     bActivatable=True
     bDisplayableInv=True
     ItemName="lego Costume"
     Icon=Texture'jlego'
}

made sure the player animations are available in both models.
this code works in u1 ,but not sure about ut
 
Last edited:

-pnp-

New Member
May 25, 2013
3
0
0
quebec
Thanks alot !
it works ))) mesh changing is ok, now i adjust the skins.
so before pickup procedure player is 'other' and then he is 'owner'.
 

BashBox

Just a casualty of unreal
Feb 26, 2011
18
0
0
slight amendment , you should get the owners current multitextures and skin and not the default as the default are not the user specified custom skin.:lol:
 

-pnp-

New Member
May 25, 2013
3
0
0
quebec
Yup, player old skin had to be stored and read after the transformations...
(or we just give the player some barbie girl skin)
 
Last edited: