Jump to content

Holy. Crap.


Nightwoe

Recommended Posts

Yeah, it's certainly possible. What you'll want to do is something like this:

 

IF
 Global("CheckMe","GLOBAL",0)
 AreaType(FOREST)
THEN
 WEIGHT #1
SetGlobal("CheckMe","GLOBAL",1)
SetPlayerSound() //Can't remember the syntax for this off the top of my head.  Check Aerie/Anomen's soundset changes throughout the game
 WEIGHT #1
SetGlobal("CheckMe","GLOBAL",1)
SetPlayerSound() //see above but set it to the other soundset clip
END

 

If you haven't seen this before I've got two different endings to the script block, both with the same WEIGHT so in theory they'll be equally likely to happen.

 

You could even chuck in a VerbalConstantHead() so it then plays their "forest soundset clip" asap. You'll want to check the IESDP for the exact syntax of it and SetPlayerSound().

 

I've just used a random variable so it does this once and only once. if you want it to happen more than once you could set a half hour timer or something so that it *will* check again but not every two seconds (which will grind the game to a halt).

Link to comment
If you haven't seen this before I've got two different endings to the script block, both with the same WEIGHT so in theory they'll be equally likely to happen.

It's RESPONSE #X, not WEIGHT #X. Also, two actions with the same RESPONSE # aren't equally probable - you need to use RandomNum() and friends for that.

Link to comment
If you haven't seen this before I've got two different endings to the script block, both with the same WEIGHT so in theory they'll be equally likely to happen.

Also, two actions with the same RESPONSE # aren't equally probable - you need to use RandomNum() and friends for that.

To be fair, the difference in probability is pretty slim with two responses (the second response triggered, on average, roughly 45 times for every 50 times the first response triggered, in my tests). It get's a bit wackier when you increase the number of responses, but I have not seen any devitations outside 20%.

Link to comment

In fact, after some quick experimentation, it appears that with RESPONSE #1 only the first response is ever chosen.

 

Test code:

<<<<<<<< a.baf
IF
 True()
THEN
 RESPONSE #1
ActionOverride(Player1,DisplayString(Player1,~11~))
Continue()
 RESPONSE #1
ActionOverride(Player1,DisplayString(Player1,~12~))
Continue()
END

IF
 True()
THEN
 RESPONSE #10
ActionOverride(Player1,DisplayString(Player1,~101~))
Continue()
 RESPONSE #10
ActionOverride(Player1,DisplayString(Player1,~102~))
Continue()
END

IF
 True()
THEN
 RESPONSE #100
ActionOverride(Player1,DisplayString(Player1,~1001~))
Continue()
 RESPONSE #100
ActionOverride(Player1,DisplayString(Player1,~1002~))
Continue()
END

IF
 True()
THEN
 RESPONSE #1000
ActionOverride(Player1,DisplayString(Player1,~10001~))
Continue()
 RESPONSE #100
ActionOverride(Player1,DisplayString(Player1,~10002~))
Continue()
END
>>>>>>>>

EXTEND_TOP ~baldur.bcs~ ~a.baf~

 

results (taken thanks to ToBEx dialogue logging and some quick processing in libre office)

RESPONSE #	  Branch #2 is chosen this % of times:
 1			 0
 10			46
 100		   46
 1000		  10

Link to comment
In fact, after some quick experimentation, it appears that with RESPONSE #1 only the first response is ever chosen.

 

Test code:

<<<<<<<< a.baf
IF
 True()
THEN
 RESPONSE #1
ActionOverride(Player1,DisplayString(Player1,~11~))
Continue()
 RESPONSE #1
ActionOverride(Player1,DisplayString(Player1,~12~))
Continue()
END

IF
 True()
THEN
 RESPONSE #10
ActionOverride(Player1,DisplayString(Player1,~101~))
Continue()
 RESPONSE #10
ActionOverride(Player1,DisplayString(Player1,~102~))
Continue()
END

IF
 True()
THEN
 RESPONSE #100
ActionOverride(Player1,DisplayString(Player1,~1001~))
Continue()
 RESPONSE #100
ActionOverride(Player1,DisplayString(Player1,~1002~))
Continue()
END

IF
 True()
THEN
 RESPONSE #1000
ActionOverride(Player1,DisplayString(Player1,~10001~))
Continue()
 RESPONSE #100
ActionOverride(Player1,DisplayString(Player1,~10002~))
Continue()
END
>>>>>>>>

EXTEND_TOP ~baldur.bcs~ ~a.baf~

 

results (taken thanks to ToBEx dialogue logging and some quick processing in libre office)

RESPONSE #	  Branch #2 is chosen this % of times:
 1			 0
 10			46
 100		   46
 1000		  10

 

 

Wait, so there is no way to get 2 responses to trigger 50% respectively? It will always be off-balanced?

Link to comment

There are three possible answers to that (from pragmatical to academical):

 

1) Since this is a single-player game and not a nuclear weapon, 46% is as good as 50%.

2) I've heard that using RandomNum() gives you the desired chance, rather than an approximation thereof (a quick experiment seems to confirm this).

3) I ran a single experiment with ~80 values, getting 46% instead of 50% is within statistical tolerance.

Link to comment
There are three possible answers to that (from pragmatical to academical):

 

1) Since this is a single-player game and not a nuclear weapon, 46% is as good as 50%.

2) I've heard that using RandomNum() gives you the desired chance, rather than an approximation thereof (a quick experiment seems to confirm this).

3) I ran a single experiment with ~80 values, getting 46% instead of 50% is within statistical tolerance.

 

Oh! ok, I misunderstood, thank you.

Link to comment
If you haven't seen this before I've got two different endings to the script block, both with the same WEIGHT so in theory they'll be equally likely to happen.

It's RESPONSE #X, not WEIGHT #X. Also, two actions with the same RESPONSE # aren't equally probable - you need to use RandomNum() and friends for that.

 

Eugh, I knew my "off the top of my head" code looked wrong. Damn you, brain...

Link to comment
Guest Guest
<SNIP>

 

COPY ~Beibeu\W@BEI.CRE~ ~override\W@Beibeu.CRE~
WRITE_EVALUATED_ASCII DIALOG		  ~w@beibeu~ #8
WRITE_EVALUATED_ASCII DEATHVAR		~w@beibeu~ #32
WRITE_EVALUATED_ASCII SCRIPT_OVERRIDE ~w@beibeu~ #8
SAY NAME1 ~Beibeu~
SAY NAME2 ~Beibeu~

Newbie question, but why use WRITE_EVALUATED_ASCII instead of just WRITE_ASCII?

Link to comment

I have another problem, but this one doesn't make any sense that I can see. I'm getting a parse error in my TP2 file on this line:

EXTEND_TOP ~AR0313.bcs~ ~Gwen/AR0313.baf~

it says the error is in column 1-30, which would be:

EXTEND_TOP ~AR0313.bcs~ ~Gwen

does anyone know why its giving me the error?

Link to comment
I have another problem, but this one doesn't make any sense that I can see. I'm getting a parse error in my TP2 file on this line:

EXTEND_TOP ~AR0313.bcs~ ~Gwen/AR0313.baf~

it says the error is in column 1-30, which would be:

EXTEND_TOP ~AR0313.bcs~ ~Gwen

does anyone know why its giving me the error?

 

Are you missing a closing tilde on the previous line?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...