facecrime's Forum Posts

  • Hi,

    my gamepad controls apply axis-speed like this:

    Gamepad.Axis(0,0) * Player.CurrentSpeed * dt[/code:2noza82q]
    
    I try following R0J0hounds suggestion to calculate velocityX like this:
    vx = speed * cos(angleOfMotion)
    
    so I calculate my directional speed like this
    
    [code:2noza82q]Gamepad.Axis(0,0) * Player.CurrentSpeed * dt * cos(angle(0,0,Gamepad.Axis(0,0),Gamepad.Axis(0,1)))[/code:2noza82q]
    
    However when I use this formula in the Predicitve Aim formula from this thread
    
    my baddies miscalculate the angle to hit me when shooting at me.
    
    Using 8direction vectorX and Y for keyboard controls it seems to work great btw ...
    
    I'm guessing that i'm not getting the directional speeds correctly, but the syntax seems beyond me.
    Can anyone help?
  • hm, not possblie then?

    how about doing a manual line of sight test? how would i go about that, we don't have raycasts in 2d, do we?

  • Hi,

    my enemies spawn their projectiles from an image point that is not the spites' origin.

    This results in enemies postioning themselves at corners that they look past but cant shoot past, cos the origin has LoS but not the gun. So the projectile gets stuck in the wall/corner.

    Is there a way to have the LoS behaviour check for a different position than the object's origin?

  • quick gif to share the state of affairs

  • LittleStain Well, read your comment, thought, "Duh, of course, I tried that. Didn't help." But tried again. Suddenly it works ...

    must have had other issues when trying earlier. Thanks

    Wondering now:

    My Enemy Bases dont use For Each and work fine, detecting the player, approaching, attacking, retreat to cover.

    Its probably because to do with that the bases work largely indepedantly and dont need to refrence the other family.

    What difference does the for loop make to picking across families?

  • Hi,

    my enemies consist of a 'base' and a 'turret', each sorted into respective families.

    Both go through a set of states to define their behaviours. Base and turret are grouped through containers and pinned together.

    My bases work quite well, but ironicly the simpler turrets cause trouble.

    They should all be firing individually at their own pace, creating different types of projectiles.

    But atm projectiles are spawned either from only a single turret instance or all instances at once.

    For state transitions a variable in the enemy types defines which state to go to upon exiting a given state.

    This is the main state loop of the turrets:

    This is one of the weapon types:

    I'm having trouble understanding what referencing functions need, I tried lots of variants but i get either only a single turret instance to shot or all instances firing at once.

    Can anyone point me to the glaring mistake(s) I'm making?

  • Ok, it's actually what I resorted to, storing child and parent UIDs, but it's a pain.

    Not sure what the Rex part is about, will research.

    Thanks guys.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • newt what if I addressed my original object through its family and the other object is only specified on family level too?

    E.g. Imagine you have different tank setups made up of a base family and a turret family.

    One tank (container) might contain base X and turret Y from those families.

    All are controlled through family events.

    Say my tank base family goes into Idle state, I need to tell the according turret to stop shooting. How do I address the actual turret object?

    My event might say:

    Family_TankBase | on LOS broken: Family_TankBase -> set state "idle"

    + Family_TankTurret -> turret disabled

    But it seems that Family_TankTurret does not know what turret to talk to.

    Any suggestions?

  • makes sense, thanks.

  • Hi,

    Is there a way to retrieve the UID of an object in the same container in runtime?

  • I'm looking for suggestions how to best set up a system that lets me define unique behaviour trees for my different enemy archetypes.

    Atm I have sort of a state machine of reusable states that each archetype uses.

    Each state has a fixed set of state exits and per type I define to what state this type will to go to from each individual exit. That's fairly flexible but still has some rigidity.

    I was wondeing if anyone has any good examples flying around of some best practise AI setups?

  • works fine here, didn't make it too far, but looks neat.

  • HI,

    I want to recognize whether my enemy has cover objects available in range and react when there are none.

    Atm I'm creating a list of valid cover objects through 'pick by comparison', checking for objects within range.

    How do I recognize that picking did not find any valid results, so I can react?

  • Haha, i wonder if you'll get in trouble over those portals.

    Nice one though!

  • Pretty great!

    Cool concept, nice visuals. Like it