Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: T-Man on January 29, 2014, 08:05:53 am

Title: Concept: Raw Mission Code editor in FRED
Post by: T-Man on January 29, 2014, 08:05:53 am
Had a little idea I wanted to run by a coder. How feasible would an editor in FREDOpen that loaded the mission's raw data, and allow edits through it (almost like going into the HTML of a webpage), be?

I've recently gotten into opening mission files in notepad to get the raw code form, and even though I'm not a major coder myself I'm finding it incredibly useful; if you understand the code layout, you can transplant SEXPs from other missions quite easily, and I even managed to recover a corrupted mission through it once (had an un $ed semicolon in a message, never, EVER do that btw! :shaking:). AFAIK to do this at the moment you have to open notepad and FRED separately, and what you modify in one wont affect the mission in the other, so saving the wrong one could undo all your work; you either have to open one at a time or be very careful saving.

If doable, having a similar editor feature within FRED itself (perhaps as a menu you open like the others, with a text window, an apply button and an undo button) would allow just the one version being edited, and a FREDer would have the ability to switch between working through the editor or through coding on the fly, which I like the idea of. I concede it would also be a brilliant way to utterly destroy your mission if you mistyped code, but I imagine most starting FREDers would ignore it till they got used to the code.

Thoughts welcome.

(I would also like to propose it be called the "LIKE A BOSS Editor", because every time I do it I my mind screams that meme! :lol:)
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: The E on January 29, 2014, 08:24:06 am
I am all for a text-based event editor. Other areas do not lend themselves all that well to being directly edited, I believe.
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: General Battuta on January 29, 2014, 08:47:14 am
It'd be cool, but bear in mind the functionality you're replacing here is 'save mission, open in Notepad, edit, save in notepad, press 'revert' in FRED'. That's not a super heavy workflow.
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: T-Man on January 29, 2014, 08:58:15 am
I am all for a text-based event editor. Other areas do not lend themselves all that well to being directly edited, I believe.
Ah, that would be a problem (had in my head it was how the other editors worked so it might work, sounds like not).

It'd be cool, but bear in mind the functionality you're replacing here is 'save mission, open in Notepad, edit, save in notepad, press 'revert' in FRED'. That's not a super heavy workflow.
That is true, I didn't think of that (never really used that button); that's certainly easier than having to close and re-open the mission, which is what I thought you'd have to do.

Cheers for the responses though guys :).
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: The E on January 29, 2014, 09:00:33 am
Now, what would be really useful is true function calls in sexps (and sexp libraries that can exist independent of missions), but that's rather far away, I think.
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: AdmiralRalwood on January 29, 2014, 09:12:04 am
I even managed to recover a corrupted mission through it once (had an un $ed semicolon in a message, never, EVER do that btw! :shaking:).
If you use a semicolon in FRED2_Open, it automatically converts it to "$semicolon"; is that a recent change?
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: General Battuta on January 29, 2014, 09:28:45 am
Not if you put it in with Notepad.
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: AdmiralRalwood on January 29, 2014, 09:32:03 am
Not if you put it in with Notepad.
Okay, but by "recover a corrupted mission through [notepad]" I assumed he meant the mission got corrupted because of something he did in FRED.
Title: Re: Concept: Raw Mission Code editor in FRED
Post by: General Battuta on January 29, 2014, 09:34:35 am
The automatic semicolon conversion wasn't always there either. I think it's fairly recent.