1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 *SOLVED*mp_potiential_step cancel

Discussion in 'Programming' started by Didjargo, Jun 26, 2016.

  1. Didjargo

    Didjargo Member

    Joined:
    Jun 21, 2016
    Posts:
    46
    Is there an efficient way to make an object give up attempting an mp_potential_step command if it is impossible for them to reach their destination?
     
  2. jackhigh24

    jackhigh24 Member

    Joined:
    Jun 21, 2016
    Posts:
    604
    in one of my game i stop mp potential step if im close to what i aiming to get to, so that might work for you depending on if the path is always going to be clear once your close enough.
     
  3. Didjargo

    Didjargo Member

    Joined:
    Jun 21, 2016
    Posts:
    46
    My issue that prompted this thread is that I am making an RPG game with turn-based battles. Only instead of combatants remaining in static locations, they move around the battlefield (not grid-based). Through testing, I have found a game breaking bug where if the player surrounds an emeny unit on all sides, giving it no room to move, then when that enemy takes its turn it cannot move to a new location and thus just runs in place perpetually. Since it is turn-based, this breaks the game as nothing else can happen until that object reaches its destination.

    I've thought of a crude solution though that might work, though I haven't tried implementing it yet. potentially, I could have the enemy unit release a sort of "recon" object before it starts to move. This recon object will have the same mask as the enemy and move towards the same destination only slightly faster. If the enemy object catches up to the recon object before reaching the destination, the movement is canceled. Do you think this could work?


    EDIT: I decided to try out my recon object idea, and it worked.
     
    Last edited: Jun 26, 2016

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice