**Tutorial D1**

=====

Scripting: RESPONSE #50, what does that mean?

---------------------------------------------

(by: KenTeamBG)

It is a weight...or how likely that action will occur versus the other actions you specified.

---------------------------------------------

In this example RandomWalk() and NoAction() each have a 50% chance of occurring:

IF

....True()

THEN

....RESPONSE #50

........RandomWalk()

....RESPONSE #50

........NoAction()

END

That is because the total of all the response weights is 100 and each is 50 (thus 50%).

---------------------------------------------

Now the response weights do NOT have to equal a total of 100...you could have:

IF

....True()

THEN

....RESPONSE #50

........RandomWalk()

....RESPONSE #50

........ForceSpell()

....RESPONSE #50

........ReallyForceSpell()

....RESPONSE #50

........NoAction()

END

This would result in each action having a 25% chance of occurring.

---------------------------------------------

This also would result in each action having a 25% chance of occurring:

IF

....True()

THEN

....RESPONSE #25

........RandomWalk()

....RESPONSE #25

........ForceSpell()

....RESPONSE #25

........ReallyForceSpell()

....RESPONSE #25

........NoAction()

END

OR...

IF

....True()

THEN

....RESPONSE #1

........RandomWalk()

....RESPONSE #1

........ForceSpell()

....RESPONSE #1

........ReallyForceSpell()

....RESPONSE #1

........NoAction()

END

Both of the above scripts will result in identical scripts.

---------------------------------------------

But, this would result in 3 of them having a 20% chance of occurring and the one having a 40% chance of occurring:

IF

....True()

THEN

....RESPONSE #2

........RandomWalk()

....RESPONSE #1

........ForceSpell()

....RESPONSE #1

........ReallyForceSpell()

....RESPONSE #1

........NoAction()

END

---------------------------------------------

Is this as clear as Ochre Jelly now?