Helix0's Recent Forum Activity

  • I got it to work, that example helped a lot too. Thanks again!

  • This is what I've been doing. I'll look into stylesheets when I get the chance too and report how it goes.

    The "Scrollbar-color" block doesn't work in that picture

  • Right...But I cant find the correct syntax for Construct 3, even after trying the synax in the link you gave me. Im trying to change the color.

  • How can I change the color of the scroll bar on this HTML list? Ive been looking around but I cant seem to find the CSS name and syntax for that part.

    Any help is greatly appreciated!!

    Tagged:

  • That does sound tedious, I might just continue digging and try and epitomize the nearest wall algorithm so it doesn't **** as much.

    Thanks a ton for the help, I appreciate it.

  • I see, that doesn't seem all to great in practice. The solution you gave in https://www.construct.net/en/forum/construct-3/how-do-i-8/tactically-intelligent-ai-173259?kws=ai%2bline%2bof%2bsight sounds great, but I'm not sure how to cast rays at angles.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • construct.net/en/forum/construct-3/how-do-i-8/tactically-intelligent-ai-173259

    I looked into past posts and did some digging and discovered this system made in Gamemaker, https://youtu.be/XuhkKmNyYTY

    It does everything I need it to do, but I can't figure out how it finds cover. I used to use GM a long time ago but I can't wrap my head around this function.

    This is the code that finds cover

    function scr_find_cover(argument0, argument1, argument2) {

    /*

    If there is line of site between the target enemy and yourself, then

    move behind the nearest wall.

    */

    can_shoot=0 //don't shoot while in this state

    if !collision_line(x+lengthdir_x(argument0.sprite_width,point_direction(argument0.x,argument0.y,x,y)),y+lengthdir_y(argument0.sprite_width,point_direction(argument0.x,argument0.y,x,y)),argument1.x,argument1.y,argument0,1,1)

    //if line of sight....

    {

    //pathfind to a point behind the nearest wall relative to the enemy

    mp_potential_step(argument0.x+lengthdir_x(argument0.sprite_width,point_direction(argument1.x,argument1.y,argument0.x,argument0.y)),argument0.y+lengthdir_y(argument0.sprite_width,point_direction(argument1.x,argument1.y,argument0.x,argument0.y)),argument2*2,0)

    }

    else

    {

    //if there is no line of sight (you are in cover), then decrease your fear level.

    fear-=1

    }

    }

    From my understanding, the fear level is a instance variable that makes enemies take cover when its high.

    "Argument0" is the nearest wall, "Argument1" is the target or the attacker and "Argument2" is the enemies speed.

    If you could translate this then that would be awesome, and if you need anymore details please ask me. Thank you

  • construct.net/en/forum/construct-3/how-do-i-8/tactically-intelligent-ai-173259

    I completely forgot about that post, thank you.

  • Is there a way to have an enemy take cover behind an object using calculations and without the use of nodes? I want the system to be as dynamic as possible.

    Any and all help is greatly appreciated!

  • Hello, I am making a top-down shooter game and I'm having some trouble making some enemy AI. I'm using a state machine and I the enemy to have 3 stages:

    An idle stage where the enemy roams around the map

    An attack stage where the enemy turns to the player or the players teammate (Whoever is in the enemies line of sight) and shoots at them

    A chase stage where the enemy goes to its target's last seen position once the target breaks the line of sight.

    The player is accompanied by teammates that are also targets for the enemy.

    Any help is greatly appreciated!

  • I have built my code and tested it in one layout, now that it works I've moved on to make a new map in a new layout. Upon putting my players (and all the required objects like bullets, guns, particles, etc.) the code fails to work. Some parts of the code work, some don't.

    For instance, my player can shoot his gun, and when he does, the screen shakes, the sound plays, but no bullet spawns. Am i making some kind of classic rookie mistake? Ill share more details if needed.

  • Refactor the events so that you set reloading to 1 as you already have, then do a separate event something like:

    Reloading = 1, every x seconds : play sfx etc, add 1 to ammo.

    - If ammo = max, set reloading to 0.

    For tighter control, use the timer behavior and add 1 to ammo on timer. If ammo < max, restart the timer. This way you can stop the timer instantly if needed (like a powerup or on picking up a new weapon).

    Thank you! This worked perfectly!

Helix0's avatar

Helix0

Member since 24 Jul, 2022

None one is following Helix0 yet!

Trophy Case

  • 2-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

4/44
How to earn trophies