Two lists of ints (2.61)

Started by R4L, Mon 20/03/2006 20:01:46

Previous topic - Next topic

R4L

Is it possible to create 2 lists, one list with 5 ints(1-5) and the other list of 10 ints(1-10)? I don't know how to code this other than make 10 individual ints and 5 other individual ints. I need this type of structure so I can pick a random number from list one and two, multiply them together and use that value to take away health from enemy or player. Can anyone please help me? Thank you.

Edit: Also, how do I create a small array in AGS 2.61? I've searched but the code for each was questioning to me and I didn;t really understand it too much.


Gilbert

Quote from: Rap4Life42o on Mon 20/03/2006 20:01:46
Edit: Also, how do I create a small array in AGS 2.61? I've searched but the code for each was questioning to me and I didn;t really understand it too much.

int blah[12];
will make an array of 12 elements starting from blah[0] thru blah[11]. :P

R4L

So I could make two arrays, one with 5 indexes and one with 10, but how would I randomize through the numbers?

strazer

http://www.adventuregamestudio.co.uk/manual/Random.htm

Code: ags

int a[5];
int b[10];

//...

int c = a[Random(4)] + b[Random(9)];

R4L

Awesome! Now, I have to get the players fightingpower and defensepower. Would I use:

GetGlobalInt(1) which equals fightingpower
GetGlobalInt(2) which equals defensepower

Sorry for asking for so much, but I want the player to be able to adjust his stats using up and down arrows(to change numerical value of stats) while updating the code to get different results during battles. Thanks for all the help so far!  :)

SMF spam blocked by CleanTalk