Staredit Network > Forums > SC1 Mapping Tools > Topic: Trigger Sorter
Trigger Sorter
Jun 17 2009, 5:48 am
By: Vrael  

Jun 19 2009, 3:21 am Vrael Post #21



Well, how about that! I changed the program so that it splits Force and All Players triggers into the 8 player .txt files. Those triggers will keep their Trigger titles, like "Trigger(Player1, Player2, Player3)" or Trigger("Force 1"), but a simple find-and-replace in Notepad++ or a similar utility should fix that easily if you want the actual order that your triggers will fire in, after putting them back in SCMDraft. This wasn't as hard as I thought it would be! After using this, doing a few find&replaces, then pasting back into SCMDraft in order from P1-8, this should produce the actual order that triggers will run in. I wonder if organizing them like this will reduce lag in SC at all, since it has to take SC some time to check all the triggers too.

Link to new program, source, and readme: http://cid-681c2250300dd052.skydrive.live.com/self.aspx/Public/Trigger%20Filter.zip

Edit: added some functionality. Here's the Readme:

Trigger Filter.exe v2.00
By Vrael@USEast:

This program has 3 modes:

1). Split mode - A trigger containing multiple players in the Trigger(" "){ line will be filtered into multiple player files
All Force triggers will be filtered into all of their respective players
Triggers with one player will be filtered into one file
(creates runtime order after some find&replace tweaking)

2). Dump mode - Triggers with one player will be filtered into one file
All other triggers will be filtered into a 9th "dump" file

3). Separate mode - Triggers with one player will be filtered into one file
Triggers with one force will be filtered into one file
Triggers with multiple players will be filtered into multiple player files



Program Instructions:
1). Copy text triggers from SCMDraft into a .txt file
2). Place Trigger Filter.exe and a text file of your triggers "triggers.txt" or "bobs_guns.txt" whatever you like
in the same folder.
3). Run Trigger Filter.exe (double click or whatever method you prefer)
4). Follow program instructions



For unused forces, simply input an invalid force name like "Doesn't exist" or "YouSuck"

Post has been edited 2 time(s), last time on Jun 19 2009, 5:46 am by Vrael.



None.

Jun 20 2009, 12:43 am Falkoner Post #22



Well, it works :P Just a bit much to enter everything, but I guess since I'm not using it often it's not really an issue, nice job :)



None.

Jun 20 2009, 2:06 am Falkoner Post #23



Hmm, well, I went ahead and decided to work on a bit of a menu system for it, tell me what you think, if you like it I can add it to the rest of the program:
[attach=3758]

Attachments:
TriggerFilter-Sexy.exe
Hits: 5 Size: 508.34kb



None.

Jun 20 2009, 2:45 am Vrael Post #24



lol! Very nice Falk, you clearly know a bit more C++ than I do (no idea how to add colors, for examle :D ). I don't really think it needs the menu or anything because it's really a very simple program to do a simple task, but if you want to go ahead and post your version with the colors and menu that's fine with me, it's clearly open source, source code right in the .zip and all. Only thing you should do for your menu is have an escape sequence for people who don't agree to the terms of the disclaimer. It doesn't explicitly say what to do if you don't agree to the terms and conditions (not like it really matters since it's like, SEN and no one else using it, doubt anyone's going to be suing anyone, but still it's a nice thought).

And now that I think about it, I guess you're right I coulda used loops for a lot of the stuff I brute-forced... oh well! lol. It was mostly copy-paste for the brute stuff anyway, didn't take too long. No bug/glitches or anything though I hope?



None.

Jun 20 2009, 5:34 am Falkoner Post #25



Well, I just have a bit more experience with visuals, from working on my little RPG.

Quote
And now that I think about it, I guess you're right I coulda used loops for a lot of the stuff I brute-forced... oh well! lol. It was mostly copy-paste for the brute stuff anyway, didn't take too long. No bug/glitches or anything though I hope?

It seems to work perfectly for me, but yeah, that's one thing that I've learned with programming, to reduce brute-forcing as much as possible, especially with large projects, it was fine in this case, since you only needed to do it once, but if you're trying to change something in a brute-forced program it's a total hassle..



None.

Jun 20 2009, 11:10 am Ahli Post #26

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

the menu in the sexy exe doesn't show up properly for me. Btw, can you explain me how you did the colors? :D




Jun 20 2009, 5:46 pm Falkoner Post #27



Quote
the menu in the sexy exe doesn't show up properly for me. Btw, can you explain me how you did the colors? :D

Hmm, maybe you have your console set to something different than the norm.

Basically, to do it I used two functions I got from Farty a while ago, setcolor, and gotoxy, setcolor you can kinda get using the system("color <insert hex here>") command, however, that colorizes the entire windows the same, so if you want different colors, you need to use setcolor, here's the two functions:

Code
void setcolor(int color) //Allows the changing of color for a single spot, number 0-255
{
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE );
    SetConsoleTextAttribute(hOut, color);
}

void gotoxy(short x, short y) //Moves cursor to an XY position on the console
{
    HANDLE hConsoleOutput;
    COORD Cursor_an_Pos = {x,y};
    hConsoleOutput = GetStdHandle (STD_OUTPUT_HANDLE);
    SetConsoleCursorPosition(hConsoleOutput, Cursor_an_Pos);
}


I think they both require windows.h



None.

Jun 21 2009, 10:52 am Ahli Post #28

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

the problem with the sexy exe is that:
-the arrow is in the wrong line.
It jumps between "Dump File", "All Seperate Files" and the black below it...




Jun 21 2009, 1:08 pm Falkoner Post #29



Quote
the problem with the sexy exe is that:
-the arrow is in the wrong line.
It jumps between "Dump File", "All Seperate Files" and the black below it...

O rly? That is very odd.. Works perfectly fine for me, I wonder what causes the difference on your system..



None.

Jun 22 2009, 4:39 am Vrael Post #30



I think I found the problem. C++ is compiled directly into machine code, which can be specific to the architecture of the processor/other hardware and the operating system. I think that's what is causing the problems here, not the code itself.

Maybe someone like SI could help us out in making it more platform-compatible. I'll e-mail him.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:49 am]
KrayZee -- NudeRaider
NudeRaider shouted: Bar Refaeli careful, might be a scam
a careful scam might be a,
[05:01 am]
NudeRaider -- Bar Refaeli
Bar Refaeli shouted: Hello, for a mere 20 minerals I can not only double, but triple your minerals with a whopping return of 14 minerals!! (original investment not refunded) Msg me while supplies last
careful, might be a scam
[2018-10-18. : 2:08 am]
Bar Refaeli -- ily
[2018-10-18. : 1:19 am]
Pr0nogo -- play golf now at mike.com/riteaid
[2018-10-17. : 9:56 pm]
MTiger156 -- wut... ?_?
[2018-10-17. : 5:13 pm]
Dem0n -- hmmmmmmm
[2018-10-17. : 5:09 pm]
Bar Refaeli -- Hello, for a mere 20 minerals I can not only double, but triple your minerals with a whopping return of 14 minerals!! (original investment not refunded) Msg me while supplies last
[2018-10-17. : 5:04 pm]
Bar Refaeli -- :wob:
[2018-10-17. : 1:41 am]
Pr0nogo -- SENs like youtube is down
[2018-10-17. : 1:19 am]
MasterJohnny -- seems like youtube is down
Please log in to shout.


Members Online: Roy, lifebot