Author Topic: Is there a way to copy events from one file to another?  (Read 3285 times)

0 Members and 1 Guest are viewing this topic.

Offline Lorric

  • 212
Is there a way to copy events from one file to another?
That "shortcut" post reminded me to ask this question. The spacebar thing I didn't know. I've wondered this for a while, though I'm guessing there isn't. But is there?

It hasn't been too much of an impediment if there is so far, since my events are fairly short and simple for the most part, though it would be nice to be able to paste in recurring events. Message chains are something I could shave a lot of time off though, simply because I use some pretty long ones, and the whole "right click on OP, choose add data, choose option, scroll back up to OP and repeat" thing could be skipped, simply by pasting in a long message chain from another file. Then all I'd have to do is change the data.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Is there a way to copy events from one file to another?
Notepad

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
Notepad

Oh? How exactly? I'm going to open up FRED and Notepad to test it out.

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Is there a way to copy events from one file to another?
IIRC you should navigate thought the text to find the #Events section, look for the "body" of the event you want to copy and paste it on the new file, remember to change the event count on the new file (not sure if necessary but I never wanted to find out).

Also, take in mind that you'll need any assets (ships, with their names correctly set or messages) that the event currently uses.

I think that's it, maybe... and just maybe, it would be better to make a copy of the mission you want to get the event from and delete everything else you don't need just leaving the event there.
el hombre vicio...

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
IIRC you should navigate thought the text to find the #Events section, look for the "body" of the event you want to copy and paste it on the new file, remember to change the event count on the new file (not sure if necessary but I never wanted to find out).

Also, take in mind that you'll need any assets (ships, with their names correctly set or messages) that the event currently uses.

I think that's it, maybe... and just maybe, it would be better to make a copy of the mission you want to get the event from and delete everything else you don't need just leaving the event there.

I'm not sure what you mean.

I'm in the Events Edit section of FRED with a long message chain ready to try this.

But I can't get anything to copy from FRED to the notepad. I also don't know what you mean by event count.

I've seen other events with wrong ship names and such. Obviously they won't function until fixed, but they can be there waiting to be fixed. Of course, if it was possible to get what was needed into the notepad, I guess they could be fixed up there too before being moved to the other FRED file.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Is there a way to copy events from one file to another?
You don't copy from FRED to notepad or notepad to FRED. You copy from notepad to notepad, using the text versions of your mission files. Back it up first.

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Is there a way to copy events from one file to another?
nono, that's not it.

Edit:

What Battuta said, you need to close Fred2, open the mission file with Notepad, then open the other mission file in another Notepad window, and search for the events there.

Copy the contents to the new file on the #Events section and that's it.
If the event/events are using messages then you'll need to copy the corresponding entries from the #Messages section as well.


Little tut:

Here's what a sexp looks like on Notepad:

Code: [Select]
$Formula: ( when
   ( true )
   ( ship-guardian-threshold
      ( rand-multiple 60 25 )
      "asdsax"
   )
   ( ship-guardian-threshold
      ( rand-multiple 82 39 )
      "xxx"
   )
   ( ship-guardian-threshold
      ( rand-multiple 73 12 )
      "xxxx"
   )
   ( ship-subsys-guardian-threshold
      ( rand-multiple 60 25 )
      "xxx"
      "<all engines>"
   )
   ( ship-subsys-guardian-threshold
      ( rand-multiple 77 39 )
      "x"
      "<all engines>"
   )
   ( ship-subsys-guardian-threshold
      ( rand-multiple 80 5 )
      "xx"
      "<all engines>"
   )
   ( ship-subsys-guardian-threshold
      ( rand-multiple 54 10 )
      "xxx"
      "<all engines>"
   )
   ( turret-lock-all "Tzxce" "fgerg" )
)
+Name: Start
+Repeat Count: 1
+Interval: 1
+Team: 0

You need to copy from the $Formula tag to the next $Formula (avoid the next $formula as it is part of the next event of course), the event name you'll find it below the formula, on the +Name section.
Then navigate to the #Messages section and copy the messages used, a message looks like this:

Code: [Select]
$Name: A (xxxx)
$Team: -1
$MessageNew:  XSTR("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", -1)
$end_multi_text
+AVI Name: Head-TP3
+Wave Name: msg.wav
« Last Edit: December 31, 2012, 01:47:01 pm by Rodo »
el hombre vicio...

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
I tried before your edit Rodo. So I didn't put in the messages, and FRED crashed.  :)

The second time it didn't crash, but I got loads of errors, and it didn't load.

Maybe because it's just an empty mission file without the ships and stuff there?

Stand by, I'm going to try and get something more simple to work first.

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
Well, I tried making a second backup copy of the mission I've been tinkering with, removed the event that stops the player from jumping out from the second copy then pasted it back in there from the first, and it worked. I'm going to see if I can do the same now by deleting the message chain and messages and see if I can put them back in.

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Is there a way to copy events from one file to another?
Of course, the new mission file needs the other sections as well, the ships, waypoints and background sections should be filled up.

A good tactic might be grabbing the original mission and deleting all that you don't need from there, then saving as a new file.
If not just create a new mission from Fred with the ships/waypoints you need and copy back the events and messages you need.
el hombre vicio...

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
Well, I got it to work.

Really? Would it not work if the background was different in another mission, even though it was just a message chain? Or do I understand that wrong?

I tried making a fresh mission file, and implanting both messages only (no events) and the background from the mission I was tinkering with, and both went off without a hitch. Messages only will stop the irritation of having to select that noise for the game to make when a message is displayed every single time. It's so easy to forget to do it!

Thanks for all your help by the way people. It is very much appreciated. I should be able to shave some significant time off my FREDding with this.

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
And I've now managed to get my chain into the fresh mission as well, by putting a # in front of all the ship names, so there was nothing the game needed to display it. That's what I've been doing now for missions, but there were still some remnants of my old way of picking ships before I discovered you could do this.

Thanks again for your help.  :D

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Is there a way to copy events from one file to another?
No you don't need the same background stuff, the only thing required is that there should be a #background section (as well as all the other #sections) on the file, even if it's empty, but that is just related to how FS2 and FRED parses the text file.

IMO the best way to do this is the way you chose before, making a mission in FRED2 and then pasting the things you need from one file to another.
el hombre vicio...

 

Offline Lorric

  • 212
Re: Is there a way to copy events from one file to another?
No you don't need the same background stuff, the only thing required is that there should be a #background section (as well as all the other #sections) on the file, even if it's empty, but that is just related to how FS2 and FRED parses the text file.

IMO the best way to do this is the way you chose before, making a mission in FRED2 and then pasting the things you need from one file to another.

Thanks.

Ha ha, now we need someone else to ask a "shortcut" style question. And then someone else. And when it's done we'll be pumping out missions in no time!  :D

 
Re: Is there a way to copy events from one file to another?
Sorta related: when copying/removing ships/events/whathaveyou in Notepad, is it necessary to adjust the count (e.g. after the #Events header)? Does FRED use it for e.g. validation, or is it really just for information?

  

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Is there a way to copy events from one file to another?
No, that's just information FRED generates by itself (Remember that ; is a comment character, and the ship count is after one)
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 Lorric

  • 212
Re: Is there a way to copy events from one file to another?
Oh, no need to adjust the count? That's good because I was adjusting it.  :)