Axl Trauts
Member
Hi all,
I am trying to start with loading some equipment on my ship on a hangar. How should it work? Basically, the player has a ship divided in sections: Wing slot 1, wing slot 2, body, extra and special. The player starts buying those equipment from a shop and then load them on each slot, only one can be loaded on each section of the ship.
Now, every equipment is stored on a global 2d array using this example extract:
From the obj_global_starter controller:
Maybe column 3 is not needed but I still put it. column 1 tells if I bought it or not.
Now there is another table... I mean... array for the slot selection on the hangar:
From the obj_global_starter controller:
Now on the Hangar Object I´d like to put a big ship sprite divided in sections, where I can click on each section, and choose the valid equipment for that section from a drop-down menu or something useful, for example if I click on Wing2, I can see "Misil", but if I click on Body, Misil shouldn´t be listed. When I select Misil, its name will be stored on that slot
(Works like a foreign key)
I don´t know how to do the drop-down list but I have the way to filter it using the slot name on global.ar_inventory[i,5], or something that works like that, can you give me examples?
I am trying to start with loading some equipment on my ship on a hangar. How should it work? Basically, the player has a ship divided in sections: Wing slot 1, wing slot 2, body, extra and special. The player starts buying those equipment from a shop and then load them on each slot, only one can be loaded on each section of the ship.
Now, every equipment is stored on a global 2d array using this example extract:
From the obj_global_starter controller:
Code:
// 0=Name, 1=Quantity, 2=Max quantity, 3=Initial Qty, 4=Sprite
global.ar_inventory[5,0] = "Misil"; // Missile
global.ar_inventory[5,1] = 0; // Macro: M_MisilQty
global.ar_inventory[5,2] = 2;
global.ar_inventory[5,3] = 0;
global.ar_inventory[5,4] = spr_itm_misil;
global.ar_inventory[5,5]="Wing2"; // Section on the ship it can be installed
Now there is another table... I mean... array for the slot selection on the hangar:
From the obj_global_starter controller:
Code:
global.ar_equipo[0,0]="Wing1"; // Ship section
global.ar_equipo[0,1]=""; // Selected equipment
global.ar_equipo[1,0]="Wing2";
global.ar_equipo[1,1]="";
global.ar_equipo[2,0]="Body";
global.ar_equipo[2,1]="";
global.ar_equipo[3,0]="Special";
global.ar_equipo[3,1]="";
global.ar_equipo[4,0]="Extra";
global.ar_equipo[4,1]="";
Code:
global.ar_equipo[1,1]=global.ar_inventory[i,0];
I don´t know how to do the drop-down list but I have the way to filter it using the slot name on global.ar_inventory[i,5], or something that works like that, can you give me examples?