Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Talk about new cards here
Moderator: CCGHQ Admins
Re: Talk about new cards here
by whismer » 29 Jul 2010, 15:52
Come back with my Steel Overseer prob
<ACTIVATED_ABILITY tag="STEEL_OVERSEER_RULE_1" layer="0">
<COST type="TapSelf" />
<FILTER>
return CreaturesYouControl()
</FILTER>
<EFFECT>
AddPlusOnePlusOneCounters( Object(CARD_TYPE_CREATURE), 1)
</EFFECT>
<AI_AVAILABILITY behaviour="CardDraw"/>
</ACTIVATED_ABILITY>
This is my last try... it add 2 counter on the activated Steel if I have 2 creatures in play...
Can'T target every creature (I know it's Artifact creature but for now I try simplified things) and can'T add only one counter
<ACTIVATED_ABILITY tag="STEEL_OVERSEER_RULE_1" layer="0">
<COST type="TapSelf" />
<FILTER>
return CreaturesYouControl()
</FILTER>
<EFFECT>
AddPlusOnePlusOneCounters( Object(CARD_TYPE_CREATURE), 1)
</EFFECT>
<AI_AVAILABILITY behaviour="CardDraw"/>
</ACTIVATED_ABILITY>
This is my last try... it add 2 counter on the activated Steel if I have 2 creatures in play...
Can'T target every creature (I know it's Artifact creature but for now I try simplified things) and can'T add only one counter
- whismer
- Posts: 64
- Joined: 23 Jul 2010, 02:36
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by Uresti » 29 Jul 2010, 16:10
FILTER
return ArifactCreatures() and OwendByYou()
/FILTER
EFFECT
Subject():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
/EFFECT
return ArifactCreatures() and OwendByYou()
/FILTER
EFFECT
Subject():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
/EFFECT
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by Clark » 22 Aug 2010, 17:35
Hi all,
I'm Clark from China. Dotp is my first game about CCG and i like it very much. It's appreciated for all of your distribution to the new DLC, which made the game more attractively. Following by your experience, i got the key to add new cards & decks. What i could do now is trying to add new interesting cards. But you know, it's difficult for green hand like me to have a big picture of creating a completely deck . I cannot wait to commit my new cards for sharing while it seems only some developers of your team could do so . Hope I could be granted such privilege in future.
Well say thanks again and i would be happy to do all i can to help you guys to make this game better.
Here is one example card just created for fun
BTW: Could you please kindly share me some API to develop ?
I'm Clark from China. Dotp is my first game about CCG and i like it very much. It's appreciated for all of your distribution to the new DLC, which made the game more attractively. Following by your experience, i got the key to add new cards & decks. What i could do now is trying to add new interesting cards. But you know, it's difficult for green hand like me to have a big picture of creating a completely deck . I cannot wait to commit my new cards for sharing while it seems only some developers of your team could do so . Hope I could be granted such privilege in future.
Well say thanks again and i would be happy to do all i can to help you guys to make this game better.
Here is one example card just created for fun
- Code: Select all
<?xml version="1.0"?>
<MULTICARDS>
<CARD>
<FILENAME text = "NOVABLAST_WURM" />
<ARTID value = "63210002" />
<TITLE text = "NOVABLAST_WURM_TITLE" />
<TYPE metaname = "Creature" />
<SUB_TYPE metaname = "Wurm" />
<POWER value = "7" />
<TOUGHNESS value = "7" />
<CASTING_COST cost = "{3}{G}{G}{W}{W}" />
<COLOR value = "Z" />
<FRAMECOLOUR name = "GW Gold" />
<EXPANSION metaname = "6321" />
<RARITY metaname = "Mythic" />
<COLLECTIONMAX value = "0" />
<COLLECTORNUMBER value = "0" />
<CARDNUMBER value = "0" />
<ARTIST name = "Michael Komarck" />
<FLAVOURTEXT text = "NOVABLAST_WURM_FLAVOUR" />
<TRIGGERED_ABILITY tag="NOVABLAST_WURM_RULE_1" layer="0">
<TRIGGER value="ATTACKING">
return SelfTriggered()
</TRIGGER>
<FILTER>
return InPlay() and OtherCreatures()
</FILTER>
<EFFECT>
Subject():Destroy()
</EFFECT>
</TRIGGERED_ABILITY>
</CARD>
</MULTICARDS>
BTW: Could you please kindly share me some API to develop ?
- Clark
- Posts: 64
- Joined: 21 Aug 2010, 16:07
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by Yanna » 22 Aug 2010, 18:08
Welcome to the forums Clark !
Every Addition from eveyone is welcome, you need to set up tortoise and then you can start adding cards
There's unfortunately no tool to create new cards as of now, just yer old notepad ^^
Every Addition from eveyone is welcome, you need to set up tortoise and then you can start adding cards
There's unfortunately no tool to create new cards as of now, just yer old notepad ^^
Re: Talk about new cards here
by logoliv » 22 Aug 2010, 19:48
I'm trying to do Grim Discovery, here's the code :
- Code: Select all
<SPELL_ABILITY tag="GRIM_DISCOVERY_RULE_1" layer="0">
<TARGET_DETERMINATION>
Object():GetFilter():Clear()
Object():GetFilter():AddCardType( CARD_TYPE_LAND )
Object():GetFilter():AddCardType( CARD_TYPE_CREATURE )
Object():GetFilter():SetZone( ZONE_GRAVEYARD )
Object():GetFilter():SetPlayer( Object():GetPlayer() )
return TargetGoodF()
</TARGET_DETERMINATION>
<PRE_EFFECT>
Object():GetFilter():SetPlayer( Object():GetPlayer() )
Object():GetPlayer():BeginNewMultipleChoice( true )
Object():GetPlayer():AddMultipleChoiceAnswer( "RETURN_CREATURE" )
Object():GetPlayer():AddMultipleChoiceAnswer( "RETURN_LAND" )
Object():GetPlayer():AddMultipleChoiceAnswer( "DO_BOTH" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CHOOSE_TITLE" )
</PRE_EFFECT>
</SPELL_ABILITY>
<SPELL_ABILITY layer="0">
<AVAILABILITY>
if (Object():GetMultipleChoiceResult() == 1) then
return false
else
return true
end
</AVAILABILITY>
<TARGET_DETERMINATION>
return TargetCreatureInYourGraveyard()
</TARGET_DETERMINATION>
<PLAYTIME>
ChooseTarget( "ChooseCreatureInGraveyard" )
</PLAYTIME>
<EFFECT>
PutTargetCardInHand()
</EFFECT>
</SPELL_ABILITY>
<SPELL_ABILITY layer="0">
<AVAILABILITY>
if (Object():GetMultipleChoiceResult() == 0) then
return false
else
return true
end
</AVAILABILITY>
<TARGET_DETERMINATION>
Object():GetFilter():Clear()
Object():GetFilter():AddCardType( CARD_TYPE_LAND )
Object():GetFilter():SetZone( ZONE_GRAVEYARD )
Object():GetFilter():SetPlayer( Object():GetPlayer() )
return TargetGoodF()
</TARGET_DETERMINATION>
<PLAYTIME>
ChooseTarget( "ChooseLandInGraveyard" )
</PLAYTIME>
<EFFECT>
PutTargetCardInHand()
</EFFECT>
</SPELL_ABILITY>
Re: Talk about new cards here
by Yanna » 22 Aug 2010, 20:14
Maybe it's because you have multiple <SPELL_ABILITY> that each contain a <TARGET_DETERMINATION>. If you need to fullfill all conditions then you would require both a land and a creature in graveyard to be able to cast it.
To get around this, you would need to add triggered effects instead of multiple SPELL_ABILITYs. For example :
SPELL_ABILITY => get the choice (store it as an integer, say 1 for land, 2 for creature and 3 for both)
one TRIGERRED_ABILTY, with an ABILITY_RESOLVED on Self + integer = 1
one TRIGERRED_ABILTY, with an ABILITY_RESOLVED on Self + integer = 2
one TRIGERRED_ABILTY, with an ABILITY_RESOLVED on Self + integer = 3
It may be something else but i hope this helps anyway
To get around this, you would need to add triggered effects instead of multiple SPELL_ABILITYs. For example :
SPELL_ABILITY => get the choice (store it as an integer, say 1 for land, 2 for creature and 3 for both)
one TRIGERRED_ABILTY, with an ABILITY_RESOLVED on Self + integer = 1
one TRIGERRED_ABILTY, with an ABILITY_RESOLVED on Self + integer = 2
one TRIGERRED_ABILTY, with an ABILITY_RESOLVED on Self + integer = 3
It may be something else but i hope this helps anyway
Re: Talk about new cards here
by logoliv » 22 Aug 2010, 21:02
thanks for the idea
I've discovered while testing the card that BeginNewMultipleChoice can only have 2 answers That will complicate my task for this card and it also invalidate Savage Lands (in the beginning I had coded Savage Land with the ChooseColour dialog, but it was not good as we could choose any of the 5 colors...)
I now can play the card but the trigger doesn't work.
I've discovered while testing the card that BeginNewMultipleChoice can only have 2 answers That will complicate my task for this card and it also invalidate Savage Lands (in the beginning I had coded Savage Land with the ChooseColour dialog, but it was not good as we could choose any of the 5 colors...)
I now can play the card but the trigger doesn't work.
Impossible to code Savage Lands !
by logoliv » 23 Aug 2010, 17:19
I think I've tried everything possible here's the code I tested :
- Code: Select all
<ACTIVATED_ABILITY tag="SAVAGE_LANDS_RULE_2" forced_skip="1" layer="0">
<COST type="TapSelf" />
<PLAYTIME>
Object():GetFilter():SetPlayer( Object():GetPlayer() )
Object():GetPlayer():BeginNewMultipleChoice( true )
Object():GetPlayer():AddMultipleChoiceAnswer( "ADD_MANA_BLACK" )
Object():GetPlayer():AddMultipleChoiceAnswer( "NEXT_CHOICE" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CHOOSE_TITLE" )
if ( Object():GetMultipleChoiceResult() == 0 ) then
Object():Register_Set( 0, 0 )
else
Object():GetFilter():Clear()
Object():GetFilter():SetPlayer( Object():GetPlayer() )
Object():GetPlayer():BeginNewMultipleChoice( true )
Object():GetPlayer():AddMultipleChoiceAnswer( "ADD_MANA_RED" )
Object():GetPlayer():AddMultipleChoiceAnswer( "ADD_MANA_GREEN" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CHOOSE_TITLE" )
Object():Register_Set( 0, Object():GetMultipleChoiceResult() + 1 )
end
</PLAYTIME>
<EFFECT>
if (Object():Register_Get(0) == 0) then
ProduceBlackMana( 1 )
end
if (Object():Register_Get(0) == 1) then
ProduceRedMana( 1 )
end
if (Object():Register_Get(0) == 2) then
ProduceGreenMana( 1 )
end
</EFFECT>
</ACTIVATED_ABILITY>
Re: Talk about new cards here
by Yanna » 23 Aug 2010, 18:40
Don't despair !
You need to make those two choices in separate abilities (tried with a POST_PLAYTIME but it didn't work).
I've replaced the 'TapSelf' cost with a 0 mana cost because i find it more elegant that the lands taps when you chose your colour (otherwise it will tap then asks you questions. Both work anyway, choose your preference ^^).
Here's the result, tested it and it worked like a charm
You need to make those two choices in separate abilities (tried with a POST_PLAYTIME but it didn't work).
I've replaced the 'TapSelf' cost with a 0 mana cost because i find it more elegant that the lands taps when you chose your colour (otherwise it will tap then asks you questions. Both work anyway, choose your preference ^^).
Here's the result, tested it and it worked like a charm
- Code: Select all
<ACTIVATED_ABILITY tag="SAVAGE_LANDS_RULE_2" forced_skip="1" layer="0" per_turn_limit="1" >
<COST type="Mana" cost="{0}" />
<AVAILABILITY>
return ( Object():Tapped() == 0 )
</AVAILABILITY>
<PRE_EFFECT>
Object():GetFilter():SetPlayer( Object():GetPlayer() )
Object():GetPlayer():BeginNewMultipleChoice( true )
Object():GetPlayer():AddMultipleChoiceAnswer( "ADD_MANA_BLACK" )
Object():GetPlayer():AddMultipleChoiceAnswer( "NEXT_CHOICE" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CHOOSE_TITLE" )
</PRE_EFFECT>
<EFFECT>
if ( Object():GetMultipleChoiceResult() == 0 ) then
Object():Tap()
ProduceBlackMana( 1 )
else
Object():Register_Set(0, 1)
end
</EFFECT>
</ACTIVATED_ABILITY>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<TRIGGERED_ABILITY layer="0" forced_skip="1">
<TRIGGER value="ABILITY_RESOLVED">
return ( SelfTriggered() and Object():Register_Get( 0 ) > 0 )
</TRIGGER>
<PRE_EFFECT>
Object():GetFilter():SetPlayer( Object():GetPlayer() )
Object():GetPlayer():BeginNewMultipleChoice( true )
Object():GetPlayer():AddMultipleChoiceAnswer( "ADD_MANA_RED" )
Object():GetPlayer():AddMultipleChoiceAnswer( "ADD_MANA_GREEN" )
Object():GetPlayer():AskMultipleChoiceQuestion( "CHOOSE_TITLE" )
</PRE_EFFECT>
<EFFECT>
if ( Object():GetMultipleChoiceResult() == 0 ) then
Object():Register_Set(0, 0)
Object():Tap()
ProduceRedMana( 1 )
else
Object():Register_Set(0, 0)
Object():Tap()
ProduceGreenMana( 1 )
end
</EFFECT>
</TRIGGERED_ABILITY>
Re: Talk about new cards here
by logoliv » 23 Aug 2010, 18:50
Thanks Yanna, you're a master programmer lol the invalid pointer error is not that clean, but it works
Re: Talk about new cards here
by Yanna » 23 Aug 2010, 20:19
No problem ^^
Ho Btw... what invalid pointer error ?
Btw, coding Orim's Chant and Stasis (which you can pay with generated mana as with tundra, and that is hard to code too) made me learn many things about abilities and 'chaining' those.
I hope you're going to give another try at Grim Discovery !
Ho Btw... what invalid pointer error ?
Btw, coding Orim's Chant and Stasis (which you can pay with generated mana as with tundra, and that is hard to code too) made me learn many things about abilities and 'chaining' those.
I hope you're going to give another try at Grim Discovery !
Re: Talk about new cards here
by kevlahnota » 23 Aug 2010, 20:51
it's the missing tag... for the triggered ability
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Talk about new cards here
by Yanna » 23 Aug 2010, 21:12
How yeah ^^ That's one easy to fix ain't it ?kevlahnota wrote:it's the missing tag... for the triggered ability
Re: Talk about new cards here
by logoliv » 24 Aug 2010, 16:02
I give my soul to the One who manages to code Grim Discovery (without any error of course lol)
By the way it's a shame that BeginNewMultipleChoice can't accept more than 2 choices... another limitation of the game engine
By the way it's a shame that BeginNewMultipleChoice can't accept more than 2 choices... another limitation of the game engine
Re: Talk about new cards here
by whismer » 24 Aug 2010, 17:05
It's can work using a different method but...
By creating token-like card with 1 effect on each.
If the choice is one or both and you put the same choice that in the Jester Cap card... Maybe the caster will choose 2 land or 2 creature but I think it can work by this way
By creating token-like card with 1 effect on each.
If the choice is one or both and you put the same choice that in the Jester Cap card... Maybe the caster will choose 2 land or 2 creature but I think it can work by this way
- whismer
- Posts: 64
- Joined: 23 Jul 2010, 02:36
- Has thanked: 0 time
- Been thanked: 0 time
Who is online
Users browsing this forum: No registered users and 22 guests