Author Topic: Concept: Raw Mission Code editor in FRED  (Read 2301 times)

0 Members and 1 Guest are viewing this topic.

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Concept: Raw Mission Code editor in FRED
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:)
« Last Edit: January 29, 2014, 08:09:20 am by T-Man »
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Concept: Raw Mission Code editor in FRED
I am all for a text-based event editor. Other areas do not lend themselves all that well to being directly edited, I believe.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Concept: Raw Mission Code editor in FRED
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.

 

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Re: Concept: Raw Mission Code editor in FRED
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 :).
« Last Edit: January 29, 2014, 09:04:55 am by T-Man »
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Concept: Raw Mission Code editor in FRED
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.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Concept: Raw Mission Code editor in FRED
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?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

  

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Concept: Raw Mission Code editor in FRED
Not if you put it in with Notepad.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Concept: Raw Mission Code editor in FRED
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.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Concept: Raw Mission Code editor in FRED
The automatic semicolon conversion wasn't always there either. I think it's fairly recent.