RSS

A Blue Flame, A Lantern, and A Brazier (mostly event system)

Click the link below to see a video of this in action (The frame rate is only low because of the video capture program):

One thing to notice is that the Blue Flame event doesn’t go through walls and roof tiles.  I used the same terrain settings as the KALE script, but if you aren’t using that script then the terrain numbers can be anything you desire.

Note: This requires you to set up your terrain settings properly in the Database’s Tileset tab for each setting that you want the Blue Flame event to not travel through stuff.

This uses some complex eventing so I wouldn’t recommend this to people who aren’t familiar with the eventing system of Ace yet.  This uses the script function of the Conditional Branch event command and Get Location Info command as well.

In this system I use Yanfly’s Button Common Events (YBCE) and Khas’ Awesome Light Effects (KALE) scripts, but neither one needs to be used and can be substituted with similar scripts.

I made it in this particular way so that I can copy and paste these events on any map without having to worry which event number they are, which helps me make less mistakes.

Note:  The Blue Flame event needs to be copied to every map that you wish the player to use it on and if it isn’t on every map it won’t error out, but you may need to do some minor work a rounds to keep a blue flame from appearing when the player gets to a map with a blue flame on it. An example of this will be shown further down.

If you would prefer to have a project to follow along with, download it here.  I didn’t include KALE script or the Light Folder you have to add to the graphics folder, because I didn’t want to accidentally violate Khas’ terms of service (download it from the link above).  Add them before running the playtest.  I changed nothing important in the script or Light Folder.

So here is an explanation of the events so you can configure to your desires and maybe learn something.

Setting up the scripts

This is the only thing I changed in the KALE script and I only change this to 100 so that Item Processing command windows are not darkened by the script, but doesn’t need to be changed for this system, this is just a little tip.

This applies the dark layer for the KALE script.

This sets up common events 2 (as the A key) and 3 (as the D key) to button presses.

This is the Lantern common event (#3):

The first conditional branch is only needed because the KALE script only allows one dynamic light source, if you use a different type of light effects script this may not be needed.  The condition is set so that if you are using the Blue Flame event, it won’t trigger.  The second conditional branch checks to see if you have the Lantern on, if it is then it hides the light effect and turns of the Lantern‘s switch, but if it isn’t on then it turns on the light effects and turns on the Lantern‘s switch.

The conditional branch sees if the Blue Flame event is running, if it is on it does nothing and if it is off it turns on the switch.  This is done to keep the player from activating the Blue Flame event before it finishes.  If you don’t want the Blue Flame event on every map you would want to use this alternative:

This adds a conditional branch that makes sure the Blue Flame event is enabled.  Turn this switch on and off during map transfers to turn it on and off when needed.  This can also be used if you don’t want the player to start with the Blue Flame event.

The Blue Flame Event

The Conditions – Switch [100] is On is used so the event can be turned on and off easily with the A key (via the Button Common Events script).  The graphic is blank so you don’t have to move the Blue Flame event somewhere out of site when its placed/ been used.  Trigger must be Parallel Process.  Options must be Through and the other ones can be tweaked depending on what graphics you use.  Autonomous Movement‘s Speed and Frequency can be changed to effect how it moves.

@event_id assigns this events id to the variable.  I’ve done it this way so you don’t have to make this event a specific event number on every map.  The control switch is important for Brazier event.

Here the players x and y positions on the map are stored in Variables then the Condition Branches check the direction the player is facing and adjusts the Player X or Player Y variable so that when the Set Event Location command is used it places the Blue Flame event in front of the player and facing the right direction as well.

This is straight from the KALE script if you want to use a different light effects script this is where you would add the light effect to the Blue Flame event.  Mostly I point this out because of where it is at in the event. It’s why the light will still shine if next to a wall.  If you don’t want to use a light effect remove this section.

This calls this common event:

This basically stores the players x and y coordinates in variables and the Conditional Branches check the direction the player is facing and adjusts the appropriate Player X or Player Y variable so that when we use the Get Location Info command we are checking the square in front of the player and storing the terrain ID in the Terrain ID variable (number 98).

These conditional branches are used to check the terrain in front of the player to make sure they aren’t standing in front of a wall or roof tile, if they are, it will stop the Blue Flame event’s graphics from showing, unless you are facing up at a wall.  It also plays a SE effect to indicate that it has hit a wall and Jump to Label: End Fireball Move skip the processing of the event past the moving phase.  If the Terrain ID variable is anything, but 5 or 6 this section is passed over.

This is where the graphic is added to the event.  If you want to use a different graphic to say make this an arrow instead this is where you would change this and don’t forget to change all instantaneous of this in the section above and below as well.

This is where the Blue Flame event moves.  It loops as long as it hasn’t moved the maximum number of spaces; set at the Conditional Branch: Variable [0099:Blue Flame Move Count] < 4.  As long as the terrain in front of the Blue Flame event  it uses this:

This moves the Blue Flame event forward one space and plays a sound effect.  The move count increases by one and then jumps back to the top of the loop to check everything again.

The loop uses a slightly different common event to check if the space in front of the Blue Flame event as opposed to the player like the one before:

This can be used for any event you make like this, such as if you make an arrow and a blue flame.

This is where the Blue Flame event ends.  This clears the move variable changes the graphic of the event to nothing so it won’t show any more and turns off the Blue Flame event related switches.  The conditional branch is used because KALE script only allows one dynamic light.  If you are using a different light effect that uses multiple dynamic lights then just turn this one’s light effects off here.  The conditional branch can be eliminated if you aren’t using a light effect.

The Brazier Event

Trigger must be Parallel Process.

The first conditional branch checks if the Blue Flame event is running.  It uses Switch [97] because if it runs before the Blue Flame event assigns Variable [100] it will error out.  The second conditional branch checks if the Blue Flame event is passing through the Brazier event but is to long to show on the screen here is what it is:

$game_map.events[$game_variables[100]] is the Blue Flame event and $game_map.events[@event_id] is the Brazier event.  The .x and .y check the respective x and y coordinates of the events.  The && requires the two statement both be satisfied.

If both conditions are met then a small animation is shown (its just Fire One animation reduced to 25% and recolored).  Then the self switch activates page 3 of the Brazier event:

This keeps the event from triggering again.  The Comment: [light 1] is KALE specific, replace with appropriate light effect if used.

Back to page 1:

The conditional branch is just like using the Trigger – Action Button. The second conditional branch checks to see if the player is next to the Brazier event, but it gets cut of as well:

$game_player.x/ $game_player.y is the player’s x/ y coordinate and is modified to check if the player is next to the Brazier event.  New thing here is || which is used to add a line break and effectively in this case means Or.

If both conditions are met then a small animation is shown (its just Fire One animation reduced to 25%).  Then the self switch activates page 2 of the Brazier event:

This is just like page 3, but with a different graphic.

For Reference

Switches and Variables used for this.

Click here to see how I set up the puzzle.

If you have any questions feel free to ask and if you notice anything that could be simplified I’m always willing to take suggestions.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: