[Solved] Novice needs help: duplicate and alter a script

Status
Not open for further replies.

Anthro7

Villager
Member
Joined
Feb 12, 2018
Messages
15
Reaction score
3
First Language
English
Primarily Uses
RMVXA
Hi. I need help. Sorry. My coding skills are suck.

So I've got Modern Algebra's quest journal script installed in the game I'm making ( ), and I like the way it works, so I want to use the same format for a second thing - a recipe book. When you open the menu from the game, it has added "Quests" to the options available there. Then further down in the script it lets you add information for individual quests. (You add them into your game and mark off when things are updated, completed, et al, via script calls. Sounds easy enough. I've gotten it to work on 11 quests so far with more to come.)

But now I want to use the same format to create an additional menu option, "Recipe Book". Ideally, I'd use the same sorts of script calls in game events to add "recipes" to the "Recipe Book".

Upon reaching a crafting table event, it would run a check to see if you've unlocked said recipe, if yes, allow crafting, if no, kickback. Or even easier, check character x's level, if => y, allow crafting, if no, kickback. (Because I'm planning that you unlock recipes by level reached. So it'll just run as a parallel in the background: if switch "character_x_level_2" is off, run check: if character x's level => 2, add recipe y, then turn switch "character_x_level_2" on. Or something like that.)

The last paragraph really has no bearing on what I'm asking for, it's just explanation. What I'm asking for is a way to duplicate Modern Algebra's awesome script, but alter the terminology. So far, every time I try to go through and replace everything myself, I get some kind of stack overflow error. =( So we're back to: clearly I'm a novice game maker and suck at coding. I've done something wrong in thinking that copy/paste/alter-terms would do the trick. Anyone understand this stuff better who could explain to me what all I need to change to get this idea to work?

Thanky. =(

EDIT: D'X I'm sorry, I don't know how to make the pastebin link act like a link instead of an insert! I've tried changing the BBS code twice and nothing works!
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
stack overflow error
This is because you...
duplicate Modern Algebra's awesome script
If I'm anywhere close to accurate..
When the same code is used it will often give you a stack overflow. Also if you were to call a method inside the method.
So you basically have this script in your game twice.

In order for you to do what you want, you will have to find a different script that is similar in function
Or, change almost all of MA Quest script to something else.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
the problem here is that when duplicating a script, all it's function names are duplicated.
and that will never work, each of the functions in the entire game needs to have their own, unique name.
The same goes for any global variable defined in any script.

so you'll either have to rewrite every single function and most variables in the script or use a different one.
 

Anthro7

Villager
Member
Joined
Feb 12, 2018
Messages
15
Reaction score
3
First Language
English
Primarily Uses
RMVXA
HEY! I got it to work! Yay! I so happeh!

Following you guys' train of thought a little further down the track, I copied the whole script into Word and used the Replace command to swap "quest" (non case sensitive) to "recipe".

Didn't work.

Went through the thing line by line looking for possible problems.
Changed the Menu Index from 4 to 5 for where it would draw it.

Didn't work. (And after later testing, it turns out it simply bumps to 5 if they're to write to the same place.)

Found a thing that said "maqj" and was like, "What the heck kind of command is- OH! Modern Algebra Quest Journal! Well, let's replace all instances of that and see if it works."

Doo~doo~doo~doooooooooo!!!!!

So thank you, guys! Case closed!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,227
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games? And, if so, would any of you be interested in a short, proof of concept type non-euclidian puzzle game?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,234
Members
137,608
Latest member
Arm9
Top