.:: Alex Erne :: PHP/MySQL & Unity3D/C# projects ::.
Recent news
Like me on Facebook
* advertisement *
  05 March 2014 - Airships, encounters & events :: Posted in RPG Maker VX Ace
It's probably a Japanese RPG thing, but there's a firm believe that the moment you enter an airship (hmm... airship - yes it is a Japanese RPG thing ) you're safe to travel everywhere. Well, in my opinion, there is no such thing as a safe sky in any fantasy settings. Rocs, dragons and other nasty flying beasts live there and are most certainly not impressed by your puny airship...

Then there is an odd thing in RPG Maker that you can't let your airship 'participate' in events on the map at all. And it's those events that I wanted to use to clip maps together, allowing me to make one huge map. Where characters can use these events to move to the next map, as well as boats, airships are doomed to stay on one map. I thought to change that, and I did

Let me start with the main part that allows airships to participate in events on the map.
 photo 2014-03-05_00002_zpsc46b0d22.jpg
Line 345 removes the 'through' flag for the airship. You need to remove this flag because if you don't, the airship will never trigger an event because it just goes through them. Oddly enough this only affects the other events on the map the airship encounters. The impassable tiles are not affected by this line.
To avoid you can't fly over things as chests (which are map events), you have to set the 'through' flag for these. But that would mean that your characters on foot would be able to move through them. Well, drop an (invisible) impassable tile below them and you're done!

...and while writing this and looking at lines 381 and 384 I found out that they basically rule each other out. As it is now, or in it's original writing, no random encounter from the ground will be triggered So please ignore those 2 lines and only look at 345...

So, we can trigger events on the ground now. But what about monsters (as event, not the random map encounters)? Yes, you trigger those as well. But that's pretty easy to work avoid.
 photo Screenshot2014-03-05200842_zps2063a39d.png
Just make a 'Conditional Branch: Airship is Driven' statement in the event and drop the monster encounter under the 'Else' part (sadly RPG Maker doesn't know an IF NOT statement for events). You should do this only for ground monsters. Monsters that can fly (rocs and dragons to name two) you can leave the Conditional Branch statement for so that they can attack you both in air and on the ground.

Last but not least, random encounters in the air. Earlier I've said that map encounters will not work, but we do want random encounters, don't we? Well, that needs a bit of event scripting...
 photo Screenshot2014-03-05203454_zps0f438317.png
Lets start with a delay of 60 frames. This should be around 1 second unless you have a real huge map with lots of events causing a drop in framerate. This delay is required for two reasons.
   1. Letting the script run continuesly will cause lag all by itself. The delay will lower the call to this routine and thus cause less lag.
   2. Letting the script check 60 times a second for an encounter is a bit overkill and will result in quite a lot of encounters during your flight
Then we have that 'Conditional Branch: Airship is Driven' statement again, but this time we run it directly instead of in the 'else' part (we want an encounter for when you're in the airship). In this statement we pick a random number - 1d100 seemed just right for me and we follow it by yet an other 'Conditional Branch:' statement. But this time we check if the number is smaller or equal to 5, giving us a 5% chance for a random encounter (feel free to change this number to your needs). 

In this example I have used only 1 encounter for 2 bats to appear. But you could run yet an other 1d100 and use the result to make a differentiation in the encounter. I could imagine that there's a 1% chance that you bump into a dragon, a 50% chance to bump into anything common and things like that.

That's it for today, I'm off to experiment some more in RPG Maker. Happy flying in your airship and be careful for that dragon out there

Post A Comment!
* advertisement *
* advertisement *

This website is Copyright © 2009 - 2016 Alex Erné
PHP/MySQL coding by Alex Erné Copyright © 2009 - 2016 Alex Erné
...all rights reserved...

AE games™ and the AE games logo are Trademarks owned by Alex Erné
TetraGems™, Burst-a-Bubble™ and the Burst-a-Bubble logo are Trademarks owned by Alex Erné