Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Call Common Event At Fight End [Resolved]

Sooth

Sponsor

I'd like to call a Common Event when the fight ends in victory: preferably, when the battle screen has actually cleared and you're back on the map. The Common Event will do a number of things in different circumstances but mostly, it will restore the whole party and reset numerous variables used with fights.

I tried to do this myself, in my infantile-to-nonexistent scripting abilities, by going to Scene_Battle1, Battle Ends, and around line 150 or so right below Scene.Map.new, placing: "$game_temp.common_event_id = [50]"

This causes my game to give the following error after fights:

Script 'Interpreter 1' line 72: NoMethodError occurred.
undefined method '>' for [50]:Array

I tried using a neat script I found at http://rmrk.net/index.php?topic=41716.0 -- but it's for RMVX, and it causes an error when I start the game related to class Scene_Base.

I will accept pretty much any solution, a keenly directed "Here's where you can put it in yourself", "Here's how to make what you're already doing not crash", or a script that does this, a link to a script that does this already, or whatever. Thanks for the assistance.
 
I'm not completely sure how common events are called, but for starters, you could get rid of the [] around "50" in your call (the script expects an integer, but you're feeding it an array instead).

If that doesn't work, I'll try looking into the scripts themselves to see how they work.
 

Eventing_Guy

Awesome Bro

Well... instead of making things SUPER complex... why not:

Make your common Event like -

(Common Event : Activates if [Switch] Fight: ON : Auto-Run)

- During the begining of a battle [Switch] Fight is turned ON

- Since that is ON, after the fight is OVER... Common Event Innitiates
and does what you want it to do... and at the END of the Common Event.

- [Switch] Fight = OFF
 

Sooth

Sponsor

Both of those work, actually. I'm one to try and use as few scripts as possible but since I had the script line already there, I just took off the brackets and now it does what I want it to. I'll keep the switching method in mind for the future. Thanks.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top