HeartBeast
Check out my popular GameMaker Book and GameMaker Courses: http://www.heartbeaststudios.com/
Follow me on Twitch for GameMaker livestreams: http://www.twitch.tv/uheartbeast
Follow my twitter: https://twitter.com/uheartbeast
Like my Facebook page: https://www.facebook.com/heartbeast.studios
Follow me on Tumblr: http://uheartbeast.tumblr.com/
Thank you all so much for your support!
Source
FATAL ERROR in
action number 1
of Step Event0
for object oEnemy:
Push :: Execution Error – Variable Get 100020.state(100006, -2147483648)
at gml_Object_oEnemy_StepNormalEvent_1 (line 7) – script_execute(state);
For extra exciting times if you add another var in your idle state:
var pEye = collision_line(x, y, obj_player.x, obj_player.y, obj_wall, false, true);
you can use this to break line of sight when you hide behind a wall.
amend the code as such:
if (dis <= sight_range && !pEye) { //change state code here }
help me with this error npleasee
_________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object OBJ_ai:
Push :: Execution Error – Variable Get -1.dir(100006, -1)
at gml_Script_scr_enemy_chase (line 5) – motion_set(dir , spd);
############################################################################################
Any way I could add this to a physics room and have the enemies be able to move around? Thanks for the tutorial. 🙂
FATAL ERROR in
action number 1
of Step Event0
for object obj_enemy:
Push :: Execution Error – Variable Get 100001.state(100003, -2147483648)
at gml_Object_obj_enemy_StepNormalEvent_1 (line 2) – script_execute(state);
your making agar.io
These tutorials are great! I learn so much from them! Thank you
Code is Fine, wont work though
so how can I mAke that the enemy can't see me thru a wall, with than range of view he will follow me regardless is he can't "see me"
cute baby you got love it too much that's an order soldier!:)
I don't know, to me interpolate colors or whatever option fixes graphics, for example gun, when it rotates without that option pixels get weird on edges, but with that option the image is exactly the same, but I guess it takes more resources….
Can someone help me? ERROR at line 3 pos 10: Unexpected symbol in expression
///scr_enemy_idle()
state_text = 'idle';
var dis = point_distance(x, y, obj_larry.x, obj_larry.y);
if (dis <= sight_range) {
scr_enemy_chase;
}
This video is so old and nobody is here but i'm gonna say this anyway: When i launch the game, no errors, everything is good right? Nope. When i go close to the enemy it changes to chase state and when i get even closer it spams between attack and chase. When i used debug mode and when a step at a time the dis variable wierdly changed between 92.0343700800 and 22.1064769200 each step. I have decuple-(ten times)-checked the code and i have no answer.
do a tutorial how to make agario i think its not hard to make
Why are you scripting? I don't understand It, you can make easy a game without using any code.
+HeartBeast Studios i know this is kind of a old video but could I get help with this?############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_enemy:Variable obj_enemy.dis(100007, -2147483648) not set before reading it.
at gml_Script_scr_enemy_chase (line 6) – if (dis <= sight_range && dis > attack_range) {
############################################################################################
——————————————————————————————–
stack frame is
gml_Script_scr_enemy_chase (line 6)
called from – gml_Object_obj_enemy_StepNormalEvent_1 (line 2) – script_execute(state);
something went wrong
________________________________________
COMPILATION ERROR in Script: scr_enemy_idle
Error in code at line 3:
var dis = point_distance(x, y, obj_player.x, obj_player.y);
at position 9: Unexpected symbol in expression.
Hi dude, may you explain how to make that the enemy's have a movement not random until the player is close? instead stay stopped like the video…I wish my enemy go to point A to point B and reverse…
my enemy isn't chasing me when I get into the sight range… I double checked the code about 50 times and its exactly the same as yours! I'm also not getting any error messages..plz heeelp!!!
+HeartBeast does this technique work if the objects are physics objects, because everything is working except the enemies wont move. The only difference is that my objects use physics. All the code is the same.
Put in a project of mine that is using phy-environment based of your RPG YouTube series (TY for that BTW!).
Seems only attack function is operating correctly , however no errors, enemies just don't move(lazy buggers).
should I try working this out(how?) or try a different method?
do the enemy colide with each other or they move when they colide
Aww she's so cute ❤❤
22 minutes? this is more basic.
Just use // if distance_to_object > do follow // and your AI its ready.
bRUH, SMH BRUH WHERE DA MERNCREFT SERIES AT BRUH!!!!! ME MUY TRIGGERED!!!
Thank you SO much! I've been trying to find a tutorial that teaches basically this exact thing so I can modify it to fit my game!
Thank you, but could you please advise on what to do if I wish for enemies to wander around when not pursuing the player, rather than just standing still? I'm thinking send them moving in a random direction for a certain amount of time, and after that time repeating so they go another random direction, but in addition, that time would just be interrupted if the player came in range. I previously had that timed wandering down to alarms in the object, but I want to do this with a state that can swap to another state if possible.
Ashen and the quest for the gamechild
Do you have a tutorial that looks like that but enemy has it own path like back and fort and if youre in range youll get chase and if youre not in range it will back to the original path
Wow, your daughter has a really beautiful big blue eyes!!
_________________________________________
############################################################################################
ERROR in
action number 1
of Step Event0
for object Obj_Polish_AI:
Trying to execute non-existing script.
at gml_Object_Obj_Polish_AI_StepNormalEvent_1 (line 2) – script_execute(state);
############################################################################################
I know this is old but…
That is cute af
thank you for the tutorial, i did something with it, it works well, im a mega noob in this matters but with things like this i will learn a bit
Great if you're making an RPG, because if the enemy sees you, they will start moving toward you. If they touch you, a battle is triggered.
Help! For some reason, my enemy doesn't react when my player gets near. I don't know what the issue is.
Can you make a tutorial teaching how to make an object run around the room randomly?
How to to this to multiple player objects ?
I know this video is old but,how i make the AI move randomly