Primitive 0x0072 - Assign Locomotion Animations

This primitive changes the walk style (locomotion) of a Sim.

Note, walk styles are "stacked" on a Sim. A new walk style is "pushed" and can then be removed by "poping" it. All walk styles can be removed with "pop all" (which reverts to the default walk style). This means that there is no way to permanently change a Sim's walk style as other code at any time can "pop" or "pop all".


Use

There is no SimPe wizard for this instruction, so the following table details the meaning of each of the operands.

OperandDescriptionOperand Values
0 & 1 Locomotion 0x00: Pop All
0x01: Pop
0x02: Push - subtract 2 from value and use that as the index into STR# 0x0084 for locomotion type
2 - bit 1 If set, use private text list (STR#)
2 - bit 2 If set, use semi-global text list (STR#)
2 - bit 3 If set, use global text list (STR#)
2 - bit 4 thru 8 Unused
5 thru 15 Unused

See Also


SimPe Code

// Decompiled with JetBrains decompiler
// Type: pjse.BhavNameWizards.WizPrim0x0072
// Assembly: pjse.coder.plugin, Version=4.0.3349.37576, Culture=neutral, PublicKeyToken=null

using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x0072 : BhavWizPrim
  {
    public WizPrim0x0072(Instruction i)
      : base(i)
    {
    }

    protected override string Operands(bool lng)
    {
      byte[] numArray = new byte[16];
      ((byte[]) this.instruction.Operands).CopyTo((Array) numArray, 0);
      ((byte[]) this.instruction.Reserved1).CopyTo((Array) numArray, 8);
      string str1 = "";
      string str2;
      switch (BhavWiz.ToShort(numArray[0], numArray[1]))
      {
        case 0:
          str2 = str1 + Localization.GetString("bwp72_popAll");
          break;
        case 1:
          str2 = str1 + Localization.GetString("bwp72_pop");
          break;
        default:
          Scope scope = Scope.Private;
          if (((int) numArray[2] & 4) != 0)
            scope = Scope.Global;
          else if (((int) numArray[2] & 2) != 0)
            scope = Scope.SemiGlobal;
          str2 = str1 + Localization.GetString("bwp72_push") + ": " + this.readStr(scope, GS.GlobalStr.LocoAnims, (ushort) ((uint) BhavWiz.ToShort(numArray[0], numArray[1]) - 2U), lng ? -1 : 60, lng ? Detail.Normal : Detail.ErrorNames);
          break;
      }
      return str2;
    }
  }
}