HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variable Question(s)

08-07-2004, 05:09 AM#1
Thrall_89
Ok, I know how variables generally work and all of that good stuff. But I've been having trouble getting two variables to work in my map and was wondering if someone could give me some tips.

The first one is used to store your Hero after you first hire him/her at the start of the game, but for some reason it doesn't seem to store it quite right because some of the triggers used for it kinda get fucked up. So, any suggestions on how to do it right now i have so that once a Hero is sold it stores it as the variable Hero(Integer(Z)).

The other is that for my multiboard the kills update trigger is fucked up too, it keeps track of the number of kills the player has made; but, whenever you make a kill it sets your killcount to the highest number on the board +1.

Thanks so much for your time and I hope someone out there can help me. (Ask if you want me to post the actual trigger itself)
08-07-2004, 05:40 AM#2
RebelDris
Quote:
Originally Posted by Thrall_89
Ok, I know how variables generally work and all of that good stuff. But I've been having trouble getting two variables to work in my map and was wondering if someone could give me some tips.

The first one is used to store your Hero after you first hire him/her at the start of the game, but for some reason it doesn't seem to store it quite right because some of the triggers used for it kinda get fucked up. So, any suggestions on how to do it right now i have so that once a Hero is sold it stores it as the variable Hero(Integer(Z)).

The other is that for my multiboard the kills update trigger is fucked up too, it keeps track of the number of kills the player has made; but, whenever you make a kill it sets your killcount to the highest number on the board +1.

Thanks so much for your time and I hope someone out there can help me. (Ask if you want me to post the actual trigger itself)

Well im not sure about your heros but i know how to make kills on a multiboard.

Make a variable thats an integer and click array and make the array as many players as you have.

event-unit owned by (enemy) is killed
action-set (kills[player number of(owner of(killing unit))) = (kills[player number of(owner of(killing unit))) + 1
set item in multiboard in column (column of player 1) row (row of player 1) to (kills[1])
set item in multiboard......

and so on until you do all the players, what this does is use one integer and makes it an array
Array - a variable that stores more than one number in a single variable

so when u make it player number of owner of killing unit say the killing unit is owned by player 1 well it stores the kills for player one in kills[slot 1] and an array has different slots for different numbers so its like kills[1] kills[2] and so on for however many variables you want to store. I hope you get that.

Good Luck!
08-08-2004, 08:11 AM#3
Anitarf
Code:
For each integer A from 1 to 12 do actions:
  loop - actions:
    set item in multiboard in column 2 row (Integer A) to (kills[(Integer A)])

This is a simple multiboard refresh trigger that refreshes the entire multiboard (provided you have player 1 in row 1, player 2 in row 2 etc...)
08-08-2004, 09:40 PM#4
Thrall_89
Alrighty, thanks both of you, I used a little bit of what both of you posted and got it working correctly. Thanks a million guys (Got a couple other Variable issues fixed now too).