08-03-2009, 01:13 PM
Interactive Enemies on Map
Version: 0.1
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:
Here you can customize the range (5 in this example), and the animation id (119).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
- 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:
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.Code:if distance_from_player() > 5 then $game_self_switches[[$game_map.map_id, self.id, "A"]]=false; $game_map.need_refresh = true; end
- 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!!!