- Joined
- Mar 17, 2007
- Messages
- 282
-Issue resolved
-Answer = Multi-Dimensional Array
-Answer = Multi-Dimensional Array
Last edited:
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
What numbers are you trying to get into the array ?
For each (Integer TempIntegerArray[1]) from 0 to 2, do (Actions) <--- Loops 3x

Loop - Actions


Set TempIntegerArray[1] = (TempIntegerArray[1] + 1) <--- Inside the Loop
For each (Integer tempInt) from 1 to 3, do (Actions) <--- Loops 3x

Loop - Actions


Set TempIntegerArray[tempInt] = tempInt <--- Inside the Loop
For each (Integer tempInt) from 1 to 3, do (Actions) <--- Loops 3x

Loop - Actions


game - display message Integer to string ( TempIntegerArray[tempInt] )
The above will display 1 2 3.
Show the full trigger.
If that is in a loop though you have to change the 2 number 1s to the looping integer.
What mine does is this
For each (Integer tempInt) from 1 to 3, do (Actions) <---- Why was the Array removed?
Loop - Actions
Set TempIntegerArray[tempInt] = tempInt <---- Why are you storing in the Array and not the Integer?
Set TempIntegerArray[1] = 1
Set TempIntegerArray[2] = 2
Set TempIntegerArray[3] = 3
Set TempIntegerArray[1] = 100
Set TempIntegerArray[2] = 12
Set TempIntegerArray[3] = 1
AIMING FOR
FINAL
For each (Integer TempIntegerArray[1]) from 1 to 3, do (Actions) <---- Is there a reason not to use the Integer instead of the Array that I'm unaware of?
Loop - Actions
Set TempIntegerArray[1] = TempIntegerArray[1] <---- I need it stored in the Integer not the Array
For each (Integer TempIntegerArray[1] <---- Need
Loop - Actions
Set StoreIntegerHere[NotHere] = StoreIntegerHere[NotHere] <---- I need it stored in the Integer not the Array
StoreIntegerHere[NotHere]
That is adding to the variable in the array with index of 1 in your example.+1 <---- This is adding to the Array? I was told otherwise
Set ExampleArray[TempIntegerArray[1]] = Example 1
Set TempIntegerArray[1] = (TempIntegerArray[1] + 1) <--- This adds to the Array?
Set ExampleArray[TempIntegerArray[2]] = Example 1 <--- Array goes from 1 to 2 ?
Example 1 doesn't mean anything to me so I have no idea what you are referring to.
You never really explain what you are trying to do but. I think you are trying to store AbilityRed 1, AbilityGreen 2, AbilityBlue 3 into the array using a loop.
This is not possible. To store anything into an array using a loop you need to use a formula.
// It starts as zero.
Set IntegerArray[1] = 0
Set IntegerArray[1] = (IntegerArray[1] + 1)
Game - Display message Integer to string IntegerArray[1]
// The message will display 1 not 0
Then you need to do what I said in post #10
Events

Unit Dies
Conditions
Actions

Set TempTriggerPlayer = triggering player.

Set TempInteger1 = (Player number of TempTriggerPlayer) * 2 + 1

Set TempInteger2 = (TempInteger1 + 1)

Set IntegerArray[ TempInteger1] = IntegerArray[ TempInteger1] + 1

Set IntegerArray[ TempInteger2] = IntegerArray[ TempInteger2] + 1

Set TempTriggerPlayer gold to IntegerArray[ TempInteger1]

Set TempTriggerPlayer lumber to IntegerArray[ TempInteger2]
Set TempInteger1 = (Player number of TempTriggerPlayer) * 2 + 1
Set TempInteger1 = (Player number of TempTriggerPlayer) * 2 + 2
Set TempInteger2 = Set TempInteger1 + 1
A multidimensional array is not anything that you have explained yet.