Dear GMS-community,
I'm getting to grips with data_structures and don't understand why scenario A does work and scenario B doesn't.
As far as I can tell only the x and y coördinate for the grid AllAgents have been swapped.
(I prefer to have scenario B.)
Scenario A
Scenario B (error: unexpected terminal operator #)
Thanks in advance
I'm getting to grips with data_structures and don't understand why scenario A does work and scenario B doesn't.
As far as I can tell only the x and y coördinate for the grid AllAgents have been swapped.
(I prefer to have scenario B.)
Scenario A
GML:
function AddPropertiesToAgentsList(properties){
ds_grid_resize(global.AllAgents, ds_grid_width(global.AllAgents) + 1, ds_grid_height(global.AllAgents));
for(var i = 0; i < array_length(properties); ++i;) {
global.AllAgents[# ds_grid_width(global.AllAgents) - 1, i] = properties[i]
}
}
GML:
function AddPropertiesToAgentsList(properties){
ds_grid_resize(global.AllAgents, ds_grid_width(global.AllAgents), ds_grid_height(global.AllAgents) + 1);
for(var i = 0; i < array_length(properties); ++i;) {
global.AllAgents[i, # ds_grid_height(global.AllAgents) - 1] = properties[i]
}
}