Adding Code Objects To Battles

GammaVD

Veteran
Veteran
Joined
Oct 29, 2015
Messages
70
Reaction score
3
First Language
English
Background - Trying to make a 'Paper Mario Thousand Year Door' style audience

Ok, so I got just one little problem at the moment, or major issue....I need to add an 'audience' to a battle but not as part of either the Party or Troop or Unit (doing so means that their are multiple copies of 'audience' rather than one)

The 'audience' needs to be able to be referenced by both the Party and the Troop, as it influences TP gain

To make it clear, I just need to know where I need to put the call for initialising the 'audience', not anything on setting up or coding the 'audience' itself, just how to get it to start in a battle, and remove it when the battle ends (coders will understand why)
 

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
279
First Language
Portuguese
If this will only happen in some specific encounters, your best course of action is use Battle Events.

On the Database Editor, in the Troops area, select the encounter that will have the Audience.

In the lower area of this window you can set up events. Set one page with the condition to fire at turn 0+0 (start of battle) with a scope of Battle (once per battle). Use this page to initialize the crowd (you can insert script commands in the Event window, use that to call your script that initializes the Audience).

I don't remember right now if there was a Battle End condition for events there too; if there isn't, you may do this in BattleManager.updateBattleEnd
 
Last edited by a moderator:

GammaVD

Veteran
Veteran
Joined
Oct 29, 2015
Messages
70
Reaction score
3
First Language
English
Well, just tried that and got a TypeError "undefined is not a function"

Looking at the error log I don't think the engine/plugins like me calling a function inside the Battle Event window

TypeError: undefined is not a function

    at Game_Interpreter.eval (eval at <anonymous> (file:///C:/.../js/rpg_objects.js:10436:10), <anonymous>:1:10)

    at Game_Interpreter.command355 (file:///C:/.../js/rpg_objects.js:10436:5)

    at Game_Interpreter.executeCommand (file:///C:/.../js/rpg_objects.js:8894:34)

    at Game_Interpreter.update (file:///C:/.../js/rpg_objects.js:8802:19)

    at Game_Troop.updateInterpreter (file:///C:/.../js/rpg_objects.js:5195:23)

    at Function.BattleManager.updateEventMain (file:///C:/.../js/rpg_managers.js:1920:16)

    at Function.BattleManager.updateEvent (file:///C:/.../js/plugins/YEP_BattleEngineCore.js:1224:21)

    at Function.BattleManager.update (file:///C:/.../js/plugins/YEP_BattleEngineCore.js:1182:33)

    at Scene_Battle.updateBattleProcess (file:///C:/.../rpg_scenes.js:2050:23)

    at Scene_Battle.update (file:///C:/.../js/rpg_scenes.js:2042:14)

 

The other problem is it needs to run for every battle, so a coded solution is probably the preferable on, I should note I am a competent coder with some prior experience with js, I'm just not that versed in some of RMs logic

 

Edit: I'm a dumbie (again) and wrote Audience.initialize when i should have wrote new Audience()

 

Also, if I use this method I should be able to just use Yanfly's Base Troop Events plugin
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top