Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Dave Thaler

Registered:
Posts: 452
Reply with quote  #1 
The mission-file-docs.txt file says:
Quote:
Starting with Version 2.5.102, all text in scripts comes with built-in variable formatting.  Any place in a script, like:
<log text="This is text." />
can now have formatted variables placed inside them, using the 'escape' character, '^' (also called a carat).  Like:
<log text="This is text.  Variable Bob = ^Bob^" />


However, I haven't been able to get that to work in 2.6, it just displays the string literally without replacing it with the variable value.  I've tried with both int and float variables.  Did the escape character change?
Xavier Wise

Registered:
Posts: 1,056
Reply with quote  #2 
Try and use the 'vertical bar' to bracket the variable name, e.g.

log text="This is text |variablename|"

This works in the mission script when you want to add a variable into comms messages. Perhaps it will also work here for the log text.

__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community website
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,241
Reply with quote  #3 
Dave, you have found a documentation error. In an unreleased version of Artemis 2.6 the carat was the symbol to use, but testing revealed that the carat had other uses which could not be reconciled. Thom changed it to the vertical bar and the problem was solved. Apparently the documentation didn't get that update.

The |variablename| syntax should work in log files, Comms messages, big messages on the Main Screen, and Ship_text fields for Science scans and Hailing responses. It probably works in Warning Pop-ups but I haven't used it for that myself.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Dave Thaler

Registered:
Posts: 452
Reply with quote  #4 
Quote:
Originally Posted by Mike Substelny
Dave, you have found a documentation error.


Thanks, I confirmed that '|' works and updated wiki accordingly.  Also added it to the list in the "2.6.0 Bugs and Issues" topic.
Shadowrgamer

Registered:
Posts: 12
Reply with quote  #5 
I know this is an old thread, but did not find this answer anywhere. Since it dealt with the topic here I just replied rather than start a new post. 

I tried to just display a Variable as a popup and then as a comms message for some testing purposes and kept getting an bad var error. 
After a while of searching and trying various spellings etc, thinking I had hit a reserved word somehow, I then put the word "test" in front of the variable and it worked perfectly.  


Darrin

Registered:
Posts: 86
Reply with quote  #6 
I think I've run into this before. You can't start a text message or pop-up box with a variable or a "|" character. However, if you put a normal text character in front of it, such as a space, it should work.

If it's really important to not have a space in front of a variable, I think you can edit the mission file in a text editor (I use notepad) and add "&#x9;" in front of the variable. This is the hex code for "horizontal tab". When you open the file up with the mission editor, it converts &#x9; into a non-displayable character. You can also use &#x9; as the name of a generic mesh if you want something that doesn't display a name to the Science console. 


 
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.