Primitive 0x0016 - Turn Body Towards

This primitive directs a Sim to turn in a specific direction.


Use

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

OperandDescriptionOperand Values
0 Direction to turn 0x01: Towards Camera
0x02: Towards Stack Object
0x03: Away from Stack Object
0x04: Towards North
0x05: Towards North East
0x06: Towards East
0x07: Towards South East
0x08: Towards South
0x09: Towards South West
0x0A: Towards West
0x0B: Towards North West
0x0C: Left 45 degrees
0x0D: Left 90 degrees
0x0E: Left 135 degrees
0x0F: Right 45 degrees
0x10: Right 90 degrees
0x11: Right 135 degrees
0x12: 180 degrees
0x13: Towards target slot
0x14: Towards routing slot
0x15: Towards container slot
0x16: Away from target slot
0x17: Away from routing slot
0x18: Away from container slot
0x19: To abs dir in Temp 0
0x1A: To rel dir in Temp 0
1 thru 15 Unused

See Also


SimPe Code

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

using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x0016 : BhavWizPrim
  {
    public WizPrim0x0016(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);
      return "" + BhavWiz.readStr(GS.BhavStr.TurnBody, (ushort) numArray[0]);
    }
  }
}