I have an mp_grid setup that works during the aggro state just fine, but the passive state only works when I add && (path_index == -1) to the if (mp_grid_path(...)) statement. However, this causes the object to not return to its passive path once the aggro state is left. Without the &&...
So I have a grid of hexes, each containing a coordinate, an array of its neighbors, and its g_value, h_value, and f_value.
I have set up this A* pathfinding function to find a path between two points, and as you can see below it works perfectly if there's a valid path.
But if there's not a...
I am using the built-in grid pathfinding for my enemies to be able to move around walls to chase the player and all that and its working fine but for some reason, if the enemies touch each other they get stuck. I have tried putting move_bounce_solid(other); into a collision with another enemy...
So I'm at the point where I'm going to implement cutscenes and NPC's into my (top down 2d rpg) game.
I've drawn all the sprites, have a good idea of who needs to do what,...
So I'm starting this (quite new) challenge.
I thought it would be a great idea to ask around a bit. I have a few systems...
The built-in pathfinding is nice, but very limited (can't move through diagonally blocked paths, can't weight movement, etc). So I'll just write my own implementation of A*, right? Well I did. And it works. But it's sloooow. So I figured maybe these new structs that I used to track nodes...
Hi everyone!
So for the past few months I have been having a little competition with my friend to write a fast simple pathfinder that can work with multiple units while always returning the optimal path.
after a lot of trial and error I have finally simplified my work down to this tiny asset...
So! I have my villagers on wonder. Witch I am going to set as a job called "Wonder" or "Jobless" and when they are jobless they wonder around. But if you set them to a job, they will wonder around an area, and occationaly pick up items and bring them over to the targeted location for storage...
So! Path finding is a thing. Im using Grid Path Finding in my code. And as said the speed {var spd = 0} is set when you give the code {path_start(path, spd, path_action_stop, false)}
This defines the speed from point A to point B. But say between point A and B there is a river and to cross that...
Idk if was a post already. But how to i drag and drop an object that has path finding codded into it? Here is the code I have so far:
if treached = false {
sprite_index = spr_villagerMoving
if (!instance_exists(target))
{
// create new target
var gx =...
I have this in the step event for the enemy:
grid=mp_grid_create(0,0,room_width/32,room_height/32,32,32)
path=path_add()
mp_grid_add_instances(grid,oBarrel,0)
mp_grid_add_instances(grid,oWall,0)
mp_grid_path(grid,path,x,y,oPlayer.x,oPlayer.y,1)...
Hi everyone o/
I'm coding a top down game where enemies follow the player if they're close enough to it. I'm using this code:
this works pretty fine, but when an enemy with this code is surrounded by walls and have no possible path to follow, it just disappears! My game'll have some places...
Hello, is there a way to see if an instance has an unobstructed path to a specific instance. I'm currently trying to implement an enemy spawner that first checks to see if the enemies it's spawning are able to travel to the player before spawning enemies.
Hey there! I'm making a top-down adventure game with GMS2 and wanted to code a pathfinding system so the enemies in my game could avoid obstacles when chasing the player. However, the code doesn't seem to be working.
This is my code:
In my grid object's Create event:
globalvar enemyGrid...
So I've been working on the core parts of an isometric game and its going good so far.
Since I'm still on the very early parts, I'm wondering if there are any special things to consider early on that might help me later.
Currently I have it performing very well even with many enemies at once...
Hello there, I've been fiddling with a roguelike for the past few days and opted into using GM's built in path functions to avoid having to mess around with writing a pathfinding system myself.
My RL has 8 direction movement and the player can cross over blocked corners but it seems as though...
OneWayy (with two Y because OneWay was already taken :() is a pathfinding game available on iOS and Android. It's pretty simple, the algorithm generates a level, and you need to solve it. You must only go once on each cell and fill the whole grid in order to complete a level. Just swipe to move...
Hello! after a long abscense i am back trying to finish my first projec, it is a 2d topdown game set in space and one of the enemies is supposed to be able to navigate towards the player without hitting anything in the way (pathfinding) because both the player and the enemy ships get damaged if...
I am currently using IDE V2.2.2.413
Hello everyone!
I am quite new to GML, and doing a lot of experimentation, and toying around to understand how all the moving parts work. I have spent quite a lot of time in the past few days doing my best to problem solve, and find solutions to my roadblocks...
Hello everyone,
I know this question asked many times before and yes I checked old posts and tried different solutions and approaches as much as I could but I'm still learning :/ (I started to GMS 4 months ago, pretty new).
I will try to explain my problem.
I'm trying to make a topdown shooter...
Hey everyone! The beginning of this thread is exposition of things leading to the problem. Don't have time for that? Skip down to the "comment", // HELP HERE //.
In making an isometric "continuation" of yugioh the duelist of the roses called "Yu-Gi-Oh! The Shadow of the Dark Roses".
For those...