Page 1 of 1

Improving your code

Posted: Mon Mar 06, 2017 3:11 am
by ShutDownMan
Hello people,
I'm here now to show you guys one way to improve your SFD projects...

I've made a "mini-program" some time ago, in python, just for me. The program was simple, it "welded up" the text of files inside a folder (and all sub-folders) so I could separate my code into different files. It was simple but effective, my code felt more organized, I could do more complex things without worrying about forgetting where all the pieces of the code went...

Then I started using Visual Studio, and it just got crazier, now with all the IDE + the ability to separate classes into different files I did some of my most "useless" scripts for SFD:
Image

The IDE made it all easier: The syntax check, the auto-complete, the intellisense...
Image

As I liked so much this program, I thought of sharing it with you guys. So I remade the program, now in C#, and added some more features to it. it's not the best UI I've ever made, but it's OK (I will leave the zipped project in the links part, if you wanna mess around with it).

Maybe you don't really want to make "complex scripts", but I'm sure you don't like to scroll up and down on a near 1000 lines file, it's pure PAIN!

To make it easier to understand the program usage, I've made this video clarifying the overall how-to:
https://youtu.be/GkRT5Oh22vQ
Use the pause button, the video is meant for that.


Version 1.0:
- Simple UI;
- Options:
-- Change output file name;
-- Change input file extension;
-- Code to clipboard;
-- Save used configs (input/output files paths);
-- Recent input paths;
- Snippets:
-- New project;
-- New class;

Notes:
You can always edit the snippets, they are located at the .\\Configs\\Snippets.
Also, NEVER use the word "Temporary" in your files name, the program will ignore it (in short: because Visual Studio)


Links:
Executable: Mega
Source Project: Mega

Re: Improving your code

Posted: Mon Mar 06, 2017 7:23 pm
by Gurt
Neat. I'm linking this from viewtopic.php?f=15&t=1588&p=10365#p10365.

Re: Improving your code

Posted: Tue Mar 07, 2017 9:08 pm
by jamisco
Wait..How'd you get the banana to display in the map?

Re: Improving your code

Posted: Tue Mar 07, 2017 11:25 pm
by ShutDownMan
jamisco wrote:Wait..How'd you get the banana to display in the map?
Short answer:
You can make "pixels" with Text objects,
You can change the text color through code.

Re: Improving your code

Posted: Fri Mar 10, 2017 7:42 am
by jamisco
Holy mac and cheese ...how long that take you m8?

Re: Improving your code

Posted: Fri Mar 10, 2017 3:59 pm
by ShutDownMan
jamisco wrote:Holy mac and cheese ...how long that take you m8?
Oh, no man, I didn't do it by hand, I automated it and the only challenging part was to make it "play".

I made a simple python script that generated a string of C# code with the information of frames and pixels. Then I used that to color the TextObjects. Technically I can play any GIF, but actually just small enough that don't crash the compiler.

"So, how long?"
Some hours...

Re: Improving your code

Posted: Sun Mar 12, 2017 2:56 am
by jamisco
I now have this weird urge to learn python.... also by any chance is there a way u could make that gif like move around the map like a real player could?

Re: Improving your code

Posted: Tue Mar 14, 2017 5:16 pm
by ShutDownMan
jamisco wrote:I now have this weird urge to learn python.... also by any chance is there a way u could make that gif like move around the map like a real player could?
You definitely don't want to do that... The "canvas" I work on have (5*8)*(6*8) "pixels" on it, this is 1920 TextObjects and moving them would be a disaster...

But, if you make a fighter animation and make it move inside the canvas, you can place the canvas so it looks like the fighter is moving, and as the background can be invisible (I have control over the alpha value) it will look like a normal fighter.

Re: Improving your code

Posted: Wed Nov 18, 2020 10:46 am
by Juansero29
Hey, anyone has still access to this program? Links seem broken and I really need it

Update: Thanks to @Odex64 who had a local copy in his drive. He sent it to me, and now I've uploaded a new mirror in mega: https://mega.nz/file/4AMWlR6L#kSXMjdYtu ... T_JxGi-9uY

Re: Improving your code

Posted: Wed Nov 18, 2020 11:27 am
by Odex64
Juansero29 wrote:
Wed Nov 18, 2020 10:46 am
Hey, anyone has still access to this program? Links seem broken and I really need it
I'll dm you the executable..