Primitive 0x0070 - Effect Stop/Start

This primitive plays or stops an effect, such as the food stink and water sprinkler.


Use

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

OperandDescriptionOperand Values
0 Action 0x00=Soft start effect#
0x01=Hard start effect#
0x02=Soft stop effect#
0x03=Hard stop effect#
0x04=Hard stop effect ID
0x05=Hard stop all effect IDs
0x06=Fire and forget effect#
0x07=Interrogate Bone for effects
0x08=Clear Queue and Hard stop all effects
0x09=Hard stop ALL effects
0x0A=Set State 1 for all effects
0x0B=Set State 2 for all effects
0x0C=Set State 3 for all effects
0x0D=Set State 4 for all effects
0x0E=Soft stop ALL effect#
1 Variable containing the Target
2 & 3 Qualifiers on the variable in operand 1
4 Effect Index (into STR# 0x008F), value 0xFF is the default effect (for actions 0x00, 0x01, 0x02, 0x03, 0x06 and 0x0E)
5 Unused
6 Slot Number (starts at 0 for each slot type) (when op9 = 0x01, 0x02 or 0x03)
7 Unused
8 Unused
9 Slot Type Note: This is NOT what SimPE reports!
0x00=target slot
0x01=route slot
0x02=container slot
(for actions != 0x09 or 0x0E)
10 - bit 1 Set to use global scope for Op4
10 - bit 2 Set to use semi-global scope for Op4
10 - bit 3 If set, Icon in given by variable in Op12
10 - bit 4 Unused
10 - bit 5 If set, Icon in given by variable in Op12 (NID)
10 - bit 6 If set, Icon in given by variable in Op12 (Conversation)
10 - bit 7 If set, Effect ID is in Temp1 (for actions 0x04 or 0x05)
10 - bit 8 Priority flag
11 - bit 1 Unused
11 - bit 2 Unused
11 - bit 3 If set, Icon is taken from GUID in Temp4,5
11 - bit 4 If set, Model is in Temp6
11 - bit 5 If set, Icon is in Temp6
11 - bit 6 Unused
11 - bit 7 Unused
11 - bit 8 Unused
12 Variable containing the Icon
13 & 14 Qualifiers on the variable in operand 12
15 Icon Index Index (into STR# ???) (when Op10 bit 6 set)

See Also


SimPe Code

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

using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x0070 : BhavWizPrim
  {
    public WizPrim0x0070(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 = "" + BhavWiz.readStr(GS.BhavStr.EffectSSType, (ushort) numArray[0]) + ", " + (lng ? Localization.GetString("Target") + ": " : "") + this.dataOwner(lng, numArray[1], numArray[2], numArray[3]);
      if (lng && numArray[0] != (byte) 9 && numArray[0] != (byte) 14)
        str1 = str1 + ", " + BhavWiz.Slot(numArray[9], numArray[6]);
      Scope scope = Scope.Private;
      if (((int) numArray[10] & 1) != 0)
        scope = Scope.Global;
      else if (((int) numArray[10] & 2) != 0)
        scope = Scope.SemiGlobal;
      if (numArray[0] == (byte) 4 || numArray[0] == (byte) 5)
        str1 = str1 + ", " + Localization.GetString("bwp70_effectID") + ": " + (((int) numArray[10] & 64) != 0 ? this.dataOwner((byte) 8, (ushort) 1) : "---");
      else if (numArray[0] < (byte) 4 || numArray[0] == (byte) 6 || numArray[0] == (byte) 14)
        str1 = numArray[4] == byte.MaxValue ? str1 + ", " + Localization.GetString("bwp70_defaultEffect") : str1 + ", " + this.readStr(scope, GS.GlobalStr.Effect, (ushort) numArray[4], lng ? -1 : 60, lng ? Detail.Normal : Detail.ErrorNames);
      if (lng)
      {
        string str2 = str1 + ", " + Localization.GetString("bwp_icon") + ": ";
        string str3;
        if (((int) numArray[10] & 4) != 0)
          str3 = str2 + this.dataOwner(numArray[12], numArray[13], numArray[14]);
        else if (((int) numArray[10] & 16) != 0)
          str3 = str2 + this.dataOwner(numArray[12], numArray[13], numArray[14]) + " (" + Localization.GetString("NeighborID") + ")";
        else if (((int) numArray[10] & 32) != 0)
          str3 = str2 + this.dataOwner(numArray[12], numArray[13], numArray[14]) + " (" + Localization.GetString("bwp70_conversation") + "), " + Localization.GetString("bwp70_sheet") + ": " + this.readStr(scope, GS.GlobalStr.IconTexture, (ushort) numArray[15], -1, lng ? Detail.Normal : Detail.ErrorNames);
        else
          str3 = ((int) numArray[11] & 4) == 0 ? (((int) numArray[11] & 16) == 0 ? str2 + Localization.GetString("bwp70_noIcon") : str2 + this.dataOwner((byte) 8, (ushort) 6)) : str2 + "GUID [" + this.dataOwner((byte) 8, (ushort) 4) + ",5]";
        str1 = str3 + ", " + Localization.GetString("bwp_priority") + ": " + (((int) numArray[10] & 128) != 0).ToString() + ", " + Localization.GetString("bwp70_model") + ": " + (((int) numArray[11] & 8) != 0 ? this.dataOwner((byte) 8, (ushort) 6) : Localization.GetString("default"));
      }
      return str1;
    }
  }
}