It is currently 05 Sep 2025, 06:53
   
Text Size

Card Contributions

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

Re: Card Contributions

Postby PalladiaMors » 04 Aug 2014, 02:39

I'm looking at cards from Planeshift that could be easily added and stumbled upon Fleetfoot Panther and Steel Leaf Paladin. In both cases, the crash log complains about the "green or white creature" part of the text. However, there's a ton of creatures with "return a <ColorX> or <colorY> creature to your hand" working perfectly fine without even requiring groovy. I wonder if there's some issue specifically with green/white?
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 04 Aug 2014, 04:10

Yup, it is an issue with "green or white creature you control" filter. Each combination needs some code to be added to the game, it happens that "green or white creature you control" has not been needed so far so there was no code for it.

It is relatively straightforward to add in the support code, so go ahead and submit these first. When integrating the cards, we'll add in the support code needed.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby PalladiaMors » 04 Aug 2014, 13:32

Sorry, I submitted Krosan Cloudscraper without logging in to Firemind.

By the way, huge thanks for adding Morph!

Edit: Nevermind, Shawnie got there first :lol:

Edit2: I was revising some of the cards I submitted today and noticed that I made a mistake with Heart of Yavimaya. I used the groovy for Plant Elemental, but looking closely at the oracle texts the cards are different, because while Elemental comes into play and then gets sacrificed if you don't choose to sacrifice the forest, Yavimaya doesn't even come into play, you just ditch it from your hand straight into the graveyard, which I believe is a pretty rare ability in MtG. That script is wrong, please ignore it.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 05 Aug 2014, 04:42

PalladiaMors wrote:Edit2: I was revising some of the cards I submitted today and noticed that I made a mistake with Heart of Yavimaya. I used the groovy for Plant Elemental, but looking closely at the oracle texts the cards are different, because while Elemental comes into play and then gets sacrificed if you don't choose to sacrifice the forest, Yavimaya doesn't even come into play, you just ditch it from your hand straight into the graveyard, which I believe is a pretty rare ability in MtG. That script is wrong, please ignore it.
This is normally found on the non-basic lands from Alliances, and other mana-producing permanents with come into play 'costs' (prevents you from getting mana from them before 'paying their cost') - Good that you noticed the subtle difference.

Also noticed another subtle error on Giant Trap Door Spider - Exiling the spider isn't part of the cost. So if the target is no longer legal you don't lose the spider.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby PalladiaMors » 05 Aug 2014, 17:07

Wow, looks like I ended up giving Melvin a bunch of trouble to correct some of those cards. Seriously, you guys don't have to go out of your way to correct my mistakes, when there's something wrong with the submission please just ignore it. I don't really have a clue about what I'm doing and realize I'm likely to make a lot of blunders in the scripts.

Edit: I was trying to do Maze of Ith from Elvish Scout's groovy. It's not crashing, but it's not working either - I don't get the chance to activate the ability when the opponent declares the attack. I thought about asking for help here just because it feels like it's really close - if I'm completely off and this is actually gonna take more work, then never mind this.

Code: Select all
def ATTACKING_CREATURE = new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.isCreature() && target.isAttacking();
    }
};

def TARGET_ATTACKING_CREATURE = new MagicTargetChoice(
    ATTACKING_CREATURE,
    MagicTargetHint.Positive,
    "target attacking creature"
);

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Block),
        "Untap"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicTapEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                TARGET_ATTACKING_CREATURE,
                MagicTapTargetPicker.Untap,
                this,
                "Untap target attacking creature\$. " +
                "Prevent all combat damage that would be dealt to and dealt by it this turn."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
                game.doAction(new MagicUntapAction(it));
                game.doAction(new MagicAddTurnTriggerAction(
                    it,
                    MagicIfDamageWouldBeDealtTrigger.PreventCombatDamageDealtToDealtBy
                ));
            });
        }
    }
]
edit2: Actually, never mind this, I was looking at more cards and realized that this type of script is typical of situations in which you want to target a creature you control, targeting any creature seems to be usually done in a completely different way. Looks like I was way off, my bad.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 06 Aug 2014, 05:04

Looks like you were trying to target the opponent's creature with "Allow only sensible choices" turned on and and with the Positive hint in the MagicTargetChoice.

You just have to remove the MagicTargetHint.Positive, as Maze of Ith's ability could be used both ways.
Code: Select all
def TARGET_ATTACKING_CREATURE = new MagicTargetChoice( 
    "target attacking creature"
);
There is a hint system in place for the AI's benefit, to reduce the number of choices it needs to consider. This is usually enabled for the player as well via the "Allow only sensible choices" option. You can turn it off from the settings.

In this case, the hint shouldn't be there, as there are good reasons for the AI to target its own creature with the ability. In fact for Elvish Scout, there is no reason to add a hint as it is already limited to "creatures you control". I've simplified it as

Code: Select all
def TARGET_ATTACKING_CREATURE_YOU_CONTROL = new MagicTargetChoice( 
    "target attacking creature you control"
);
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby melvin » 06 Aug 2014, 05:18

PalladiaMors wrote:Seriously, you guys don't have to go out of your way to correct my mistakes, when there's something wrong with the submission please just ignore it.
We all start somewhere, as long as you are learning from your mistakes, it makes all the work we do worthwhile.

Besides, editing a card script is much easier than creating it ourselves, we are quite glad to get some help in finding cards to add to the card pool.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby PalladiaMors » 07 Aug 2014, 00:13

I can't understand why I'm getting a crash with

"ability=SN can't be blocked by red creatures."

Barrenton Cragtreads has the exact same text and is working perfectly.

Crash log says: "Caused by: java.lang.RuntimeException: java.lang.RuntimeException: unknown card property value "SN" = "can't be blocked by red creatures."
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 07 Aug 2014, 00:39

PalladiaMors wrote:I can't understand why I'm getting a crash with...
Please include the complete script file here. Thanks!

My guess it that there is a problem in the separator. Abilities have to be separated by ';'
Code: Select all
ability=<ability 1>;<ability 2>
If the ability spans multiple lines, each line except the last must end with '\'
Code: Select all
ability=<ability 1>;\
        <abllity 2>
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby PalladiaMors » 07 Aug 2014, 01:23

Thanks, it was a formatting issue indeed. By now I've learned that I shouldn't try to edit groovy files with notepad, but I was still using it for the .txt ones. I'll use wordpad for that as well from now on, lol.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 07 Aug 2014, 01:53

Just had a quick peek at your other cards submitted by Firemind. Be wary of the 'if destroyed/put into the graveyard this way' cards. If you don't pay for Cosmic Horror's upkeep, and it is then regenerated, it won't deal damage to you.

Some nice finds otherwise - Keep them coming :)
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby PalladiaMors » 07 Aug 2014, 02:47

My bad, didn't even consider that possibility. If that means the script isn't easily fixable, please just trash it - nobody is gonna miss Cosmic Crap anyway :lol:. I just thought it was a "free bonus" after Force of Nature.

I'm trying to do another totally crappentous card, Elder Spawn, but the crash log is complaining about MagicTargetChoice.SACRIFICE_ISLAND . Is it possible that this is unavailable, or does it mean that I've made some other mistake?
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 07 Aug 2014, 03:17

User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby ShawnieBoy » 07 Aug 2014, 03:18

PalladiaMors wrote:My bad, didn't even consider that possibility. If that means the script isn't easily fixable, please just trash it - nobody is gonna miss Cosmic Crap anyway :lol:. I just thought it was a "free bonus" after Force of Nature.

I'm trying to do another totally crappentous card, Elder Spawn, but the crash log is complaining about MagicTargetChoice.SACRIFICE_ISLAND . Is it possible that this is unavailable, or does it mean that I've made some other mistake?
Do you have the groovy file available? I'm assuming it's a groovy file.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby melvin » 07 Aug 2014, 03:18

PalladiaMors wrote:I'm trying to do another totally crappentous card, Elder Spawn, but the crash log is complaining about MagicTargetChoice.SACRIFICE_ISLAND . Is it possible that this is unavailable, or does it mean that I've made some other mistake?
MagicTargetChoice.SACRIFICE_ISLAND has not been defined, but you can write it as
Code: Select all
new MagicTargetChoice("an Island to sacrifice");
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

PreviousNext

Return to Magarena

Who is online

Users browsing this forum: No registered users and 5 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 5 guests

Login Form