0x0008

From SimsWiki
Revision as of 10:56, 3 October 2009 by MogHughson (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Random Number
OpCode:0x0008
Game Version:The Sims 2


Overview

This primitive allows you to generate a random number, i.e. flip a coin to make random desicions in your BHAV code based upon its result.

Using the Instruction Wizard

Random Number Instruction Wizard

The top half of the wizard covers where you are going to assign the generated random number. This should be familiar to you if you have used Expression [prim 0x0002] when you set the assignment operator (:=). The choices are any of the many variables and attributes that are part of SimAntics.

The bottom half of the wizard allows you to provide a variable or attribute containing the number to randomise up to, which can also be a literal as in the example above.

Your next instruction linked to the True target is likely going to make a descision about what route to take through your BHAV based on what is now contained in your assigned variable.

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox