Jump to content

I need someone who knows how to use gamemaker 1.4 "fluently." 

You can find where I took the code from from HearBeast's random level generator playlist. 

Some important information:

Sprites: spr_player, spri_enemy - self explanatory

Backgrounds: bg_floor, bg_wall, bg_walltiles - self explanatory

Scripts: move (movement for the player), grid_place_meeting, get_path_to_player (collisions; here is the video that I took this from - 

 

)

Objects: Level(randomly generates the level), Player(the actual entity the moves around), Enemy(enemy = enemy)

Rooms: rm_one - self explanatory

Macros: stated in the first part of the playlist above. 

 

Problem: I need the enemies to pathfind to me but then there's a catch, I need it so they can't just find you all the way across the map, I need a radius in which they can detect me and they cannot detect me behind the walls, other solid objects.

I need to code for this ^

I'm also a begginner and is using gamemaker for a school project so please explain "carefully" otherwise I would not understand. Ask me anything that you might/will need to help me. Thank you in advance.

"May your frame rates be high and your temperatures low"

I misread titles/posts way too often--correct me if I don't.

 

Link to comment
https://linustechtips.com/topic/771415-gamemaker-14-help/
Share on other sites

Link to post
Share on other sites

5 minutes ago, Jasun said:

Snip 

Because gm 1 isn't available and I never learned the typed version of gml I can't say for sure. 

 

I briefly read your problem and it seems you want enemies to chase you but only if you're close to them. 

 

In the enemy class/object script add an integer number variable called detection radius. Give it a value (i.e. 10... or 100 depending on how big units are in gml) 

next in one of the steps (begin middle or end idc) see if you can run a distance command. 

I.e. :

distance (this enemy, to player)

 

if distance is less or equal to detection radius

 

then 

chase player

 

else

no else statement. 

Link to comment
https://linustechtips.com/topic/771415-gamemaker-14-help/#findComment-9735667
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×