7
7bones
Guest
Hi.
I have activate/deactivate code for optimise my game
All works in alarm event of player
"
if (global.processing=false){
instance_deactivate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892,false, true);
instance_activate_object(obj_checkpoint_saver)
instance_activate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892, true);
alarm[7]=30
}
if (global.processing=true){instance_activate_region(view_xview[0] , view_yview , view_wview[0] , view_hview[0] ,false)
"
It works very good and make stable 60fps with a lot of objects in room
But here is problem.Save and load system.
When player touch checkpoint place
In obj_checkpoint collision with player event (examle script,all info are saved there also)
"
global.processing=true
instance_activate_all()
with obj_blood_parent {event_user(0)} /////makes obj_blood_parent.save=true
"
When player dies :
"
global.processing=true
instance_activate_all()
with obj_blood_parent {event_user(1)} /////if obj_blood_parent.save=false it destroy self
"
This type I used to all (blood_parent is only example) variables and objects
Problem is instance_activate_all() not working, also instance_activate_region(view_xview[0] , view_yview , view_wview[0] , view_hview[0] ,false) not working and even instance_activate_object is not working.
Event_user(0) when save works ONLY when objects are in range of activate_region of player,cannot activate it .I can do
"
if (global.processing=false){
instance_deactivate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892,false, true);
instance_activate_object(obj_checkpoint_saver)
instance_activate_obj(obj_blood_parent)
instance_activate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892, true);
"
And then works fine- but that is not optimization,getting slow very fast...
Where i made something wrong??
I have activate/deactivate code for optimise my game
All works in alarm event of player
"
if (global.processing=false){
instance_deactivate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892,false, true);
instance_activate_object(obj_checkpoint_saver)
instance_activate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892, true);
alarm[7]=30
}
if (global.processing=true){instance_activate_region(view_xview[0] , view_yview , view_wview[0] , view_hview[0] ,false)
"
It works very good and make stable 60fps with a lot of objects in room
But here is problem.Save and load system.
When player touch checkpoint place
In obj_checkpoint collision with player event (examle script,all info are saved there also)
"
global.processing=true
instance_activate_all()
with obj_blood_parent {event_user(0)} /////makes obj_blood_parent.save=true
"
When player dies :
"
global.processing=true
instance_activate_all()
with obj_blood_parent {event_user(1)} /////if obj_blood_parent.save=false it destroy self
"
This type I used to all (blood_parent is only example) variables and objects
Problem is instance_activate_all() not working, also instance_activate_region(view_xview[0] , view_yview , view_wview[0] , view_hview[0] ,false) not working and even instance_activate_object is not working.
Event_user(0) when save works ONLY when objects are in range of activate_region of player,cannot activate it .I can do
"
if (global.processing=false){
instance_deactivate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892,false, true);
instance_activate_object(obj_checkpoint_saver)
instance_activate_obj(obj_blood_parent)
instance_activate_region(view_xview[0] - 428, view_yview - 428, view_wview[0] + 892, view_hview[0] + 892, true);
"
And then works fine- but that is not optimization,getting slow very fast...
Where i made something wrong??