Using LANGUAGE...

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Using LANGUAGE...

Post by ramon.dexter »

Hi all, I returned here and have a brand new question:

How do I use LANGAUGE defined messages in string array?

Here's the sample script:

Code: Select all

script "cornMessage" (void)
{
	int messCornNr;
	messCornNr = random(1,5);

	str messCorn[6] = {	"",
						"$SCN_CORN01", <- this display what is defined -> "$SCN_CORN01", not the string in LANGUAGE
						"$SCN_CORN02",
						"$SCN_CORN03",
						"$SCN_CORN04",
						"$SCN_CORN05"
						};

	if (messCornNr == messCornNr)
	{
		Print(s:messCorn[messCornNr]);
	}

}
It's intended to display scenery messages. Think something like in fallout 1&2. I want to use LANGUAGE lump to ease use of translations. But I don't know how to use it in array - the array is required to make the messages random. But I don't know how to define the LANGUAGE variables into an array. Can anyone help me?

The example here displays only "$SCN_CORN01 - 5".
GiveOneMoreChance
Posts: 19
Joined: Thu Aug 10, 2017 8:09 pm

Re: Using LANGUAGE...

Post by GiveOneMoreChance »

Try use l: instead s:
Print(l:messCorn[messCornNr]);
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Using LANGUAGE...

Post by ramon.dexter »

Yep, it works. Many thanks!! :wub:
Locked

Return to “Editing (Archive)”