How do I get a event or over world monster to react to how close or far away the player is?

● ARCHIVED · READ-ONLY
Started by EBroxas72 7 posts View original ↗
  1. *First off I am new to the forum, So If I'm asking in the wrong Place about How do I ____ I'm sorry in Advance.*

    I'm doing a 30 day trial Challenge where I see how much of a game I can make in the said days. i'm almost done with it, it's just I have hit one last road block. One of the things I want to do in it is a chase kinda like Ao oni but: 

    "A" it's on one big gigantic dungeon/map vs a lot of little maps. and "B" the monster is always chasing you but depending on how far way you are It can get lost/looking for you, Like if it's 60 squares or more away from you It's Set Move Route is "MOVE AT RANDOM, MOVE AT RANDOM,MOVE AT RANDOM etc" If it's 40 squares or so away from you It's Set move route is "MOVE AT RANDOM, MOVE TOWARD PLAYER, MOVE AT RANDOM Etc.." And so on and so on, Un-tell you get to 15 or so more away from you and then *SPOOKY MUSIC* then it's on you rump, And you need to GTF away from it. And why I want to-do this is "A" on paper this seems to be less cheap then it's always chasing you, And "B" so it can get lost as well as the player now has the power to get away from it and not run from it for 30 mins straight with out break or it teleporting for some unexplained reason.

    I know how to get most of that to work except the It reacts to how far away you are on the Map. Any tips folks?   BD
  2. you can try it with multiple pages on the monster event and a common event to switch between pages.


    The monster should have one page with autonomous movement set to random, and one page with autonomous movement set to player approach. Condition the approach page to a general switch "hunting" or something like that.


    (note: I'm not talking about set move route here, I'm talking about the autonomous mevement, the small area between the sprite graphic and the large content area)


    Then have the common event set to parallel process, with a switch to be enabled when the race is on.


    Inside that event, use control variable commands to identify and calculate the distance between the player and the chasing event.


    If it's lower, then the common event controls the hunting switch ON - if it's higher it'll control it OFF.


    Don't forget a wait(10) at the end of the common event, you don't need it running sixty times a second.
  3. Andar said:
    Then have the common event set to parallel process, with a switch to be enabled when the race is on.

    Inside that event, use control variable commands to identify and calculate the distance between the player and the chasing event.
    How do you set it to calculate distance from player? I can see how to set it to certain coordinates, or even check both its own location and the player's location, but not the distance between the 2.
  4. you can use event sensor script. but it only support one changes (two phase).

    it will move at random. then after entering certain range it will chase.

    i personally use moghunter. but you need to download the whole master demo though.

    http://www.atelier-rgss.com/RGSS/System/ACE_SYS03.html

    for your specific request (60 tiles random, 40 tiles random aproach, 15 tiles aproach - 3 phases)

    then you might want to ask someone edit that script.
  5. Cadh20000 said:
    How do you set it to calculate distance from player? I can see how to set it to certain coordinates, or even check both its own location and the player's location, but not the distance between the 2.
    var1: set as player X
    var2: set as event X


    control command to substract Var1 from Var2, remainder is distance in X


    Repeat for distance in Y


    Use mathematical parts of control variable to calculate true distance from the distance in X and in Y


    You'll need a number of temporary variables and a dozen control variable commands but that is how you calculate in RM.
  6. Thank you.
  7. I got it to work, *With some help thanks btw*

    tumblr_n7vwc7zII51rmbmzco1_500.png

    as (Meandering = random)

         (Hunting = 40 and Custom *Move at Random Move towards player*)

          (chasing = 15 and aproach)

    I will balance  the number around Meandering, Hunting, Chasing, to make it more fair to the player.

    Thanks. I think I will add a link to the game once it's done/what I have at the end of the 30 days.