Rank System Attempt - Array[1[1]] = Array[1]?

esb

Because none of us are as cruel as all of us.
Reaction score
329
So I'm making a rank system for non-hero units. It's MPI

Basically I have set the rank names, "exp required" to gain rank, and rank levels.

I have
Trigger:
  • Exp_CurrentPoints[(Player number of (Owner of (Killing unit)))] Greater than or equal to Exp_TotalNeeded[Exp_CurrentRankLvl[(Player number of (Owner of (Killing unit)))]]


Exp_CurrentPoints is the "Experience" of the unit. Which is gained for every kill. It gains experience fine.
Exp_TotalNeeded are the exp per level needed.
For example,
Trigger:
  • Set Exp_TotalNeeded[0] = 0
    • Set Exp_TotalNeeded[1] = 200
    • Set Exp_TotalNeeded[2] = 500

Exp_CurrentRankLvl is the Level of the unit.
The unit (In the map) is "caught/converted/whatever you want to call it".
When it's caught, it is automatically set to Lvl 1.

My problem is Exp_TotalNeeded[Exp_CurrentRankLvl[(Player number of etc.)]. It's an array within an array.
I am hoping that it's TotalNeeded[AtLevelOne[(Player 1)]].
It seems that it's TotalNeeded[1[1]] = 0 (By default?)

So, In short, If I set Array[1] = 100
Does that also mean Array [1[1]] = 100? Or would I have to manually set it to 100?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
So, In short, If I set Array[1] = 100
Does that also mean Array [1[1]] = 100??
If I understand you correctly, yes. Your explanation using 1[1] instead of the actual array names is confusing.

It might be easier to think of it this way: A[B[1]] simply uses whatever integer value is stored at B[1] as the index to retrieve from A[].

So, if A[1] = 100,
and B[1] = 1,
then A[B[1]] = 100 already, since B[1] = 1 and A[1] = 100.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
The reason I use Array[1[1]] Is because Array[Level]=Exp
So at lvl 1, it will need 200 exp. Array[1]=200.
But every player is at different level, so Array[Lvl1[Player]]=200
But obviously Array[1[1]] =/= Array[1].
So what I did was
Trigger:
  • For each (Integer A) from 0 to 12, do (Actions)
    • Loop - Actions
      • Set Exp_TotalNeeded[Exp_IntArray[(Integer A)]] = 0
      • Set Exp_IntArray[1] = 1
      • Set Exp_TotalNeeded[Exp_IntArray[(Integer A)]] = 200
      • Set Exp_IntArray[2] = 2
      • Set Exp_TotalNeeded[Exp_IntArray[(Integer A)]] = 500
      • For each (Integer B) from 0 to 15, do (Actions)
        • Loop - Actions
          • Set Exp_IntArray[(Integer B)] = 0

Exp_IntArray being an IntegerArray.
That way Exp_TotalNeeded[0[0-12(For the Players)]]=0
And Exp_TotalNeeded[1[0-12]=200.
It works better, but it sets it to 500 no matter what. So I'm still testing.

EDIT:
Nevermind, not needed no more. I have no Idea why I tried that. Worked out a much simpler solution. xD
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top