| View previous topic :: View next topic |
| Author |
Message |
atraeyu
Joined: 12 Dec 2007 Posts: 4
|
Posted: Wed Dec 12, 2007 9:58 am Post subject: Triggers & Random Actions (3-Part Question) |
|
|
The Basic Scenario: When a player enters the room, 10% of the time I would like to one of several actions.
Trigger Text: $Player arrives. (Example: Gandalf arrives.)
Possible Actions:
1. smile at $player
2. wave at $player
3. cheer
4. jump
Can anyone instruct me how to do this? Thanks. |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Wed Dec 12, 2007 11:04 am Post subject: |
|
|
The following should work, and give each social 25% chance of triggering:
| Code: |
#act {%0 arrives.^}
{
#if {1d4 == 1} {smile %0}
#if {1d3 == 1} {wave %0}
#if {1d2 == 1} {cheer}
#if {1d1 == 1} {jump}
}
|
Notice there are no ;'s used to separate the if checks, so they're nested. 1d4 rolls a 4 sided dice, so there's 25% chance of rolling a 1. |
|
| Back to top |
|
 |
|