2133 active members
  285 are online

Year

19

Day

260

Time

10:07:16

Guest
Login
snewsgnewsmessagegeneralfactioninventorycombatroom
Message CentreRPG CentreQuestion Centre
Archives » Custom NPC scripts - any limit?
Year 13 Day 189 10:56
Ruben Wan

Hello,

I was wondering if there is a character limit fixed for the scripts that can be written for the custom NPCs.

I have searched for this information around, but I have not seen it.
If a limit exists, it could be nice to have it stated in the Rules page.


____________

Ruben Wan
KuTBv1W.png

Year 13 Day 189 17:26
I'm not sure there is, though I remember Onasha reported making a several thousand word script and was so long that it either caused her browser to crash when trying to upload it to the NPC, or just froze when she tried talking to it, not sure which.


____________

Ellias_sig6.png
Year 13 Day 189 19:41
Ruben Wan

Yes, I remember Onasha telling me she wrote a script 20-MS Word-page long and not working.

Now, the problem with turning a long script into smaller segments is that one has to rework from scratch for each segment (i.e. each custom NPC) and check all the references, etc.

By knowing the character limit, one could plan ahead and organize each segment at best.

However, even if sometimes it is easy to cut a script in segments because the whole subject is divided in sections, there could be cases where it is more difficult to divide the same subject among two or more custom NPCs (segments).

I suppose the text of the script is saved in a database field. Those who have access to the SWC database could easily check the parameters of the SQL field (http://help.scibit.com/mascon/masconMySQL_Field_Types.html).

Of course, I could find out myself by experimenting and coding a fake script of different lengths, but I don't want the SWC server to crash to get the info. :-)


____________

Ruben Wan
KuTBv1W.png

Year 13 Day 190 16:03
Or, you write shorter scripts and therefore bypass the limits.


Year 13 Day 195 2:30
Ruben Wan

Of course writing shorter scripts would work, but to try to make things clean, can one knows what is the character limit, and what "shorter than" means in practice when dealing with scripts?

A "shorter script" implies also the addition of another custom NPC (to get the same result with a long script, I need two NPCs instead of one) which costs CPs, and therefore a planning beforehand is necessary.

I think knowing the character limit does not pose any security issues, just add useful information for those (a few, I know) interested in writing scripts.


____________

Ruben Wan
KuTBv1W.png

Year 13 Day 198 10:04
Ruben Wan

For the benefit of all those who are curious and searched the forums for an answer to my same question, I can tell that I have written a fake script that - according to MS Word word count (unreliable) is long as follows:
* 937,710 characters including spaces
* 787,978 characters without spaces
* 165,708 words
* 484 pages
*16,646 paragraphs
* 24,602 rows.

The script was saved successfully. I stopped testing because I don't want to crash anything, just knowing if quite long scripts can be written. Yes, it is possible. Well over the 65,535 limit.


____________

Ruben Wan
KuTBv1W.png

Year 13 Day 199 12:51
Without looking I would guess the script field is a BLOB, so saving shouldn't be an issue, but did you try running it?


Year 13 Day 199 15:00
Ruben Wan

Yes, I run it and I had all differently named blocks, but of course I didn't set the references to go through all the blocks, and the run was limited to a few blocks.

I think that anyone can be sure to have plenty of space to write and feel relieved. :-)


EDIT: Wait, do you mean that the problems could be during the running? I don't think there would be, when saving it parses the script and points out possible errors. Therefore if he can parse the whole script before saving, it should be able to manage the script while running afterwards.


Edited By: Ruben Wan on Year 13 Day 199 15:02
____________

Ruben Wan
KuTBv1W.png

Year 13 Day 199 19:22
No, the issue was that when Onasha went to run the script, because it was so big it caused the window to freeze up or otherwise not load the script. She managed to save it just fine I believe.


____________

Ellias_sig6.png