Dear community,
I want to draw a string with 2, 3 or 4 different elements after each other. The elements are in a ds_grid called ds_AllAgents.
I now have this super inefficient bit of code and am wondering what are good ways to make it (way) more efficient.
Thanks in advance for your help.
I want to draw a string with 2, 3 or 4 different elements after each other. The elements are in a ds_grid called ds_AllAgents.
I now have this super inefficient bit of code and am wondering what are good ways to make it (way) more efficient.
Thanks in advance for your help.
GML:
for(i = 0; i < (array_length(global.obj_agent_file)) ; i+=2)
for(l = 1; l < (array_length(global.Achtergrond)) ; ++l)
for(m = 1; m < (array_length(global.Achtergrond)) ; ++m)
for(n = 1; n < (array_length(global.Achtergrond)) ; ++n)
for(o = 1; o < (array_length(global.Achtergrond)) ; ++o)
if(instance_exists(global.obj_agent_file[i])){
if(global.AllAgents[# 4, i/2] = global.Achtergrond[l])
if(global.AllAgents[# 5, i/2] = global.Achtergrond[m])
if(global.AllAgents[# 6, i/2] = global.Achtergrond[0])
{draw_text_ext(240,710,"Background: " + string(global.Achtergrond[l,1]) + ", " + string(global.Achtergrond[m,1]) + ".",15,360);}
if(global.AllAgents[# 4, i/2] = global.Achtergrond[l])
if(global.AllAgents[# 5, i/2] = global.Achtergrond[m])
if(global.AllAgents[# 6, i/2] = global.Achtergrond[n])
if(global.AllAgents[# 7, i/2] = global.Achtergrond[0])
{draw_text_ext(240,710,"Background: " + string(global.Achtergrond[l,1]) + ", " + string(global.Achtergrond[m,1]) + ", " + string(global.Achtergrond[n,1]) + ".",15,360);}
if(global.AllAgents[# 4, i/2] = global.Achtergrond[l])
if(global.AllAgents[# 5, i/2] = global.Achtergrond[m])
if(global.AllAgents[# 6, i/2] = global.Achtergrond[n])
if(global.AllAgents[# 7, i/2] = global.Achtergrond[o])
{draw_text_ext(240,710,"Background: " + string(global.Achtergrond[l,1]) + ", " + string(global.Achtergrond[m,1]) + ", " + string(global.Achtergrond[n,1]) + ", " +string(global.Achtergrond[o,1]) + ".",15,360);}
}