Bas' random questions regarding card coding

For all your questions regarding Image Card Coding.
Please read the Image Posting Guideline & Index before posting in this forum.
Forum rules
DO NOT POST BUG REPORT IN THIS FORUM !!

Please read carefully the forum rules related to the card coding section : viewtopic.php?f=21&t=1545

All post will be edited to follow forum rules.
User avatar
Bas
Posts: 425
Joined: Sat Dec 26, 2015 10:55 pm
Location: Germany

Re: Bas' random questions regarding card coding

Post by Bas »

Can you tell me why this simple code doesn't work?

Code: Select all

####
###Scry Dummies
####
[card]
name=Scry1D
mana={0}
auto={T}: may moveto(mylibrary) target(*|mygraveyard)
auto=@each my endofturn: sacrifice
text=Dummy Scry1 Token
type=artifact
[/card]

[card]
name=Scry2D
mana={0}
auto={T}: may moveto(mylibrary) target(*|mygraveyard)
auto={T}: may moveto(mylibrary) target(*|mygraveyard)
auto=@each my endofturn: sacrifice
text=Dummy Scry2 Token
type=artifact
[/card]

[card]
primitive=Scry1D
id=4000845
rarity=T
[/card]

[card]
primitive=Scry2D
id=4000846
rarity=T
[/card]
Forums are down atm.

Please join the discord server in order to not miss stuff and be reachable:
https://discord.gg/JHK5pVaK5p

(You are not required to install the software, you can use it in a browser as well, albeit I recommend installing)
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Bas' random questions regarding card coding

Post by Zethfox »

Ok generally i highly discourage the use of token wprkaround, it is by far the worst of all workaround which is why i added support for creating menus. But im willing to help...targeting 2 objects should not be a problem, target( has the ability to target 1 more than 1 or upto a vertain amount. Examples are all over the primitives, cards like kodagama reach, ect, doing a quick search with cntrl F in primitive file should point you in the direction.

What exactly is it doing? What do you want it to do? Lets start there.
kevlahnota
Posts: 619
Joined: Tue Feb 08, 2011 3:00 pm
Location: Philippines
Contact:

Re: Bas' random questions regarding card coding

Post by kevlahnota »

Just an idea though, If we can populate the menu with card names, (example scry 2) we populate it with a name from the top card of library to the next one. then while highlighting the name reveal the image by id or name. just like in the trophy room. the problem is menu is in the center, if we can move that to the left, while displaying the image then clicking the name will put it on the bottom library or to the top if possible. Last item from menu will be cancel. Easier said than done, but its just an idea...
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Bas' random questions regarding card coding

Post by Zethfox »

The reason i didnt add scry like that is because everything has a order it has to be coded.
Before considering abilities like scry a much much larger card pool needs to be added which is "reveal x cards from zone".
Once you have a base reveal avaliable then scry could be added as a child inherited class of revealing.

As a side note, i actually cant even add anything at all, since when the project moved to github, i was not included (or was removed?) As a dev.
User avatar
Bas
Posts: 425
Joined: Sat Dec 26, 2015 10:55 pm
Location: Germany

Re: Bas' random questions regarding card coding

Post by Bas »

Zethfox wrote:Ok generally i highly discourage the use of token wprkaround, it is by far the worst of all workaround which is why i added support for creating menus. But im willing to help...targeting 2 objects should not be a problem, target( has the ability to target 1 more than 1 or upto a vertain amount. Examples are all over the primitives, cards like kodagama reach, ect, doing a quick search with cntrl F in primitive file should point you in the direction.

What exactly is it doing? What do you want it to do? Lets start there.
I can't declare two different targets with Magma Jet as the engine doesn't know what it should do to which target - damaging one, moving the other to library. I think i even managed to deal damage to the card I wanted to recylce. :mrgreen:

Have to test one thing though. Not sure about "may" keyword is working in my context - with my WTH version, that is.
Forums are down atm.

Please join the discord server in order to not miss stuff and be reachable:
https://discord.gg/JHK5pVaK5p

(You are not required to install the software, you can use it in a browser as well, albeit I recommend installing)
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Bas' random questions regarding card coding

Post by Zethfox »

ive spent a large portion of the last 2 days attempt another code for revealing card to get scry supported, unfortunately like the last time. without huge changes to wagics Core Zone/GUI/Card handling, effects that reveal cards to do X effect, can not be supported on the current wagic engine.

a cards image, and card are 2 different objects in wagic.
the image reacts to clicks, card is processed for effects.
when with that figured out, which was a heck of a task alone getting it to bring up a carddisplay and activate an ability .
i run into the next issue.
the zone is handled in 2 different methods, times 2.
you have the zone vector which contains the actual order of cards, and you have the zone map which contains all the cards cardviews.
I attempted another pass creating a completely new zone for storing reveals, load them into the reveal card display. tada! it works, however it doesnt. the library where the cards were originally was uneffected, cards were moved only on the card map which is useless for order of cards aside from the fact that deckshuffles it self in random places randomly(through a bug or misscoded section). get that figured out, now the graphics engine acts up. anyways long long long story later, it cant happen.
had wagic supported it from very early dev even in its mid life. it might have been possible to code it now. and while not completely impossible, IT CAN HAPPEN. I'm not ready to spend 3 weeks updating a game engine which im already in the middle of recoding from the ground up. I prefer to spend my time on that instead.

17 code hours later, very little if no true progress made to add it. sorry man :/
my hope was to surprise you with true scry, unfortunately I couldnt get it going.
User avatar
Bas
Posts: 425
Joined: Sat Dec 26, 2015 10:55 pm
Location: Germany

Re: Bas' random questions regarding card coding

Post by Bas »

Wow, you still impress me.

So, for how long have you been coding the new engine?

At least the token stuff worked when I removed the "may" keyword.

But no clue how to do it wtihout a token, esp. if I want to offer a choice.
Forums are down atm.

Please join the discord server in order to not miss stuff and be reachable:
https://discord.gg/JHK5pVaK5p

(You are not required to install the software, you can use it in a browser as well, albeit I recommend installing)
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Bas' random questions regarding card coding

Post by Zethfox »

currently im doing base set ups, dissecting reusable part of the current code into batchs of code i can reference back into the new set up.
considering SFML or oxygine, most likely SFML with box2d as its widely supported and documented. deciding on if I'm going to run xaml to rebuild the parser, but then that requires the entire primitives file get rewritten. If i run Xaml, the coding for cards should be less of a risk of error. parsing XML would allow for very deeply layered abilities.
but again, 36k lines of code would need to change in the primitives.

basically super early, I started with cocos2d, scrapped it due to limits a month later. look at unity2d support, was not impressed. kind of looking for the libraries, building test code to see how it handles, and either keeping or ditching them.
User avatar
Bas
Posts: 425
Joined: Sat Dec 26, 2015 10:55 pm
Location: Germany

Re: Bas' random questions regarding card coding

Post by Bas »

Can I use only numbers for token IDs or also names/words, such as "Scry2Dummy"?
Forums are down atm.

Please join the discord server in order to not miss stuff and be reachable:
https://discord.gg/JHK5pVaK5p

(You are not required to install the software, you can use it in a browser as well, albeit I recommend installing)
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Bas' random questions regarding card coding

Post by Zethfox »

Should be able to use either, as long as the token has its info put in a _card.dat
Locked