Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Comments
[SOLVED] Comments
This topic is locked. You can no longer write replies here.
Aug 27 2011, 3:41 am
By: IAGG  

Aug 27 2011, 3:41 am IAGG Post #1



Is there a program that anyone knows about that can remove mass amounts of comments from triggers? Id rather take the easy way out instead of going through probably over 1k triggers and removing the comments one at a time... for each map***



None.

Aug 27 2011, 3:48 am Aristocrat Post #2



Use SCMDraft, open up the triggers in trigedit. Copy-paste the text triggers to a text editor, then use the following regular expression find-replace:

Find: \n\tComment\(.*\n
Replace with: \n

This should delete any lines beginning with the characters "Comment(".



None.

Aug 27 2011, 4:08 am Roy Post #3

An artist's depiction of an Extended Unit Death

A lot of protectors/unprotectors will automatically remove comments, so unless you're reaching the string limit, there's no necessity for doing this yourself.

If you are hitting the string limit, a simple find/replace like Aristocrat specified is probably the easiest method for accomplishing this. Alternatively, if you have any unprotectors, you can check their settings to see if you can only select "Remove Trigger Comments," which should work for the map even if you're not technically unprotecting it.




Aug 27 2011, 4:34 am Vrael Post #4



I just wrote a little program to do it for you (cause I'm gonna need it too at some point :P ). Gimme a sec to link it.

Edit: there we go "CommentRemover.zip"

https://skydrive.live.com/?cid=681c2250300dd052#!/?cid=681c2250300dd052&sc=documents&uc=1&id=681C2250300DD052%21109

Post has been edited 1 time(s), last time on Aug 27 2011, 4:45 am by Vrael.



None.

Aug 27 2011, 6:29 am IAGG Post #5



Quote from Aristocrat
Use SCMDraft, open up the triggers in trigedit. Copy-paste the text triggers to a text editor, then use the following regular expression find-replace:

Find: \n\tComment\(.*\n
Replace with: \n

This should delete any lines beginning with the characters "Comment(".

Im having an issue replacing all the comments the way u suggested. Here is a sample of a trigger that i copy and pasted right from the triged.

Trigger("Player 8"){
Conditions:
Always();

Actions:
Wait(0);
Set Switch("hyper trig", set);
Wait(0);
Preserve Trigger();
Comment("Hyper Trig");
}

//-----------------------------------------------------------------//


Also, when i go to paste the "replaced text" back into the trigedit, its not saving it. im assuming i just put something in their incorrectly and it wont take the change?

If i cant get the following program to run for me im going to go with this method. thanks

Quote from Vrael
I just wrote a little program to do it for you (cause I'm gonna need it too at some point :P ). Gimme a sec to link it.

Edit: there we go "CommentRemover.zip"

https://skydrive.live.com/?cid=681c2250300dd052#!/?cid=681c2250300dd052&sc=documents&uc=1&id=681C2250300DD052%21109

"This application has failed to start because MSVCP100.dll was not found. Re-installing the application may fix this problem."

??? is this an error on my end ???

Post has been edited 1 time(s), last time on Aug 27 2011, 6:44 am by IAGG.



None.

Aug 27 2011, 6:50 am Lanthanide Post #6



When you paste the triggers back into trigedit (or indeed, do any modifications you want to save), you have to click the Compile button (actually it doesn't appear to have a name).

This is the button on the end of the toolbar that looks like black tick with a blue square in it. When you click this, it will check that all of your triggers are valid and don't have any errors, and pop up a dialog. The box always says "Error at line xx" in it, but if the second one says "done!" then everything went ok and your triggers will be saved. If there was an error, the 2nd message will show the line number where the error occurred and hopefully a useful message to work out what's wrong.



None.

Aug 27 2011, 7:42 am IAGG Post #7



Aight that worked well for me. Though i am getting an error surprise surprise haha. Can i get an example trigger pasted?

I was assuming this would be the resulted trigger

Trigger("Player 8"){
Conditions:
Always();

Actions:
Wait(0);
Set Switch("hyper trig", set);
Wait(0);
Preserve Trigger();
\n("Hyper Trig");
}

//-----------------------------------------------------------------//




None.

Aug 27 2011, 8:44 am Lanthanide Post #8



Which text editor are you using to do the find and replace?

Aristocrat's search string won't work in Notepad++, for example.

In Notepad++, click Search menu - Replace, in the box that pops up click Regular expression at the bottom.
Find: Comment\(.*
Replace: [Nothing - just leave this empty]

Click Find a couple of times and make sure it correctly locates the comments you want to delete. Then click Replace All.


The reason your new trigger was rejected it because it went from:
Comment("Hyper Trig");
to
\n("Hyper Trig");

Whatever program you used to do the find/replace did not correctly interpret the regular expression that Aristocrat gave, in particular "\n" is a standard way of writing "new line", but the program you used simply put the characters \ and n into your trigger, instead of putting a new line character. But actually you don't need to put in a new line (and Notepad++ has very poor handling for new lines in regular expressions so it's best to avoid using them wherever possible), you can simply delete the comment string as my suggestion above does, and trigedit should be happy with it.



None.

Aug 27 2011, 7:56 pm IAGG Post #9



i was just using a normal txt file and replacing. i used notepad++ and it worked perfectly. Thank you!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
Please log in to shout.


Members Online: RIVE, Roy, jun3hong