some background info. I have a ds_list of global.current_inventory, and global.inventory_amount
global.current_inventory is set up like this:
0 - pistol
1 - shotgun
2 - machine gun
3 - ak47
4 - lol
5 - mystery item
6 - heehee.
now i'm basicly making a simple inventory system, and I was trying to get it to do simple scrolling, showing values of 5 variables that handle which items in the inventory should be shown. draw_primary[4] is the variables. heres the mystery code:
...
else
{
var it;
it=cursor_pos;
draw_primary[0] = ds_list_find_value(global.current_inventory,it-2)+ " "+ string(ds_list_find_value(global.inventory_amount,it-2));
draw_primary[1] = ds_list_find_value(global.current_inventory,it-1)+ " "+ string(ds_list_find_value(global.inventory_amount,it-1));
while( (it < cursor_pos + 3) and it < max_inventory)
{
draw_primary[it-(it-2)] = ds_list_find_value(global.current_inventory,it)+ " "+ string(ds_list_find_value(global.inventory_amount,it));
it+=1;
}
}cursor_pos is where the cursor is. basicly everything works fine, except that for some odd reason that I can't pinpoint, draw_primary[2] is equal to cursor_pos + 2 everytime. so for example, following the list i showed earlier, when the cursor is at 'machine gun', this is what is shown:pistol - value shotgun - value lol - value ak47 - value lol - valueas you can see, the 1st lol, should be machine gun. Any one have an idea where I went wrong? Thanks in advance,
Kennypu
EDIT:
FIXED, i was just over complicating things :3



Find content
Not Telling

