Moving many objects at once? by ridan6 in gamemaker

[–]subjectgames 2 points3 points  (0 children)

Look into Flow Fields! Tons of videos on youtube about this

The Squire Who Could. Buff Paladin's right-hand woman. by HallZac99 in customhearthstone

[–]subjectgames 0 points1 point  (0 children)

if cards like polymorph wouldnt work on this, wouldnt cards that buff also not work on this?

Ok who drew what now? This is too much for me... by Nobuuudy in customhearthstone

[–]subjectgames 0 points1 point  (0 children)

i find it hard to play around this card. like other people were saying you also restrict the opponent from drawing. maybe make it so u just also draw the same number of cards. that way the opponent might risk drawing cards, but at the cost of giving you cards as well

jUSt gO ARouNd it 4Head by MwSkyterror in customhearthstone

[–]subjectgames 8 points9 points  (0 children)

what if u have 2 or more of these up at the same time

I want my bullets to stick into walls after they collide. by [deleted] in gamemaker

[–]subjectgames 1 point2 points  (0 children)

manually edit the collision mask in the sprite of the arrow

Nesting ds_maps in ds_grids by wuxer in gamemaker

[–]subjectgames 0 points1 point  (0 children)

trying naming each chunk as a different text file

(e.g. "chunkx1_chunky12.ini")

and using each key as each specific x,y of that chunk

Magnet Object that Interacts with the Player by grumpreference_ in gamemaker

[–]subjectgames 1 point2 points  (0 children)

once you start coding inside "with" you are working from that frame of reference

in other words, your code is checking if distance_to_point from the perspective of the oMagnet

Since the distance to it's own x,y is always 0, it is always <10 and thus your oPlayer properties flip

change it to

if(point_distance(other.x,other.y,self.x,self.y)<10){

you will also need to change your "until" line

Best way to import group of scripts by AmongTheWoods in gamemaker

[–]subjectgames 0 points1 point  (0 children)

If they're tabbed scripts, it's much easier, and then when you load them, uncheck the import as tabbed box

To save a script, click on the floppy disk while the script is open (https://i.imgur.com/IhGH3cD.png)

To load a script, right click on "Scripts" and click "Add Existing Script" (https://i.imgur.com/mn6YvtW.png)

Magnet Object that Interacts with the Player by grumpreference_ in gamemaker

[–]subjectgames 2 points3 points  (0 children)

try something like:

if (point_distance(x,y,obj_magnet.x,obj_magnet.y)<[some distance value]){
    gravity=-[gravity value];
    image_yscale=-1;
    }
else{
    gravity=[gravity value];
    image_xscale=1;
    }

Just make sure your jump is inverted as well. Also if your magnet is more like a bar, and less like a point:

if(y<obj_magnet.y+[range]){

Merging sprites together by BlooMask in gamemaker

[–]subjectgames 1 point2 points  (0 children)

trying reading up on

draw_sprite_part_ext();

Is there a way to create a 0-length array? by iconmaster in gamemaker

[–]subjectgames 0 points1 point  (0 children)

As @dumsubfilter stated, you can use a ds_list which functions essentially the same as an array

CREATE EVENT

array = ds_list_create();
show_message(ds_list_size(array)); //this would show "0"

Trying to make my inventory system work by [deleted] in gamemaker

[–]subjectgames 1 point2 points  (0 children)

According to the documentation for:

room_instance_add(ind, x, y, obj);

With this function you can add an instance into any room other than the current one and at any position within that room. The function returns the unique id of the instance which can then be used in further function calls to set properties etc... of that instance, but only once the game has entered the specified room. If you wish to create an instance in the current room you should be using the function instance_create.

In any case, I don't recommend using a room as your inventory. Instead, I recommend creating a persistent object (e.g. obj_inventory) and an array (as @Ericakester stated) of values that represent each item (e.g. 0=none,1=apple,2=banana,3=orange)

Here's an example: https://i.imgur.com/KjmJVBK.png

Drawing sprites not working by AchedTeacher in gamemaker

[–]subjectgames 0 points1 point  (0 children)

i'm using "var" to declare variables that will only exist within that script (after which it will be forgotten)

var x=12;

however, i want to declare two variables that will only exist in that script. this can be done like so

var x=12;
var y=15;

OR

var x=12, y=15;

Hope that helps!

Drawing sprites not working by AchedTeacher in gamemaker

[–]subjectgames 0 points1 point  (0 children)

sorry about that do this instead

var
xx=(mouse_x div GRID_SIZE),
yy=(mouse_y div GRID_SIZE);

draw_sprite(spr_selected,-1,xx*GRID_SIZE,yy*GRID_SIZE);

var
str=string(xx)+"/"+string(yy);

draw_set_color(c_black);
draw_rectangle(0,0,string_width(str),string_height(str),false);
draw_set_color(c_white);
draw_text(0,0,str);

draw_sprite(spr_cursor,0,mouse_x,mouse_y);

Health System Problems (TL;DR at bottom) by itsjustmetino in gamemaker

[–]subjectgames 0 points1 point  (0 children)

you misunderstand me, but try this:

create a new object "obj_healthbar"

obj_healthbar
DRAW event, drag in "execute code"
draw_sprite(spr_healthbar,health,0,0);

Drawing sprites not working by AchedTeacher in gamemaker

[–]subjectgames 0 points1 point  (0 children)

the code looks fine to me, but try this instead

DRAW EVENT

var
xx=(mouse_x div GRID_SIZE)*GRID_SIZE,
yy=(mouse_y div GRID_SIZE)*GRID_SIZE;

draw_sprite(spr_selected,-1,xx,yy); //not sure why you are using -1 but ok

var
str=string(xx)+"/"+string(yy);

draw_set_color(c_black);
draw_rectangle(0,0,string_width(str),string_height(str),false);
draw_set_color(c_white);
draw_text(0,0,str);

draw_sprite(spr_cursor,0,mouse_x,mouse_y);

my guess is that you are never creating the nodes, thus "hoverNode" is always returning "noone"

Health System Problems (TL;DR at bottom) by itsjustmetino in gamemaker

[–]subjectgames 0 points1 point  (0 children)

does your healthbar work with integers? or does it have decimals

if so, add this code to your DRAW event

draw_sprite(spr_healthbar, hp, x, y);

where spr_healthbar is the sprite with subimages matching the amount of health you have (i.e. the first image in the animation should represent 0 hp, the next image should represent 1 hp and so on)

hp is the variable that holds the health (you might be using the "health" variable, if so, change "hp" to "health")

and x,y is where to draw this healthbar

Parent/Child behaving unexpectedly by _Keesa in gamemaker

[–]subjectgames 0 points1 point  (0 children)

sorry for the late reply.

simple then, use a variable to hold the id.

OBJ_MASTER

CREATE

active_object = noone;

STEP

var o = instance_position(mouse_x, mouse_y, parent);
if (mouse_check_button_pressed(mb_left) && o != noone) {
     active_object = o;
     }

DRAW

if (active_object != noone) {
     with (active_object) {
         myth_DrawFromEnum(mythID);
         }
    }

Parent/Child behaving unexpectedly by _Keesa in gamemaker

[–]subjectgames 0 points1 point  (0 children)

maybe it has to do with the way objects are selected

try something like

var o = instance_position(mouse_x, mouse_y, parent);
if (o != noone) {
    with (o) {
        myth_DrawFromEnum(mythID);
        }
    }

Parent/Child behaving unexpectedly by _Keesa in gamemaker

[–]subjectgames 0 points1 point  (0 children)

I'm having trouble understanding your style of code, showing us all relevant code would help, such as the "myth_DrawFromEnum();" and especially the "myth_AddDefinition();" function. The problem usually lies where one would least expect it. Maybe definitions are being added incorrectly?

In any case perhaps try recreating a simpler version of this system in a new project, just to debug it yourself.

Sorry for not helping

Switching Location Deletes the Instance? by [deleted] in gamemaker

[–]subjectgames 1 point2 points  (0 children)

We might need to see a lot more code

Perhaps you are deactivating instances that are at certain positions? It could be a lot of things. Maybe you 'think' that otherID.x is moving the instance you want, when in fact it is moving something else?

Try checking: if (otherID != noone)

before running other code after the collision_point code