Heroes4hire's Forum Posts

  • Yes.. that's exactly what I mean, and want.. but

    I have 5 options in z order.

    Move to bottom, Move to top. Move to layer move to object. And set z elevation.

    Elevation just squews the arm. Like its attempting it on a 3d axis.

    I swear this was easy in construct 2

  • super that did it

    but... i dont think zelevation is what i thought it was... its enlarging the arm (i set zelevation to 50 to be sure) and moving it left

    i just wanted its layer to be above or below the torso

    set it down to +1z elevation. nope, just moves up by x+1 y+1

    i could have 3 layers globally, and just move it above or below.. not sure if that will effect on collision

  • I have a body and an arm. i want the right arm to be below the torso when the torso faces left. above while facing right.

    i have a test where i press a button to change its zlayer, does nothing

    on left button clicked.

    arm z elevation=0. arm z=1

    arm z =1 arm z=0

    nothing. test text says it stays at 0

    the arm is a child of the torso. if that changes anything

  • global variable check. when the ball has collision with a player, set the global variable to player.uid (unique identity)

    then have a

    player.uid =uid(global). enable 8d and scroll too.

    then

    for each player, is uid (not equal) to global variable.

    then add disable 8d or scroll to the inactive ones

    should be a simple solution, might need an every tick in there

    hope that helps!

    its the ai thats a pain

  • Yup. You saying about checking the target was right.

    I posted my findings above. Just needed to swap who was checking for who to specify who was the subject.

    Massive help, in a round about way!

    Doing the individual battle code now. Then I've got a juicy system I can use for multiple games!

    Kenshi.. then dungeon keeper.. hype

  • A..ahhh..

    So, I was picking nearest enemy base from player base.

    I wanted to pick nearest player base from enemy base

    That way the enemy base is the one being used and set path to picks it.

    My bad. New day, fresh brain

  • For what it's worth. The always pick the lowest uid target currently

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The distance is just a check. So, if a player and enemy meet, they engage in battle, no matter if they are pathing elsewhere.

    Sorry for the upside down photo.. slowly I'll get to grips with this forum and posting things. It's been 6 years+

    Just want to find closest enemy. Move towards them.

    In any situation any enemy and player meet (distance<= 40) stop, engage battle.

    I've got all body working indipendantly, and battle is done asides from dodging and punch turns.

    Just the pathing, and I can make a game from it

  • And they ignored other enemy base. They will path through other enemy base. Even though they should stop whenever they are within 40

  • Yeah. Litterally that.

    For each base pick nearest enemy base.

    All the base just path to the same enemybase, ignoring other closer instances

  • Well I'm in a process of testing. 1v1, no problem. 2v1. Got it down. But I went into 2v2 3v3 ect and problems with pathing arise.

    I'll look for examples. But, like i say, 5v1 no problem. Maybe theres a comand and conquer style game I can look for.

    On start of layout

    For each playerbase

    Find nearest enemybase. Find path

    For each player base

    distance to enemy base <= 40. Stop trigger battle boolean.

    For each player base, pick nearest enemybase. Distance >= set boolean false

    For each player base, boolean is false. Pick nearest enemy base. Set path to enemy base.

    Basicly what I'm running with.

  • Think I mis understood.

    termanolagy I'm not 100% on

    You want the white puck to not overlap while choosing a place to use it from?

    So instead of going red, you want it to lock to the nearest available position? Until the mouse has taken it past a point.

    Say the blocking piece is 50 wide.

    On colision set the piece to have a boolean.

    When boolean is checked.

    While

    Boolean is true

    mouse x is between piece.x-25 and piece.x

    Set puck.x to piece x-50

    While

    Boolean is true

    mouse x is between piece x+25 and piece.x.

    Set puck to piece x+50

    I turned off the computer, cant test it untill tomorrow.

    But, that should activate a piece on contact. And set the puck location to next to the piece right or left, depending on the mouse location.

    Just have to turn off boolean when mouse goes past

    This will lead to more issues if 2 pieces are next to each other. I'll work on it tomorrow if that's what you need.

  • Looks beautiful!

    Save the puck x and y on a global variable.

    Then you can test if its overlapping when choosing a space.

    When puck stops. Save its x and y.

    Then set its location to the global variable x + its width.

    If its overlapping something, use the global variables to reset its position.

    Give it a variable count on fail.

    Then say if variable =1

    Reset position to global xy

    Move puckx to puck x - its width.

    You can then do this to its y axis. If it overlaps again

    This is.. 4 directional... 8 is you make more clauses

    Hope this helps. Hope I understood what you wanted

  • I'm using "for each" playerbase.

    Is there a better way to identify who is forfilling the clause?