E
Emberex
Guest
I'll explain this the best I can.
I have "humans" to spawn around a main hall and walk around.
If a "lumberjack" building is in existence, they will turn into a new object called the lumberjack. Then walk to the building and stay around it.
My issue is that when I place multiple buildings, they all walk toward the same one. I have tested and found that the buildings are separately becoming occupied, but they still walk toward the first one.
How can I make them walk to the one that they occupied?
(The code that turns them into the lumberjack)
if obj_human_guild.active_lumberjacks < instance_number(obj_build_lumberjack) {
obj_build_lumberjack.vacant = false;
obj_human_guild.active_lumberjacks++;
instance_change(obj_lumberjack, true);
}
(The code that tells whether the build is occupied)
vacant = true;
lumberid = instance_number(obj_build_lumberjack);
let me know if you need something extra
I have "humans" to spawn around a main hall and walk around.
If a "lumberjack" building is in existence, they will turn into a new object called the lumberjack. Then walk to the building and stay around it.
My issue is that when I place multiple buildings, they all walk toward the same one. I have tested and found that the buildings are separately becoming occupied, but they still walk toward the first one.
How can I make them walk to the one that they occupied?
(The code that turns them into the lumberjack)
if obj_human_guild.active_lumberjacks < instance_number(obj_build_lumberjack) {
obj_build_lumberjack.vacant = false;
obj_human_guild.active_lumberjacks++;
instance_change(obj_lumberjack, true);
}
(The code that tells whether the build is occupied)
vacant = true;
lumberid = instance_number(obj_build_lumberjack);
let me know if you need something extra