Author Topic: RESPONSE #50, what does that mean? By KenTeamBG  (Read 12960 times)

0 Members and 1 Guest are viewing this topic.

Offline Solaufein

  • Lord of the Realms
  • Administrator
  • Level 5
  • *****
  • Posts: 5160
  • Karma: +127/-19
  • Gender: Male
  • The night is dark and full of terrors...
    • ICQ Messenger - 251194643
    • Yahoo Instant Messenger - gscott7833
    • View Profile
    • http://teambg.net
RESPONSE #50, what does that mean? By KenTeamBG
« on: April 01, 2012, 10:33:45 PM »
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?
My mods:
Dark Horizons
The Undying
Nikita
IWD2 store

Co-contributor:
Dark Side of the Sword Coast BG1 Weidu
Aurils Bane
Encounters
Saerileth
Baldur's Gate - Enhanced Edition beta tester
Baldur's Gate 2 - Enhanced Edition beta tester
Icewind Dale - Enhanced Edition beta tester