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.

How to combine two scripts (and make it work)?

Totum

Member

Okay, I know this is a very basic problem: In my RMXP game I use the XAS Hero script as battle system but now I would like to "eharper256's Dynamic Time System" as a time system. I can not simply paste both scripts in the script editor as this creates errors like:

Script 'MOG - Scroll Panorama' line 106:NoMethodError occured.
undefined method '-' for nil:NilClass

My knowledge of scripting is very low so I probably did something stupid. Line 106 in the error refers to: "@pan_ox -= $game_variables[MOG::VARPANO_X]" I'm sure however this is not the only place in the scripts that causes trouble. I think lots of people use scripts like these together so I'm hopeful my problem can be solved and that I will learn what to do if I find other interesting scripts! :)




PS
I asked this question a while ago in the eharper256's Dynamic Time System topic.
DraycosGoldaryn then answered:
"Find, in the script (under the MOG class or module), where it defines VARPANO_X (for example VARPANO_X = [some number]) and change it to a different number. This is the id of an in-game variable and apparently, the one it is using is also being used by this system. So I suggest changing it to a different variable id, one that is not used by this time system. Also any other ones that might be the same, for example, if there is a VARPANO_X then there is probably also a VARPANO_Y and if so, this should probably need to be changed also."

I did find VARPANO, but was not able to solve the problem... :(
 
the error means that the object "@pan_ox" does not exist (yet). It is trying to subtract a value from a non-existent variable.
It's like asking for a piece of pie before the pie is even made.

Unless someone is already using both of those scripts, or wants to, they won't be inclined to track them down, implement them both in a project, and debug it.

I suggest you upload a demo of your game that has them both implemented according to their install instructions, then also provide a link to the instructions for both scripts. That way, any extraneous information (graphics files, etc...) will already be there.

It might just be an issue of 'order'. sometimes if you implement them in the opposite order they behave better. If it's a problem with conflicting statements, then it will just have to be debugged. While a lot of scripts are developed to be "Plug & Play", they are only "Plug & Play" when added to the default system in a fresh project. As soon as you add another script, "Plug & Play" goes out the window.

Be Well
 

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