Jump to content

Scripts are cut at line 92


Recommended Posts

While trying to reanimate a number of scripts in a templatemission that i carried over from former DCS versions i encountered a problem with LUA-scripts in general.

 

Including a longer script like MIST or CTTP ends with the mission editor cutting the text at what is equal to line 92 in Notepad++.

 

This phenomenon takes effect for Trigger Action "DO SCRIPT" as well as for INITIALIZATION SCRIPT CODE.

 

I´ve tried a new and empty mission with the same result.

 

Mission is attached, however as stated above, a new mission generates the same effect.

 

Best regards

 

Herby

Testtemplate128.zip

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I just ran into this today for the first time. A new script I was working on inexplicably faults if loaded as DoScriptFile but works fine as a DoScript command. So that's what I was doing until I apparently passed the limit when I added some comments. For me it happened at line 128.

Link to comment
Share on other sites

  • ED Team

I am sorry guys, I totally dropped the ball on checking this one out, I am posting a vid of what I saw, and want to confirm that it is indeed what you guys are seeing as wrong. I will post the vid link shortly. And again, I am sorry... just trying to do too many things and this one slipped through the cracks... sorry guys :(

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

Eh sith- at least for my part I wasn't really commenting on your accountability for this problem... just kind of bringing it back to the surface since it doesn't appear to be an isolated one.

 

 

But yes, thank you for coming back to it!

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

I copy&pasted a dummy text into the mission description, blue/red task description and a DO SCRIPT action. The result was always the same - the text got truncated.

 

My dummy text was just 5000 times the character "x". This is what was saved in the .MIZ file:

 

attachment.php?attachmentid=99529&stc=1&d=1402185802

 

Note the status line of notepad: 4096 chars are selected (dark grey). At the end of the marked text, there are some funny characters. To me this heavily suggests that this is some kind of buffer overflow.

 

4096 chars are exactly 4 KB, which is a common size for such buffers. The funny chars at the end indicate that the text, that was copied into that buffer, was not terminated by a 0-byte (a C++ thing to indicate the end of a text) - because the text was way longer and actually did not end there.

 

Then, somewhere inbetween my text entry and saving the mission file, that text in the buffer was read out again, but it was read out beyond the end of it's defined size due to the missing 0-byte. Only accidentally an other 0-byte somewhere in the memory terminated the read out. This error could easily lead to a "c0000005" ("access violation", a programm tried to access a memory location that does not belong to it) - "The program stopped responding" error. :o)

1320757791_textlength.thumb.gif.7b6a0f9f1181fc81e322b7d6bab3086c.gif

Link to comment
Share on other sites

same problem here also... hope it gets fixed soon, also MIST is unusable...

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • ED Team

ok, I am seeing a 4143 character limit on the script window and things like briefing screen. I can paste it, it looks fine, but if I leave that window and go back, its cut off with 3 square characters. Each time I pasted what remained in to Notepad++ and it was 4143 characters.

 

39qn7qs1z-8

 

And you guys are saying this limit hasnt been here before, correct?

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

ok, I am seeing a 4143 character limit on the script window and things like briefing screen. I can paste it, it looks fine, but if I leave that window and go back, its cut off with 3 square characters. Each time I pasted what remained in to Notepad++ and it was 4143 characters.

 

39qn7qs1z-8

 

And you guys are saying this limit hasnt been here before, correct?

Yes, that is the effect. I think, it is 4096 charachters - the line endings might be tampered with by windows while copy&pasting it back from DCS to your editor. See my other posting for more details.

 

And I just tried it with an old 1.2.6 (no 1.2.7 available) installation: there is also a limit, but it is 8192 bytes (which is exactly twice of what we have now). And also, the 0-byte issue seems there not to be present - the text ends there cleanly without funny characters.


Edited by Flagrum
Link to comment
Share on other sites

A new script I was working on inexplicably faults if loaded as DoScriptFile...
Just in case anyone else is having the same problem, I found the solution: The encoding in Notepad++ needs to be set to 'UTF-8 without BOM'. I don't recall ever changing it, and TBH I don't remember if it was set to that before.
Edited by ajax
Link to comment
Share on other sites

  • 1 month later...

Yep, v129.30604, text windows are still limited. I have to use a Do Script File Action instead of my preferred Do Script.

 

Also the Briefing text windows have the same problem -- when saving my missions with this v129 the longer text is cut off.

 

WC

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • 2 months later...

v1.2.10.32275, October 2014

 

Cannot use Do Script because text windows are cut off at Line 92-93.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

I have a ? about the Do Script File and maybe someone can verify what I'm seeing...

 

How does the Do Script File work? :)

 

I load Mist with Do Script File event, and this file can then be seen inside of the .miz. Once the Mist file is inside of the mission file, then it seems that the file no longer needs to be present in its original path, and the Mist content is read into the mission from the embedded copy within the .miz.

 

 

This is good because it means that the mission can be transferred to another computer and run without needing the path and external Mist file (or any other file that is loaded up with Do Script File).

 

Once Do Script File loads an external file into the mission then that external file is no longer required.

 

 

Comments? Anyone experience anything different?

 

WC

 

 

(Remember when the Load Mission event would load a complete copy of the mission into the .miz file... I bet it was the same logic approach in that old way the Load Mission event worked. But in that case it was a flawed approach because that embedded .miz could itself have an embedded .miz -- I have seen as many as five levels of embedded .miz files in a mission, which made the file size very large.)

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

Once Do Script File loads an external file into the mission then that external file is no longer required.

Seems so. It caused me no end of pain trying to script because I would change the external file for testing and then be completely baffled by why the error message I got was the same no matter what I did.

 

Even knowing this now, scripting is still slow learning for me. I'm not a phenomenal coder, but it's something I can do. For some reason scripting in DCS just doesn't mesh with me at all.

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Link to comment
Share on other sites

Even knowing this now, scripting is still slow learning for me. I'm not a phenomenal coder, but it's something I can do. For some reason scripting in DCS just doesn't mesh with me at all.

 

I kind of feel that way, too. I can do fine in VBA and SQL, but LUA and Python are hard for me.

 

That said, I'm loading Mist to do mostly 'unit in zone' detection and set a flag. From that I use the traditional event logic in the ME. Here's a link to my flag scheme that helps me keep my events organized.

 

WC

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...