GUI



Card scripting


This will be your "playground" now - to implement all features a card may have.

That means go to

Here now a description what you see above and what you can and can't do.

Save

First I would like to draw attention to the various "Save" buttons. It is in general very annoying to program/ edit something and then for the changes to become lost and save everyting again.

Within the "Edit Set" - Window you have THREE save buttons.

Each of these "Save-Features" save (programmatically) different entities, which in a (programmatical) way have no real relation to each other. The first one is the "entity"-Set, the second the entity-"Card" and the third one relates to "Hints".

If on the first tab, you double click an entry of the list - the other tabs are updated accordingly. Unsaved changes are LOST. You will not be warned!

Allways remember to save your work!

Clone

While implementing "new" cards, I discovered the "Clone" button is the single most important button in the whole program.

Many cards are actually similar to other cards. With this little clickable darling you can (Tatata!) clone one card to another card. In front of the clone button there is a small textfield. Here you enter the Gatherer ID of a known card to which to do the clone FROM. All card and hint information of that card is cloned to the current card. If the current card already has "information" (like Hints or scripts) the result is joined in the way, that "additional" previous information is kept and keys with new information are copied to the current card. For information which is available in both, the previous is overwritten with the new information.

In card scripts all references (that is gatherer ID and name of the card) is changed to the current cards values.

In JPortal each card uniquely belongs to a set

Meaning a card like "Alabaster Dragon" which is included in several sets - MUST be implemented seperately for each set! There is no such thing as:
Card XY belongs to set A and B and C.
Card and set relations are 1:1.

But cloning here makes life easier again. One button click and the "Alabaster Dragon" joins in a new form the new set!

Edit

Colorfull textarea (3) in above image. Here you can enter the source code of your script. Beware the editor is basic. That means for example NO UNDO mechanism is implemented.

The code you enter is allways associated with the set situation key (combobox above the editor). Prior to editing you must select the situation key you wish to edit. By selecting a situation key the editor "resets". So - if at some stage you want to switch after you edited - copy (clipboard) your code so you still have it *somewhere*.

Remember to "Save" the edited scripts!

Some code conventions

Help

On the right side of the window (allways regarding tab 2) a section with another tab and some textareas is displayed. Most of the tabs are used to provide some basic "help".

Here variable-Names, classes, methods etc can be displays, which are deemed to be usefull for card coding.

Following sections (tabs) exist:

Test / Debug

This is tricky!

On the last tap of above mentioned section is a tab called "Testing", this is where you can do some interesting stuff with just developed scripts. Here you can test the script (card) you just developed without actually playing a real game.

(well sooner or later you should certainly test your card by playing - but for a quick check this is really fun :-) )



Testing


Actually what you can do here is, run your script using a "dummy" match. This can be done using two ways:

  1. simply installing a match and from that call your script

  2. actully RUN a match, start your script and let the match execute your script including all communication which may follow

Type b) is invoked by enabling the checkBox "Try as Communication". This type actually starts the match in an own thread and it is continued till it dies - or you press the small "X" button, which destroys the thread.

For "simple" debugging type a) should be work out just fine. If any communication is envolved, you probably must use type b)

Now...

In order to execute a "meaningfull" match some parameters are needed.

Debug
On the left side of the window on the bottom, there is another tab. Here you have quick access to a debug and a log output (and to the current settings of debug-level). Naturally output of the above mentioned testings which go to debug/log will be shown here.

Hints

See: AI Hints