Jump to content

Random scripting actions


berelinde

Recommended Posts

How do you make it so that sometimes one thing happens, sometimes, something else happens. I'm fairly sure it's a function of the RESPONSE #100 line, but I'm not sure how it works.

 

If I wanted a weighted random chance, would this work?

 

IF

Conditions

THEN

RESPONSE #70

Action A

RESPONSE #30

Action B

END

 

Would Action A happen 70% of the time and Action B 30%?

 

Also, what is the deal with RESPONSE #200, RESPONSE #300, etc?

 

Thanks.

Link to comment
Guest Guest_Nythrun_*

Response #100 is just an arbitrary convention; RESPONSE #400 a bunch of times will still give you equal weights (well, equal inasmuch as the RNG is suspect).

 

What you're doing is fine :)

Link to comment

To expand on what Nythrun is saying,

IF
Conditions
THEN
RESPONSE #200
Action A
RESPONSE #200
Action B
RESPONSE #200
Action C
RESPONSE #200
Action D
RESPONSE #200
Action E
RESPONSE #200
Action F
END

is supposed to put equal weight on each; there are some posts by the modding gurus that indicate that while it is supposed to be random, for some reason the first response shows up "more radomly" - apparently, to the game engine, all pigs is equal, just some pigs is more equal than uthurs :)

Link to comment

Thanks for the complete responses!

 

I understand that it doesn't always have to be #100, or that assigning multiple values that are all equal will not produce results that are any less random than otherwise would be the case.

 

If I'm understanding correctly, then #70 and #30 would be more or less 70% the first, with taking game quirkiness into account.

Link to comment

Archived

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

×
×
  • Create New...