How make script longer than 12 lines? ***SOLVED***

Status
Not open for further replies.

Kilitar

Veteran
Veteran
Joined
Jul 28, 2015
Messages
141
Reaction score
41
First Language
czech
Primarily Uses
RMMV
I wrote my JS script in external editor and its about 200 lines. 


Then I want copy it into common event. 


RPG Maker Editor wont alow me paste more than 12 lines into script window. 


EventCommands -> 3dpage -> Advanced -> Scripts.


Above 12 lines its truncated.


Shift(alt, ctrl) + enter does not work to. Build-In MV help says almost nothing about this damn unresizable tiny box.


Is the only solution to make loooooooooooooooooooooong line mess to deal with this issue?
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
965
Reaction score
708
First Language
English
Primarily Uses
RMMV
If you cannot convert the script to a miniature plugin, then minify the code. Keep a readable copy of the code somewhere and use the minified code in the script box.
 
Last edited by a moderator:

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
449
Reaction score
149
First Language
Not English
Primarily Uses
N/A
Vertical is limited but horizontal I think it's unlimited. 


So you can write it in horizontal and put ; between every code
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
965
Reaction score
708
First Language
English
Primarily Uses
RMMV
@mrcopra Yeap, which is essentially what minify'ing does: compacting the code to a single line (until it eventually wraps around).
 

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
136
Reaction score
104
First Language
Ukrainian
if script calls going one after another then it will execute script calls as one big script. So you can just split your code.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,563
Reaction score
6,889
First Language
German
Primarily Uses
RMMV
@Kilitar


If you have a 200-line script, then that is more like a full plugin. Just give it the framework, placed it as a plugin and call its functions from the script call box.


Because that is what the script command is mainly for: calling and controlling functions from plugins.


It should not be used for large functions and calculations at all, only for minor calculations or for calling functions that are provided by plugins.
 

Kilitar

Veteran
Veteran
Joined
Jul 28, 2015
Messages
141
Reaction score
41
First Language
czech
Primarily Uses
RMMV
Thank you all.
Andar, unfortunatelly - I am totally lost with plugins. I dont understand their structure (I do not understand object oriented programming logic at all).  I usually use Yanfly notebox eval code and keep it understable and readable with heap of comments for future use. 


This script I am not able to solve with standard eval/notebox command. There are dozens of conditional branches and loop cycles. I expect whole script to be about 2k lines. 


I have 10 actors. Each has 64 uniques self variables - which represent their mastery in profficiency). Each profficiency can have value 0-100 and based on its value will apply various bonuses. 


For Example. Actor 1 - Animal Knowledge variable with value 15 should apply state which adds Animal Element resistance 100%-15%= 85% and also Amplify +15% every Attack Element Animal skill. 


Which is achieved by apply 4 states State Animal Knowledge +8%, Animal Knowledge +4%, Animal Knowledge +2%, Animal Knowledge +1%.


But when Actor train Animal Knowledge from 15 to 16, I need remove all 4 previous states and apply Animal Knowledge + 16%.


Funny is, this script is mostly for "debug purposes" if something did not go wrong and if all mechanics works as intended. 
At start it should reset All "profficiency states" from all 10 actors. Which is relatively simple. And I already separated it from whole block. 


Then it should apply correct states combination for each actor variable set values. 


In fact, it all could be done without script box. But with 10 actors * 64 variables * 100 possible combinations it is bit too much work :)  i can skip with proper math outside editor commands. 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,563
Reaction score
6,889
First Language
German
Primarily Uses
RMMV
Then go and post your script in the plugin request or in the plugin support forum and ask how to turn that into a plugin.


I can't tell you myself as I haven't worked with that, but I know that it's only a few steps if you know how.
 

Dad3353

Veteran
Veteran
Joined
Mar 9, 2016
Messages
421
Reaction score
108
First Language
English
Primarily Uses
if script calls going one after another then it will execute script calls as one big script. So you can just split your code.


I tried this, but could not get my 5 consecutive scripts to run ('Unexpected end etc...).


I, too, use Scripts simply as Scripts. I'm not (yet...) familiar with plugins, and my simple needs don't warrant them. Commented, my code is 50 lines of Script. Without comments, only half of that. Yes, I can 'minimise' it (and have done...), but no longer have the comments. It works, so that's fine, but it would have been so much easier to simply write my Script into Notepad ++, then paste it into the Script Editor box.


Is there a technical reason for this (rather than the 'one should not create long Scripts'...)..? It seems so easy to have so much more flexibility. I'd understand better if I knew the reasoning behind this limitation.
 

Kilitar

Veteran
Veteran
Joined
Jul 28, 2015
Messages
141
Reaction score
41
First Language
czech
Primarily Uses
RMMV
Then go and post your script in the plugin request or in the plugin support forum and ask how to turn that into a plugin.


I can't tell you myself as I haven't worked with that, but I know that it's only a few steps if you know how.


Thank you for inspiration.


I found better solution with same results, Only 4 scripts each 5 lines long was necessary, rest could be arranged using editor "flow control" tools. 


One reason why I did not use it before is mainly I had BIG problem with nested LOOPS when Break loops works totally weird and unpredictable - and whole script was laggy (compared to fully javascripted versions) or got stuck in infinite cycles - while same logic used by javascript works like charm. I thought its engine problem with too much variables in long nested cycles. 


All was solved when I found forum topic, which informs about "strange nested loops behaviour" and suggests using Label/Jump to label to break from cycle.




Anyway, I also found how force nested loops works like expected, You need put break loop directly above "Repeat Above" command.  


I marked this as "solved". Thank you all for your time. 
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

I usually don't enjoy survival games, but I absolutely love Conan Exiles.
Basically Everyone: Dont make a long game the first time. Me: I guess i'll make a REALLY long game in that case >:p
I've developed a habit of thanking cleaning ladies for their work.
Sorry Aerith... I will abandon your shoes... :guffaw:
Spent a whole bunch of time today reworking the area in the video because someone said it was too illusory. So I reworked it so it changes less, moved the grass up to the same level as the player.... And found enough extra resources to make the grass moves when the player touches it. Also lots more water, because it looks amazing. I'll probably put up a short updated video later today.

Forum statistics

Threads
95,773
Messages
931,783
Members
126,172
Latest member
webbmichael
Top