Primitive 0x006F - Change Light

This primitive changes the intensity setting for one (all) lights on an object (for a given duration)


Use

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

OperandDescriptionOperand Values
0 Unused
1 - bit 1 Controls where Tick Count is taken from Off: Use value in Op5/6
On: Use value in Temp 1
1 - bit 2 Controls where Intensity% is taken from Off: Use value in Op7
On: Use value in Temp 0
1 - bit 3 thru 8 Unused
2 Variable containing the Target
3 & 4 Qualifiers on the variable in operand 2
5 & 6 Tick Count see Op1 Bit1
7 Intensity% see Op1 Bit2
8 Light 0xFF: All
Other: Index into STR# 0x008E for light name
9 thru 15 Unused

See Also


SimPe Code

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

using SimPe;
using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x006f : BhavWizPrim
  {
    public WizPrim0x006f(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 str = "" + (lng ? pjse.Localization.GetString("Target") + ": " : "") + this.dataOwner(lng, numArray[2], numArray[3], numArray[4]) + ", " + pjse.Localization.GetString("bwp6f_light") + ": " + (numArray[8] == byte.MaxValue ? pjse.Localization.GetString("bwp6f_all") : this.readStr(GS.GlobalStr.LightSource, (ushort) numArray[8], lng ? -1 : 60, Detail.ErrorNames));
      if (lng)
        str = str + ", " + pjse.Localization.GetString("bwp6f_ticks") + ": " + (((int) numArray[1] & 1) != 0 ? this.dataOwner((byte) 8, (ushort) 1) : "0x" + Helper.HexString(BhavWiz.ToShort(numArray[5], numArray[6]))) + ", " + pjse.Localization.GetString("bwp6f_intensity") + ": " + (((int) numArray[1] & 2) != 0 ? this.dataOwner((byte) 8, (ushort) 0) : numArray[7].ToString() + "%");
      return str;
    }
  }
}