[HELP] Using variables in a string or text message.

AaronPwner

Member
Reaction score
0
[SOLVED] Using variables in a string or text message.

I am practicing triggers before trying to create a map, and am making a quest that can vary from game to game (You need to get a fruit for the "king" but the "Fruit" can vary between 5 different choices).

But what I can't figure out is how to display my fruit choice in the text message, as it is ordered into arrays.

My current (problem part, not all of it!) code is:

Trigger:
  • ...
    • Set FruitChoice = (Random integer between 1 and 5)
    • Quest - Display to (All players) the Quest Update message: (|cffffcc00The King wants you to collect: + FruitsArray[(FruitChoice)])|r
    • ...


However it comes out as displayed with the whole FruitsArray jazz, how can I make it so it only displays the number in the array?
 

cleeezzz

The Undead Ranger.
Reaction score
268
are you using concatenated strings? that looks like jass syntax where + means concatenated strings.
 

AaronPwner

Member
Reaction score
0
Nope, just that quest message..


E: I have absolutely no idea how to do it, what I already have there is just a guess.
 

cleeezzz

The Undead Ranger.
Reaction score
268
you need to go down to concatenated strings until it says

String 1 + String 2

click string 1 and enter The king wants to blah balhbalh and then click string 2 and scroll through the variables to find your fruit thing
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top