Jump to content
bbaanngg

Creating an array from a stringtable

Recommended Posts

I'm using a stringtable.xml to store text dialogue for my mission. Is there any way to create an array of all keys within a container? For instance, if I have something like this:

<Package name="Dialogue">
	<Container name="Greeting">
		<Key ID="STR_Greeting1">
			<Original>Hello.</Original>
		</Key>
		<Key ID="STR_Greeting2">
			<Original>Hi.</Original>
		</Key>
	</Container>

I want to make a function that will create an array of all the keys inside the "Greeting" container in an sqf file. Something like this: _greetigns = ["STR_Greeting1", "STR_Greeting2"]; so that I can localize them and use them in order. Is there any way to do this?

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/22/2020 at 10:44 AM, Dedmen said:

https://regexr.com/


ID=(\"[^"]*\")

 


$1,

 

I was hoping there would be a way to do it within arma but figured there wouldn't be. Thanks for this though, will save a lot of time!

Edited by Dedmen
Removed images. Rule 14

Share this post


Link to post
Share on other sites
On 5/23/2020 at 9:51 PM, bbaanngg said:

I was hoping there would be a way to do it within arma but figured there wouldn't be.

Oof. You can loadFile the stringtable.xml, but you would have to write the parsing/searching code in SQF then... Which is a bit of work and not something I can just present you on a silver plate.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×