K
Kuzyn
Guest
Hey! I'm searching the web for few days now and I can't find proper solution to my problem.
I will post a video with my problem:
I've got an obj_place. I need to enter it and then when I click on obj_sawmill I want to change that one specific obj_place into obj_construction_site. But all of obj_place's changes into obj_construction_site.
My code for obj_sawmill:
I will post a video with my problem:
I've got an obj_place. I need to enter it and then when I click on obj_sawmill I want to change that one specific obj_place into obj_construction_site. But all of obj_place's changes into obj_construction_site.
My code for obj_sawmill:
Code:
if (instance_exists(obj_text_noresources)) //prevent creating many messages at once
{
//nothing
}
else
{
if (obj_game.sawmill == 1 && obj_game.wood_amount >= obj_game.sawmill_wood && obj_game.stone_amount >= obj_game.sawmill_stone) //build if got resources
{
obj_game.sawmill = 0;
obj_game.wood_amount = obj_game.wood_amount - 3;
obj_game.stone_amount = obj_game.stone_amount - 3;
obj_game.place_view = false;
with (obj_place)
{
instance_change(obj_construction_site, true);
}
view_xview = 0;
instance_destroy(obj_place_exit);
instance_destroy();
}
else //if no resources, send msg
{
instance_create(1450, 800, obj_text_noresources);
}
}