Members | Sign In
All Forums > Mission Scripting
avatar

Dealing with variable text... Is there an easy way?

posted May 04, 2013 05:03:29 by badgeguy
Oh brilliant and creative scripters,

I am trying to create variable text for comms traffic in a mission. Unfortunately, what I need is only a word or two changing in the bulk of the message. Is there a way to concatenate text between two variables? Is there a way to store text in a variable? Is there a way to inject a variable into an 'incoming_message' from/text attribute/value? (e.g. "Ensign 'Random Name' from the 'Random Ship Name' has the 'Random Device Name' for 'Random Ship Name'").

Unfortunately, it appears that without it I would have to create 2.3 Quintillion conditions for the messages. Any previous experience with this issue? Any suggestions?

Thank you very much.

Rusty
page   1
6 replies
avatar
lucas99801 said May 04, 2013 23:28:45
To my knowledge none of what you are asking is available as only numbers can be stored i. Variables. Even booleans take the form of 0/1
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
Mike_Substelny said May 06, 2013 13:39:30
I do not believe that you can have a variable in a text message at this time. The work around is to write a different version of the message for every possible value that it could include.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
badgeguy said May 06, 2013 19:04:15
Thanks Mike and lucas,

I don't think that 2.3 quintillion lines of code will cut it though. But I realized that my math was bad on the computation of combinations and it is only about 1200+ combinations, but still, 1200+ event combinations just for a text statement is a bit much. Hopefully 2.0's mission scripting will allow for variable text.

Rusty
avatar
lucas99801 said May 06, 2013 22:53:47
excel is fantastic for automating code generation
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
badgeguy said May 07, 2013 00:30:23
lucas,

Thanks for the tip. I was considering using it for chunks of my code. I am just wonder, how much is too much for Artemis to handle as far as an XML mission file is concerned? I am currently at nearly 100KB in size and I have not even started on the communications modules. Does anyone have an upper limit they have reached, or a point at which performance begins to suffer? Thanks.
avatar
lucas99801 said May 07, 2013 01:27:36
By my understanding performance only depends on the number of running timers/loops/create events.

To expand on that statement, all code is static until called upon. So if you have a single random variable event that rolls for a comms message, the difference between 5 and 500 outcomes is insignificant in regards to performance.

Like with my jump drive, inserting a jump drive with 360 possible directions had the same impact as inserting one with 8. Because you're only accessing one of the blocks. If you accessed all 360 at the same time, you'd experience a slowdown.

but since your comms messages will have a unique identifier, only one will be requested at any given time if your conditions are set right.

feel free to contact me directly @icloud.com if you need further explanation as the forums keep dropping out on me.
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
Login below to reply: