V
vinceprinceking
Guest
Edit 26.09.2016:
Questions 1-6 solved, thx for all the help guys, really appreciate it.
Questions 7-11 still clueless here, pls help me
Original Post:
Hi guys i'm using game maker for a few days and still in the process of learning. Thanks in advance for solution to my questions:
Edit: 26.09.2016
great thanks and here are the next questions:
Questions 1-6 solved, thx for all the help guys, really appreciate it.
Questions 7-11 still clueless here, pls help me
Original Post:
Hi guys i'm using game maker for a few days and still in the process of learning. Thanks in advance for solution to my questions:
1. can you destroy a specific instance from within another object? something like (instance_id).instance_destroy() doesn't work.
My solution is to have a step event inside the object i wanna destroy with: "if (variable_destroy) instance_destroy();" and i set the "(instance_id).variable_destroy = true" inside the other event. But this means several hundreds of instances are all running this step event nonstop which seems quite unnecessary.
2. How does the Parent-Ancestor relationship work? If you for example check "id =instance_place(x,y, o_Parent)" does GameMaker check for Ancestor instances too? If not can you somehow make him do that?
3.if the instance_place() would in theory get more than one instance at the same time, how is it possible to get all ids and store them in an array or something.
4. In the following code i try to see if some obj o_Parent_Usable or some of its Childs is on a certain position, afterwards i want to do specific if its o_Child1 o_Child2 o_Child3 and so on. Am i doing it right? code isnt working right now. any suggestions? Or do i have to check for postion_meeting for every child on its own?
Code:
if position_meeting(x+xx,y+yy,o_Parent_Usable){
var ID_Of_Instance = instance_position(x+xx,y+yy,o_Parent_Usable);
if object_get_name(ID_Of_Instance) == "o_Child" {
scr_DoStuffwith(ID_Of_Instance)
}}
5. can i save a room-id in a varable so i can teleport back later?
6. can i toggle persistence of a room on and off with code?
My solution is to have a step event inside the object i wanna destroy with: "if (variable_destroy) instance_destroy();" and i set the "(instance_id).variable_destroy = true" inside the other event. But this means several hundreds of instances are all running this step event nonstop which seems quite unnecessary.
2. How does the Parent-Ancestor relationship work? If you for example check "id =instance_place(x,y, o_Parent)" does GameMaker check for Ancestor instances too? If not can you somehow make him do that?
3.if the instance_place() would in theory get more than one instance at the same time, how is it possible to get all ids and store them in an array or something.
4. In the following code i try to see if some obj o_Parent_Usable or some of its Childs is on a certain position, afterwards i want to do specific if its o_Child1 o_Child2 o_Child3 and so on. Am i doing it right? code isnt working right now. any suggestions? Or do i have to check for postion_meeting for every child on its own?
Code:
if position_meeting(x+xx,y+yy,o_Parent_Usable){
var ID_Of_Instance = instance_position(x+xx,y+yy,o_Parent_Usable);
if object_get_name(ID_Of_Instance) == "o_Child" {
scr_DoStuffwith(ID_Of_Instance)
}}
5. can i save a room-id in a varable so i can teleport back later?
6. can i toggle persistence of a room on and off with code?
Edit: 26.09.2016
great thanks and here are the next questions:
7. so in the following code n returns true? so a Variable always returns true if its not -4, noone, 0 ??? Or is it just with Instance IDs? How exactly does that work?
[QUOTE="TheouAegis, post: 58913, member: 1973"
var n = instance_position(x+xx,y+yy,o_Parent_Usable);
if n scr_DoStuffWith(n);
[/QUOTE]
8. I know i can make a script return a boolean or a variable value. Can i make it return more than one? My solution would be to make a big string with ";" in between values, then make some script in a loop return values out of the string again. Is there a better solution?
9.Also what commands to get values back out of strings in general?
10. I got this Array right now where i store Item specific stuff like: "Name" (string), "Able_To_Pickup" (boolean), "MaxItemInPossesion" (int), "Able_To_Gift" (boolean)..., or if i had one for each specific NPC where all his "important" Values get stored. Where should i store Data like that, and Controller_Object, an .ini file, globals, and so on? I'm not talking about saving, just storing while the game runs. Are there rules when to use what and what is the most suited?
11. I have some screen tearing / flickering issues whith my pixel art when moving (speed doesnt matter):
I'm moving in round pixel steps with my o_View (fiew centered arround that)
Set up roomspeed from 30 to 60(currentrly) and it made everthing a bit smoother.
Resolution = system standard 1920x1080, base resolution for the game 640x360, also tried with doubble resolution, still the same tearing and flickering problems.
Having 2000-1000 fps, average 1070, while not recording.
Would actually prefer 30fps (=roomspeed 30?) if i can make everything make work properly on it.
[QUOTE="TheouAegis, post: 58913, member: 1973"
var n = instance_position(x+xx,y+yy,o_Parent_Usable);
if n scr_DoStuffWith(n);
[/QUOTE]
8. I know i can make a script return a boolean or a variable value. Can i make it return more than one? My solution would be to make a big string with ";" in between values, then make some script in a loop return values out of the string again. Is there a better solution?
9.Also what commands to get values back out of strings in general?
10. I got this Array right now where i store Item specific stuff like: "Name" (string), "Able_To_Pickup" (boolean), "MaxItemInPossesion" (int), "Able_To_Gift" (boolean)..., or if i had one for each specific NPC where all his "important" Values get stored. Where should i store Data like that, and Controller_Object, an .ini file, globals, and so on? I'm not talking about saving, just storing while the game runs. Are there rules when to use what and what is the most suited?
11. I have some screen tearing / flickering issues whith my pixel art when moving (speed doesnt matter):
Code:
if (instance_exists(o_Hero)){
if !o_Hero.State_Menue{
y += floor((o_Hero.y - y) * 0.3);
x += floor((o_Hero.x - x) * 0.3);
}
}
Resolution = system standard 1920x1080, base resolution for the game 640x360, also tried with doubble resolution, still the same tearing and flickering problems.
Having 2000-1000 fps, average 1070, while not recording.
Would actually prefer 30fps (=roomspeed 30?) if i can make everything make work properly on it.
Last edited by a moderator: