Author Topic: Fun with Variables...  (Read 2024 times)

0 Members and 1 Guest are viewing this topic.

Offline Axem

  • 211
Fun with Variables...
'Elo, here's a diddly of a pickle for anyone. In a upcoming mini-campaign I'm working on, I want a portion of a mission to be random. Depending on some variable generated, I want a different ship to appear.

Eg:
If the variable is 1, send a Fenris
if 2, send an Orion
if 3, send a Deimos

However, Fred doesn't use if statements like that. Any ideas how to acheive something like this? :confused:

I give you a cooooookie... ;)

 

Offline Singh

  • Hasn't Accomplished Anything Special Or Notable
  • 211
  • Degrees of guilt.
assign a random number to a variable. Then set the arrival cue of the fenris to come in if the variable is 1; the orion to come in if its two and the Diemos to come in if its 3.
"Blessed be the FREDder that knows his sexps."
"Cursed be the FREDder that trusts FRED2_Open."
Dreamed of much, accomplished little. :(

 

Offline Axem

  • 211
But how? rand only effects an existing number. I thought about going...

event name
- true
- +
-- rand
--- 1
--- 3
-- variable(0)

However, Fred won't let me use the + operator by itself.

 

Offline Spicious

  • Master Chief John-158
  • 210
Try this:

when
-true
-modify-variable
--variable(0)
--rand
---1
---3

  

Offline Axem

  • 211
Yes... of course... :nervous:

I blame Fred for hiding the modify variable sexp in the special group...