Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Black Wolf on June 18, 2005, 10:52:22 am

Title: Call me a newb again, but...
Post by: Black Wolf on June 18, 2005, 10:52:22 am
Can someone explain how any given string variable can be greater than any other given string variable? What determines relative size? I mean... they're words. They have no assigned values...AFAIK...
Title: Call me a newb again, but...
Post by: karajorma on June 18, 2005, 10:56:16 am
I'd imagine that it works based on alphabetical order. Something before it in the alphabet is less while something afterwards is more.

Again something I need to test :)
Title: Call me a newb again, but...
Post by: TopAce on June 18, 2005, 11:04:47 am
I think the variable(x) < variable(y) SEXP tree is the same as false OR true

I am not sure though, logically it shold be neither. It should not even exist.
Title: Call me a newb again, but...
Post by: Black Wolf on June 18, 2005, 11:07:39 am
Hmmm... String is greater than Sting, which would seem to support that.

TBH, string variables seem kind of useless. I can see where the advantage might come in for storing ships names and such, but I can;t think of anywhere where numerical variables wouldn't suffice.
Title: Call me a newb again, but...
Post by: TopAce on June 18, 2005, 11:09:06 am
For randomising, let's say message senders, it could be used. Of course it can also be done with numerical variables, but it's longer.
Title: Call me a newb again, but...
Post by: Black Wolf on June 18, 2005, 11:13:01 am
Quote
Originally posted by TopAce
For randomising, let's say message senders, it could be used. Of course it can also be done with numerical variables, but it's longer.


Variables in your messages screws up voice acting though. Of course, for unvoiced missions it's no problem.
Title: Call me a newb again, but...
Post by: TopAce on June 18, 2005, 11:16:49 am
But if you want only one of four freighters send you messages all through the mission, you can only have one voice, unless you want one or both of the other two send voice-acted messages.
Title: Call me a newb again, but...
Post by: Black Wolf on June 18, 2005, 11:36:29 am
Quote
Originally posted by TopAce
But if you want only one of four freighters send you messages all through the mission, you can only have one voice, unless you want one or both of the other two send voice-acted messages.


True I suppose. Still - it can still be done with numerical variables, so the point stands. :)
Title: Call me a newb again, but...
Post by: karajorma on June 18, 2005, 12:14:04 pm
Quote
Originally posted by Black Wolf
TBH, string variables seem kind of useless. I can see where the advantage might come in for storing ships names and such, but I can;t think of anywhere where numerical variables wouldn't suffice.


String variables are incredibly useful when you have to pass the argument from a when-argument or every-time-argument to another event.

An example if for instance if you want to have one ship in a mission be a traitor. Using string variables you can now pick a random ship using when-argument/random-of and then have every other event supply the traitor ships name via a string variable.

There's other examples of how I used it here (http://www.hard-light.net/forums/index.php/topic,31462.0.html) and here (http://www.hard-light.net/forums/index.php/topic,32140.0.html).