Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Axem on August 29, 2004, 10:09:24 pm
-
'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... ;)
-
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.
-
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.
-
Try this:
when
-true
-modify-variable
--variable(0)
--rand
---1
---3
-
Yes... of course... :nervous:
I blame Fred for hiding the modify variable sexp in the special group...