Page 2 of 4

Re: Custom Set Editor - Sneak preview

PostPosted: 06 Jan 2010, 21:00
by Bog Wraith
ok, thanx for the heads up on it! 8)

Re: Custom Set Editor - Sneak preview

PostPosted: 06 Jan 2010, 22:00
by mathusalem
Ok what do you think of that ?

Re: Custom Set Editor - Sneak preview

PostPosted: 06 Jan 2010, 22:19
by DrJones
I took a look at the code and I think you problems might arise with this editor and cards like Punishing Fire where the code expects the card to have a certain card ID. Usually hard coded numbers always cause problems, and the alternative of generating a cards.h file full of lines such as:

"#define CARD_PUNISHING_FIRE 1645"

to avoid magic numbers isn't great either, as it would require compiling afterwards. Now that I talk about code, how about adding a "#define Opp (1-player)" line at the start of the code? It would make the card functions more readable. I used Opp because it's shorter than Opponent.

Re: Custom Set Editor - Sneak preview

PostPosted: 06 Jan 2010, 23:11
by Bog Wraith
mathusalem wrote:Ok what do you think of that ?
Mathy, you have a great designer's eye. It shows on all the graphics you work on.

This is clean, neat and well organized. The eye stays on a level plane and the functions are laid out efficiently & logically.

I really like the look of this GUI old friend! 8)

Re: Custom Set Editor - Sneak preview

PostPosted: 06 Jan 2010, 23:40
by mathusalem
:oops: :oops: t'ankiou !
I hope Jatill will like it as well

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 13:02
by jatill
mathusalem wrote::oops: :oops: t'ankiou !
I hope Jatill will like it as well
I like it, but I'm concerned about the load time. The app already takes 30 seconds to loads; I'm not sure how much longer adding the images would take.

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 13:04
by jatill
DrJones wrote:I took a look at the code and I think you problems might arise with this editor and cards like Punishing Fire where the code expects the card to have a certain card ID. Usually hard coded numbers always cause problems, and the alternative of generating a cards.h file full of lines such as:

"#define CARD_PUNISHING_FIRE 1645"

to avoid magic numbers isn't great either, as it would require compiling afterwards. Now that I talk about code, how about adding a "#define Opp (1-player)" line at the start of the code? It would make the card functions more readable. I used Opp because it's shorter than Opponent.
I don't know a ton about C, but doesn't a define lock in the value? player is dynamic, so would opp change every time player changes?

I'm aware of the hard-coded id issue, and I have plans to solve it. I wrote a function called get_id_by_name, so we can refer to cards by name instead, so it doesn't matter when the ids change.

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 13:09
by mathusalem
jatill wrote:
mathusalem wrote::oops: :oops: t'ankiou !
I hope Jatill will like it as well
I like it, but I'm concerned about the load time. The app already takes 30 seconds to loads; I'm not sure how much longer adding the images would take.
it shouldn't take long actually.

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 13:42
by DrJones
jatill wrote:I don't know a ton about C, but doesn't a define lock in the value? player is dynamic, so would opp change every time player changes?

I'm aware of the hard-coded id issue, and I have plans to solve it. I wrote a function called get_id_by_name, so we can refer to cards by name instead, so it doesn't matter when the ids change.
Define is used by the C preprocessor to change all instances of A for B before compiling. It's like using the replace text function in a text editor. So in this case it replaces "Opp" by the string "(1-player)", instead of the value player had at that point. Define itself has to be used with care because bad use generates bugs hard to spot, but in this case is totally safe. Using a function to get the ids works as long as the function is in an extern dll that is compiled by your editor, or reads the list from a file at the start of the game.

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 14:04
by jatill
DrJones wrote:Using a function to get the ids works as long as the function is in an extern dll that is compiled by your editor, or reads the list from a file at the start of the game.
Thanks for the tip on define. Good to know; I'm sure we'll take your suggestion.

My editor doesn't compile anything. The function will read from MagicCustom.exe at the start of the same, as you suggest.

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 14:34
by mathusalem
Jatill, do you need the image in a specific format to try it ? if you want I can make a png with working buttons on Fireworks. it takes transparencies. or is th jpeg sufficient ?

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 14:38
by jatill
jpg is probably best.

Everything is separate images, so I'd need 1 background image, 1 for each button, etc. (the buttons are just copy, paste, and search - save and exit are gone)

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 19:55
by jatill
Okay, I have a "working" version ready for testing. Any brave volunteers?

Here are the instructions:
http://www.slightlymagic.net/wiki/My_20 ... n_and_FAQs

You probably want to back up your magic directory, just in case (though I don't think anything bad will happen). The instructions reference several different downloads. Right now they are all zipped together here:

http://axifile.com?9498084
and you'll actually need to overwrite the exe in that file with this one:
http://axifile.com?3678449


Good luck, and please report back, success or fail.

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 21:31
by Gargaroz
Ops, I did a mistake : I run the my2000.exe with the old version of customseteditor.exe. Then, when I realized, I overwrited the old program and re-run my2000.exe, but, alas, all the cards are disappeared from the columns. What can I do now ?

Re: Custom Set Editor - Sneak preview

PostPosted: 07 Jan 2010, 21:44
by jatill
Gargaroz wrote: all the cards are disappeared from the columns. What can I do now ?
Oops, that was a bug. Here's the new exe with sweet new graphics.
http://axifile.com?3678449

I'm not sure if I need to create another installer for this or not. If so, It'll have to wait until tomorrow. Enjoy!