Staredit Network > Forums > SC2 Assistance > Topic: Array index arithmetic problems
Array index arithmetic problems
May 3 2010, 12:51 am
By: LostInMyself  

May 3 2010, 12:51 am LostInMyself Post #1



I am trying to do arithmetic in an array index and it does not work. I'm assuming an index is an integer.
The array variable is a unit type if it matters and I'm trying to add 1 to an integer in the index of said array.
Any suggestions?



None.

May 3 2010, 5:46 am ZeroAme Post #2



Can you show the trigger and variables your doing it with so we have a better idea of what you mean?



None.

May 3 2010, 2:14 pm LostInMyself Post #3



I have two global variables one is called unitArray[20] and is a unit type array.
The second one is unitArrayIndex and is an integer type.

The trigger is

Event - Any unit construction is completed

Local Variables - None
Conditions - None

Actions - Set unitArray[(unitArrayIndex + 1)] = (Triggering progress unit)



None.

May 3 2010, 8:00 pm Swampfox Post #4



Perhaps modifying a variable OUTSIDE of the array index (Lets call it ArrayIndex :)), and then using that variable instead? Just a thought.



None.

May 3 2010, 8:11 pm ZeroAme Post #5



What is the arry by default? if it 20 by default then it wont add anything because its already at its max.

I'll play around with this in GE and see what I come up with.

Edit: is unitArrayIndex an array?

Post has been edited 2 time(s), last time on May 3 2010, 8:22 pm by ZeroAme.



None.

May 4 2010, 4:28 am LostInMyself Post #6



Quote from Swampfox
Perhaps modifying a variable OUTSIDE of the array index (Lets call it ArrayIndex :)), and then using that variable instead? Just a thought.

After playing around for awhile I eventually came up with this and it does work.
It's just odd that you can't do arithmetic in an array index.

Quote from ZeroAme
What is the arry by default? if it 20 by default then it wont add anything because its already at its max.

I'll play around with this in GE and see what I come up with.

Edit: is unitArrayIndex an array?

unitArrayIndex is not an array and it's default is 0
The array is defaulted to a 20 slot array with 0 (assuming) in each slot.
Even though I solved my problem I would like to figure out why this does not work.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[02:47 am]
Symmetry -- I'll check it out this weekend!
[02:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[02:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[01:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[01:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[01:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
[01:31 am]
Ultraviolet -- Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Is it forbidden to have a large avatar?
actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
[12:20 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: https://staredit.net/profile/133367/ dude's avatar is massive
Is it forbidden to have a large avatar?
[12:04 am]
Ultraviolet -- https://staredit.net/profile/133367/ dude's avatar is massive
Please log in to shout.


Members Online: UndeadStar, Ultraviolet