Videos

[GameMaker Tutorial] Basic Artificial Intelligence



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

Similar Posts

38 thoughts on “[GameMaker Tutorial] Basic Artificial Intelligence
  1. 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);

  2. 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 }

  3. 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);
    ############################################################################################

  4. 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);

  5. 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….

  6. 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;
    }

  7. 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.

  8. +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);

  9. 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.

  10. 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…

  11. 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!!!

  12. +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.

  13. 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?

  14. 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.

  15. 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

  16. _________________________________________
    ############################################################################################
    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);
    ############################################################################################

Comments are closed.

WP2Social Auto Publish Powered By : XYZScripts.com