Card Contributions
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Re: Card Contributions
by 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
by 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.
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.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by 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
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.
By the way, huge thanks for adding Morph!
Edit: Nevermind, Shawnie got there first

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
by ShawnieBoy » 05 Aug 2014, 04:42
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.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.
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.
-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Card Contributions
by 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.
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
));
});
}
}
]
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Card Contributions
by 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.
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
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"
);
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"
);
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by melvin » 06 Aug 2014, 05:18
We all start somewhere, as long as you are learning from your mistakes, it makes all the work we do worthwhile.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.
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.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by 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."
"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
by melvin » 07 Aug 2014, 00:39
Please include the complete script file here. Thanks!PalladiaMors wrote:I can't understand why I'm getting a crash with...
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>
- Code: Select all
ability=<ability 1>;\
<abllity 2>
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by 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
by 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
Some nice finds otherwise - Keep them coming

-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Card Contributions
by 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
. 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?

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
by melvin » 07 Aug 2014, 03:17
Good catch, ShawnieBoy. Fixed in https://code.google.com/p/magarena/sour ... 4a7124953c
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card Contributions
by ShawnieBoy » 07 Aug 2014, 03:18
Do you have the groovy file available? I'm assuming it's a groovy file.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. 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?
-
ShawnieBoy - Programmer
- Posts: 601
- Joined: 02 Apr 2012, 22:42
- Location: UK
- Has thanked: 80 times
- Been thanked: 50 times
Re: Card Contributions
by melvin » 07 Aug 2014, 03:18
MagicTargetChoice.SACRIFICE_ISLAND has not been defined, but you can write it asPalladiaMors 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?
- Code: Select all
new MagicTargetChoice("an Island to sacrifice");
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Who is online
Users browsing this forum: No registered users and 5 guests