Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interactive Enemies on Map
#1
Interactive Enemies on Map
Version: 0.1

Introduction
This system allows you to put on your maps "enemy-events" that walk randomly unless the hero gets too close, in which case they start chasing him and start a battle in case of collision. The system also introduces a short period of "confusion" for the enemy after a successful escape, and a regeneration period after which a dead enemy is reborn. Finally, an animation can be displayed over the enemy when it detects the hero in its proximity.

Features
Read the Intro, it's pretty much everything there.

Screenshots

Demo
Here.

Instructions
  • Copy-paste the "Distance" script into your project. Copy-paste a sample enemy. Customize the on-map graphics of the event as you please.
  • Now, the first page of the enemy event is the one that's used when the hero is out of range. The movement type is Custom and in the Move Route command list you find a Call Script command with the code:
    Code:
    if distance_from_player() < 5 then $game_self_switches[[$game_map.map_id, self.id, "A"]]=true; @animation_id=119; $game_map.need_refresh = true; end
    Here you can customize the range (5 in this example), and the animation id (119).
  • The second page is used when the enemy is chasing the hero. The movement type is Custom and in the Move Route command list you find a Call Script command with the code:
    Code:
    if distance_from_player() > 5 then $game_self_switches[[$game_map.map_id, self.id, "A"]]=false; $game_map.need_refresh = true; end
    Here you can customize how far the hero needs to go from the enemy to make it stop chasing him (yes, it could be a value different from the range in the previous step). The Battle Processing command that actually calls the battle is also in this page.
  • The third page represents the after-escape phase. Here you can set its duration by changing the Wait command.
  • The fourth page shows the animation displayed when the enemy has been defeated.
  • The fifth and last page represents the regeneration period. Change the Wait command in order to make it last for the duration you want. Note that the algorithm introduces some randomness, hence what you can change is actually the average duration of this phase.

FAQ
Awaiting question.

Compatibility
Issues? I don't believe so.

Credits and Thanks

Author's Notes

Terms and Conditions
Exclusive to RMVXPUniverse. Credit me, or my mom will shoot!!!
Reply }
#2
I know Charlie is around here every once and awhile, so I had a question with this script:
On the second page that you mention, does that set how far the enemy leaves his origin point. or is it just based off of how far from it you are? I ask because I would like to be able to set sort of a maximum radius or area that an enemy will cover.
Reply }
#3
No, there is no limit on the area that an enemy covers. The logic there is that if you (the player) go further than a given distance value from the enemy (that meanwhile is chasing you) it will stop chasing, but it can follow you till the end of the map.
[Image: f7d70f7d-d21f-470a-b93d-fa23cfcfaeb5_zpsfe7368c0.png] [Image: facebook_icon.png] [Image: youtube_128x128-120x120.png] [Image: deviant.png] [Image: save-point.png]
Reply }




Users browsing this thread: