enemies (event) randomly appear and disappear

● ARCHIVED · READ-ONLY
Started by kiros 5 posts View original ↗
  1. hi there

    I'm trying to populate a map with events that will trigger a battle when in contact with player (imagine bats flying around in the map)

    These events (bats) will appear at random
    Page 1: (no condition) / No sprite / parallel process
    random variable 1..10.
    if variable > 7: self.A = On

    Page 2: self.A / bat sprite / touch event
    trigger battle
    if win: self.B = ON / self.A = OFF

    Page 3: self.B / No sprite / parallel process
    wait for some time
    self.B + OFF​
    Thus returning to the beginning and start over

    What I'm trying to do is for the even(bat) to disappear at random as well.
    Basically akin to have a event touch & parallel process on the same event.

    And because that is to have multiple of these events in the map, to have one background event to switch off 'switches' is counter intuitive.

    So, is that a way around it? or I would have to have hundreds of variables (one for each event) to make it work?
  2. Sorry, Typing from a phone.

    Can you choreograph your bats with a background parallel event, and then use self-switches to make then visible or not? Use something like a single variable to calculate between one and a hundred (or five hundred or whatever depending on frequency). Then if it comes up 1-n where n is the number of bats you have, it flips the switch of that bat.
  3. Not sure if I got it quite right...

    The bat will appear/disappear depending on the value of self-variable
    A parallel event will random a number, let's say 10
    Then bat[10].self-switch will set to off!

    But how can I access the self switch of another event to switch it off? (if I got you right)
    If I had the bat decide by itself, then I could not start a battle upon touch.
  4. Apologies about the lengthy delayed response. Took awhile for me to get back to the computer.

    I've put together a demo that should illustrate what you are trying to do using Yanfly's Self-Switch plugin. I've zipped up a file that has the events (both for your bats and for the parallel event running it all).

    The bats will blink in and out at random, and if one hits you while visible, right now it will pop up text "Encounter", but in theory you could adapt that. The appear/disappear right now is also very abrupt (since the switch flips and they blink out/in), but in theory once you see the logic you could increase the content of what happens when the condition is met.

    I'll private message you with a link where you can download the demo project I built for you to check it out.
  5. Thank you very much

    That's exactly what I was looking for.
    I'm using self switches/variables from Yanfly but I had little to no knowledge on the lunatic mode (barely had a need to use it)

    Once more, thank you