Initializing Arrays

Kitt

New Member
Reaction score
5
I havn't really looked into JASS yet, though I'm sure I could figure it out (I know C++ after all); I simply havn't found the time for it yet, and I can't wait to get working on triggers again =3

At any rate, for whatever reason, you cannot initialize an array under the global variables editor in the GUI with more than a single value. One would think that creating an array would imply you want more than one value stored in it...

At any rate, I currently have a really clumzy function that fills a skill array with each skill manually upon game initialization. I don't like this, and would love a more elagant way to do it. I'm sure JASS could with something like a simply for loop, but I don't know JASS or it's capabilities....

I thank any for their help!
Meow =3
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Are you trying to make different arrays store skills, but have them set to more than one value. Unless you overwrite, which will still not give the effect, I don't think there is a way. If you want to store arrays to skills quicker, I don't think there is a loop possibility in JASS because of the raw coding, and from GUI, the selection is still a problem, so you cant store it through a loop... :D
 

Kitt

New Member
Reaction score
5
Not quite. So, what I have is an array that holds a series of similar skills. The game needs to be able to cycle through them, in order, moving up and/or down the list form one skill to the next. So, when I want to go up a skill I have I remove SkillArray[currentSkill] and give them SkillArray[currentSkill + 1]. Well, sicne the skills are all different, I'm currently manually filling each slot in that array with each skill.

What I'm looking for is a systamatic way to do that. I have each skill named as "Skill00, Skill01, Skill02" etc. So, instead of 12 lines of code, 3 lines. Or, even, just have the Array filled with that without having a trigger doing it. Does anything like this even exist?

Mreow.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
I don't think so, yet again, I still don't quite understand, could you speak in simpler terms less confusing so I can understand?:D
 
L

lordpredator

Guest
i never work with skills variables in MUI... but if they are called skill01 skill02... maybe you can make a concatenate string and convert the string to the skill... if can´t be done that way... you will have to assign each array index a value... manually.

LP
 

Chocobo

White-Flower
Reaction score
409
Not Possible as Duwenbasden said, because each ability has it's own abilityId, which is ever differant, and we can't detect if an ability is a hero one, unit one, or an item one. And according each value to it's index, it's pretty imposible.
Setting 300 values manually, won't make sense, but works the best.
 

Kitt

New Member
Reaction score
5
Eh, not quite what I wanted to hear, but thanks for the info =3 I guess I'll just have to hide them in their own triggers to keep my main initialization looking tidy.

Meow!
 
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