News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Every Modders Nightmare  (Read 29957 times)

0 Members and 1 Guest are viewing this topic.

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,137
  • Gender: Male
  • Just a dood doing dood things.
    • View Profile
    • My channel.
Every Modders Nightmare
« on: May 28, 2014, 06:23:49 AM »
Yes.... I am talking about Lua File Corruption.

Mysterious is its way. How it happends? I have no idea. Why it happends, we also dont know.
Perhaps MadmaN himself could be the only one in this community who could give an answer, or some clue.

Why am I talking about this?
Well... I want to make more awareness of this problem which strikes down hours, days, weeks, months even YEARS in some cases of hard work.
Figuring out all you need just for the whole thing to collapse.
Ive expirienced this a dozens of times.
Once it is corrupted, it cannot be used.

Ive noticed a few levels of corruption, I am no way near 100% right, but that is what ive gathered from those occasions :

Level 1 - You must copy the code, delete it and paste it again in the same file.
Level 2 - You need to copy the code into a different file.
Level 3 - You cannot copy the code, you must write the code in a different file, typing the entire thing again.

Here are a few of my mods which has suffered from this :

Russell Mod - Main script got a level 3 corruption 2 times. 2 side scripts got a Level 2 once. 1 Side script got a level 3.
WWE Mod - Main script got a level 3 one time, unfortuantly, it was accidently deleted from the computer (not in the recycling bin).
Bully Myth's and Legends - Each of the monster scripts has suffered a level 3 LUA corruption.

What do we do if our file gets a level 3 corruption?
Nothing, were fucked.
Yet there is a cure, but it must not be forgotten.
Since what happend to Russell Mod, which consisted the biggest amount of code I have ever scripted in my entire modding career (if you can call it like that :P )
I make a backup file every 100 - 500 lines of script I make and keep the old backups as well.
Thing is, at some point, you have like 10 - 20 files and its hard to keep track.

Please, be safe with your scripts, make backups and hopefully there will be an answer soon.
Good luck and happy modding.

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: Every Modders Nightmare
« Reply #1 on: May 28, 2014, 06:53:32 AM »
I got exposed to a Level 2 on my first official script attempt for Zombie Edition (or Zombie Mod as it was known as at the time).
Good thread, d0c. Very crunchy and delicious.
Want me to sticky it?

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,137
  • Gender: Male
  • Just a dood doing dood things.
    • View Profile
    • My channel.
Re: Every Modders Nightmare
« Reply #2 on: May 28, 2014, 06:55:24 AM »
Sure thing.
As long as people become more aware of this.
Its really sad that people who get a level 3 (me being one of them) have to write thousands of lines of codes again just because of this problem.

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: Every Modders Nightmare
« Reply #3 on: May 28, 2014, 08:26:24 AM »
Wouldn't it just be possible to copy and paste it into the standard notepad, then back into a new file?

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,137
  • Gender: Male
  • Just a dood doing dood things.
    • View Profile
    • My channel.
Re: Every Modders Nightmare
« Reply #4 on: May 28, 2014, 09:02:26 AM »
Tried that too.
Didn't work.

Offline WhenLifeGivesYouLemons

  • xfire: 1emonthatsme
  • Sr. Member
  • ***
  • Posts: 971
  • Gender: Male
  • 波動バースト
    • View Profile
Re: Every Modders Nightmare
« Reply #5 on: May 28, 2014, 01:25:12 PM »
Tried that too.
Didn't work.
then you suck :P

jk

but i mean if Luac detects a problem... it doesn't lie

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,137
  • Gender: Male
  • Just a dood doing dood things.
    • View Profile
    • My channel.
Re: Every Modders Nightmare
« Reply #6 on: May 28, 2014, 02:28:05 PM »
Tried that too.
Didn't work.
then you suck :P

jk

but i mean if Luac detects a problem... it doesn't lie

The LUAC doesn't tell you if there is a problem.
The way you know that your script is corrupted is that it no longer works. Now you must be asking : "Are you sure you didn't fuck up the script with your last changes?"
Well let me answer this :

Pressing control Z up to the part your script was before you made the first edit since it got fucked up and trying it and it still fucks up, that means that its corrupted.

There may even be a level 4 corruption which means that you cant even open up the script, but there is no solid proof of its existence, as none has expirienced this yet, just a theory I am having.
I will keep updating each time I gather new info about this.
My current number 1 suspect is viruses coming from the net, as anti viruses cant protect your computer 100%.
« Last Edit: May 28, 2014, 02:47:41 PM by c00ld0c26 »

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: Every Modders Nightmare
« Reply #7 on: May 29, 2014, 05:03:47 PM »
This appears to be a issue centered around notepad++.

My upcoming Bully Lua IDE will fix this issue and allow easier editing of lua scripts. I will try to make more time in the upcoming weeks to get that finished and in the hands of some testers to see how well it performs "in the field" before declaring a final release. This IDE will allow not only editing the lua scripts properly...but will also allow compiling them directly from the editor since it will have a hook to work with the lua compiler of which I am working on trying to rewrite a brand new one that has more usability....as well as built in syntax checking and repairs as well as a built in bully lua function glossery that will allow looking up any function from bully and see how it is supposed to be used within the code.

This should make modding far easier and even more popular and I will likely see if I can get a couple of our resident modders here that also know coding pretty well to help out on this to speed things up.

I will make a formal announcement in another topic probably in a couple days if I get time.

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Every Modders Nightmare
« Reply #8 on: July 04, 2014, 02:01:26 PM »
I've never experienced anything like this, lucky me xD

FaZe

  • Guest
Re: Every Modders Nightmare
« Reply #9 on: July 20, 2014, 12:20:03 PM »
I always get Level 2 or 3. That's why I kinda stopped modding in LUA.
It got very fucking boring, very fucking quickly when this kept happening. I either prefer to mod in a different language or console, or to not mod at all..

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Every Modders Nightmare
« Reply #10 on: July 25, 2014, 06:00:27 AM »
I don't see why this would corrupt your files... because all notepad++ should do is text edit. However, it does save some extra stuff on your files I believe. Like for example, make a 'test.txt' just to see a lil test I'm about to tell you in action.
First test
Open it in regular notepad, hold down a key/letter until it goes off the right of the screen (So that the scroll bar gets created going left/right)
Now delete all those letters, and save and close it. When you open it back up, the scroll bar is gone.
Second test
Now open it in notepad++, do the same thing, type until it goes off the right of the screen. When you see the scrolling bar at the bottom, delete all the letters. You see that the bar stays there, even though no letters are still off the screen. I find this annoying, but anyway save and close it. Open it again, now you see it still has the bar even when you re-opened it.

That proves that notepad++ saves extra data on your files
So... I think this corruption must be something Notepad++ saved to your file that the lua compiler does not like.

That also may be why I never experienced it, because I never let my letters go off to the right of the screen because I find the scrolling bar at the bottom annoying and a waste of room. I think that scrolling bar may just be our issue.

So finally, in conclusion, I see 2 ways to fix this problem.
1) Don't type past the right of the screen in notepad++
2) Copy all the text to regular notepad and save as a new file
3) Just use a different text editor.


tbh I still don't see why this would be messing it up very much but, can't really think of what else the issue could be.

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Every Modders Nightmare
« Reply #11 on: August 14, 2014, 11:00:22 PM »
What I said above is bullshit now I think lol. Thought it might of been the cause at the time of posting though.

Anyway I think I may have the problem solved. SWEGTA tells me there is a 140 KB limit on script mods. Maybe that is the problem? If so I suggest copying the code to multiple scripts then using ImportScript() to use all the scripts in the one.

Just make sure main(), and MissionSetup()/MissionCleanup() if a ArcRace/mission mod stays in the main file that you are replacing. Then put about half the other functions in another script and use ImportScript("ScriptName2.lua") to import it. Once you import a script, you can use all the functions contained in the script.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Every Modders Nightmare
« Reply #12 on: August 15, 2014, 11:16:11 PM »
I don't see why this would corrupt your files... because all notepad++ should do is text edit. However, it does save some extra stuff on your files I believe. Like for example, make a 'test.txt' just to see a lil test I'm about to tell you in action.
First test
Open it in regular notepad, hold down a key/letter until it goes off the right of the screen (So that the scroll bar gets created going left/right)
Now delete all those letters, and save and close it. When you open it back up, the scroll bar is gone.
Second test
Now open it in notepad++, do the same thing, type until it goes off the right of the screen. When you see the scrolling bar at the bottom, delete all the letters. You see that the bar stays there, even though no letters are still off the screen. I find this annoying, but anyway save and close it. Open it again, now you see it still has the bar even when you re-opened it.

That proves that notepad++ saves extra data on your files
So... I think this corruption must be something Notepad++ saved to your file that the lua compiler does not like.

That also may be why I never experienced it, because I never let my letters go off to the right of the screen because I find the scrolling bar at the bottom annoying and a waste of room. I think that scrolling bar may just be our issue.

So finally, in conclusion, I see 2 ways to fix this problem.
1) Don't type past the right of the screen in notepad++
2) Copy all the text to regular notepad and save as a new file
3) Just use a different text editor.


tbh I still don't see why this would be messing it up very much but, can't really think of what else the issue could be.
Just put Word Wrap on, and then problem solved. That's what I do, even for the regular notepad, because I find it annoying that I have to scroll to the right just to read text. Word Wrap basically detects when you are about to go off the right of the screen, then it creates a new line. You're still on the exact same line, it just looks like you're not. If you make the fonts smaller, it will fit more on one line.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Every Modders Nightmare
« Reply #13 on: October 05, 2014, 01:13:37 PM »
Thing is, at some point, you have like 10 - 20 files and its hard to keep track.
Just name the Lua file to the name of the time and date posted. Like this: month-day-year_time-time (eg. 10-4-14_4-12)

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: Every Modders Nightmare
« Reply #14 on: October 05, 2014, 04:48:16 PM »
The limit is actually 114 kb if I recall correctly.