Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)
2014




Formal Request Thread
Moderator: CCGHQ Admins
Re: Tribute Mechanic of Born of the Gods
by NeoAnderson » 13 Jan 2014, 14:27
I am not sure we can talk about A.I.(as Artificial Intelligence) here, more days i spent on these code lines, and more i am sure this is an A.I.(as Artificial Idiot)sumomole wrote:It sounds interesting, but if you use make AI lose game rather than add counters, AI will not hesitate to choose damage, it maybe not smart, but not a fool.

There is also another difference if you have seen, when you normal cast the creature no message is displayed on the screen while the A.I.

On the other side when you use PutOntoBattlefield while the A.I.

- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by sumomole » 14 Jan 2014, 00:29
I did a little more test, the limitation of AI beyond my imagination.
I'm still using EffectController():GetOpponent() instead of manually select action to ensure that AI's choice is the first action, then when I cast this card, it will make a more reasonable choice, I try to use 4 damage instead of add coutners, AI will choose 4 damage, and when I use 6 damage, it would choose the second ability(5 damage).
But when I put this card onto the battlefield from library as NeoAnderson said, it becomes extremely stupid, whether I use 4 or 6 damage, it always chose the second ability(5 damage), when I use add counters, it will chose the counters, maybe it thinks damage is bad option but counters could be accepted, as for the second ability(5 damage) I guess AI can't see what it is in this case.
The reason leads to this problem I think that is "put onto the battlefield" is considered the first action, AI's choice becomes the second, so it made the wrong choice again.
This time I really don't know how to solve.
I'm still using EffectController():GetOpponent() instead of manually select action to ensure that AI's choice is the first action, then when I cast this card, it will make a more reasonable choice, I try to use 4 damage instead of add coutners, AI will choose 4 damage, and when I use 6 damage, it would choose the second ability(5 damage).
But when I put this card onto the battlefield from library as NeoAnderson said, it becomes extremely stupid, whether I use 4 or 6 damage, it always chose the second ability(5 damage), when I use add counters, it will chose the counters, maybe it thinks damage is bad option but counters could be accepted, as for the second ability(5 damage) I guess AI can't see what it is in this case.
The reason leads to this problem I think that is "put onto the battlefield" is considered the first action, AI's choice becomes the second, so it made the wrong choice again.
This time I really don't know how to solve.

-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by NeoAnderson » 14 Jan 2014, 00:50
The only idea i have is to use a manual decision, as like i was saying before, for 2 simple reasons, first of all we cannot choose an arbitrary player controlled by AI, i know you saying are always controlled by CPU, but it is not right to choose a random player who can take decision for another one (Multiplayer mode not 1vs1).sumomole wrote:I did a little more test, the limitation of AI beyond my imagination.
I'm still using EffectController():GetOpponent() instead of manually select action to ensure that AI's choice is the first action, then when I cast this card, it will make a more reasonable choice, I try to use 4 damage instead of add coutners, AI will choose 4 damage, and when I use 6 damage, it would choose the second ability(5 damage).
But when I put this card onto the battlefield from library as NeoAnderson said, it becomes extremely stupid, whether I use 4 or 6 damage, it always chose the second ability(5 damage), when I use add counters, it will chose the counters, maybe it thinks damage is bad option but counters could be accepted, as for the second ability(5 damage) I guess AI can't see what it is in this case.
The reason leads to this problem I think that is "put onto the battlefield" is considered the first action, AI's choice becomes the second, so it made the wrong choice again.
This time I really don't know how to solve.
Second issue The AI is really bugged! So turning to a manual decision with score points for each kind of choice could be the better solution but it requires more time to code. Just to give you an idea try my code i have posted before, it is not so bad.
Also consider that other cards can have different condition for tribute ability for example :
Nessian Wilds Ravager



Creature - Hydra
Tribute 6 (As this creature enters the battlefield, an opponent of your choice may place 6 +1/+1 counters on it.)
When Nessian Wilds Ravager enters the battlefield, if the tribute wasn't paid, you may have Nessian Wilds Ravager fight another target creature.
FOR THIS CREATURE 99% IS SECOND CHOICE.
1% When you have a at least 1 creature with power or toughness 12 or greater.
What happen if i have no creature? Surely i will not pay the tribute and the creature cannot fight.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by drleg3nd » 14 Jan 2014, 03:37
HEY GUYS I DONT KNOW IF ANYONE TOUCH ON THIS TOPIC , BUT IS THERE A WAY TO change badge pic on cards ?
Re: Formal Request Thread
by RiiakShiNal » 14 Jan 2014, 04:03
Yes, there is a way to change badge pictures, but we can't add new badges we can only change the pictures for existing badges. It is just a matter of overriding the appropriate TDX in ART_ASSETS\MODELS\BADGES.drleg3nd wrote:HEY GUYS I DONT KNOW IF ANYONE TOUCH ON THIS TOPIC , BUT IS THERE A WAY TO change badge pic on cards ?
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by drleg3nd » 14 Jan 2014, 20:56
hey guys how can you code "At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card." ?
Re: Formal Request Thread
by NeoAnderson » 14 Jan 2014, 21:53
If you mean "each upkeep" including also other players turn, and with last turn you mean "your last turn" this code will work.drleg3nd wrote:hey guys how can you code "At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card." ?
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="BEGINNING_OF_STEP">
if MTG():GetStep() == STEP_UPKEEP and LinkedDC():Get_Int(0) == 1 then
if EffectController():MyTurn() then
LinkedDC():Set_Int(0, 0)
end
return true
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectController():DrawCards(1)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
if TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) and EffectController():MyTurn() then
LinkedDC():Set_Int(0, 1)
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by thefiremind » 14 Jan 2014, 22:45
No, "last turn" means "last turn, no matter whose turn it was". If you have creatures with flash and you cast them on your opponent's turn you can draw more often.NeoAnderson wrote:If you mean "each upkeep" including also other players turn, and with last turn you mean "your last turn" this code will work.
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1">
-- Localised text omitted
<TRIGGER value="BEGINNING_OF_STEP">
if MTG():GetStep() == STEP_UPKEEP then
return EffectController():PlayerDataChest():Get_Int(5432) == MTG():GetTurnNumber()-1
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectController():DrawCards(1)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="another" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
if TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) then
TriggerObject():GetPlayer():PlayerDataChest():Set_Int( 5432, MTG():GetTurnNumber() )
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
EDIT: I forgot that another player may gain control of the card and it should remember if that player had a creature enter the battlefield anyway. Give me a minute to fix.
EDIT 2: It should be OK now.
EDIT 3: Actually, there's still a problem: if the card isn't already on the battlefield during the turn when the creature enters the battlefield, the LinkedDC value will be wiped during the zone change. You can fix it by changing LinkedDC with a player's data chest register (it's even better because you don't need to loop through the starting players).
EDIT 4: Corrected once again. Of course 5432 is just a random number, find one that hasn't been used yet.
Last edited by thefiremind on 14 Jan 2014, 23:11, edited 3 times in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Formal Request Thread
by NeoAnderson » 14 Jan 2014, 23:01
You're right my friend, i made it quickly in fact i was using also a third trigger to reset the register "Beginning of players turn" to avoid the problem of a creature cast before the upkeep but i removed because i tought is a really rare and unusual condition.thefiremind wrote:No, "last turn" means "last turn, no matter whose turn it was". If you have creatures with flash and you cast them on your opponent's turn you can draw more often.NeoAnderson wrote:If you mean "each upkeep" including also other players turn, and with last turn you mean "your last turn" this code will work.I think that saving the turn number is the safest way to ensure that the creature entered the battlefield last turn, and it doesn't require to reset the register. The code wouldn't work in case a creature enters the battlefield under your control before the upkeep (it would overwrite last turn's number with this turn's number before it can be used), but a creature entering the battlefield during the untap or the draw step is a very rare scenario (if not impossible).
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1">
-- Localised text omitted
<TRIGGER value="BEGINNING_OF_STEP">
if MTG():GetStep() == STEP_UPKEEP then
local player = EffectController()
for i=0,MTG():GetNumberOfStartingPlayers()-1 do
if player == MTG():GetNthStartingPlayer(i) then
return LinkedDC():Get_Int(i) == MTG():GetTurnNumber()-1
end
end
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectController():DrawCards(1)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
<TRIGGER value="ZONECHANGE_END" simple_qualifier="another" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
if TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) then
local player = TriggerObject():GetPlayer()
for i=0,MTG():GetNumberOfStartingPlayers()-1 do
if player == MTG():GetNthStartingPlayer(i) then
LinkedDC():Set_Int( i, MTG():GetTurnNumber() )
end
end
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
EDIT: I forgot that another player may gain control of the card and it should remember if that player had a creature enter the battlefield anyway. Give me a minute to fix.
EDIT 2: It should be OK now.
Anyway your pointing about the controller change is right, looking your code should work, i am focusing on a function to resolve the problem of DUAL DEVOTION, i will give you important notices soon stay tuned

- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by thefiremind » 14 Jan 2014, 23:10
I made another important modification, please look at the new code and read my last 2 edits.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Formal Request Thread
by drleg3nd » 14 Jan 2014, 23:22
got it, thx..i post cards on other thread for review..after reading previous post i doubt my Ephara will work correctly due to devotion
Re: Formal Request Thread
by sumomole » 14 Jan 2014, 23:31
If you are talking about the last ability of Ephara, God of the Polis, I try to use another method of making it.thefiremind wrote:I made another important modification, please look at the new code and read my last 2 edits.
- Ephara, God of the Polis | Open
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP">
return MTG():GetStep() == STEP_UPKEEP
</TRIGGER>
<INTERVENING_IF ignore_resolution_check="1">
local num_starting_players = MTG():GetNumberOfStartingPlayers()
for i=0,(num_starting_players-1) do
local player = MTG():GetNthStartingPlayer(i)
if (player ~= nil and player == EffectController()) then
local num_creatures = LinkedDC():Get_Int(i) - LinkedDC():Get_Int(4+i)
if num_creatures > 0 then
return true
end
end
end
return false
</INTERVENING_IF>
<RESOLUTION_TIME_ACTION>
EffectController():DrawCards(1)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
<TRIGGER value="BEGINNING_OF_STEP">
return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local delayDC_A = EffectDC():Make_Chest(1)
local delayDC_B = EffectDC():Make_Chest(2)
MTG():CreateDelayedTrigger(1, delayDC_A)
MTG():CreateDelayedTrigger(2, delayDC_B)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" resource_id="1">
<TRIGGER value="BEGINNING_OF_STEP">
return MTG():GetStep() == STEP_CLEANUP
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local num_starting_players = MTG():GetNumberOfStartingPlayers()
for i=0,(num_starting_players-1) do
local player = MTG():GetNthStartingPlayer(i)
if player ~= nil then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer( player )
interrogation:SetToZone( ZONE_BATTLEFIELD )
interrogation:SetType( CARD_TYPE_CREATURE )
local num_creatures = interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
interrogation:SetObject( EffectSource() )
if interrogation:Test( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN ) then
LinkedDC():Set_Int(4+i, 1)
end
LinkedDC():Set_Int(i, num_creatures)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" linked_ability_group="1" resource_id="2" priority="-1">
<TRIGGER value="BEGINNING_OF_STEP">
return MTG():GetStep() == STEP_UPKEEP
</TRIGGER>
<RESOLUTION_TIME_ACTION>
LinkedDC():Clear()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by drleg3nd » 15 Jan 2014, 19:34
Is it just me or does anyone else get excited forming new deck ideas with upcoming set ? Anyways I was wondering if Council of the Absolute and Righteous Authority is available ? These cards with hero of iroas can possibly make a nice azorious aggro enchantment deck
Re: Formal Request Thread
by sumomole » 15 Jan 2014, 23:28
yes, but if you just want reduce cost, Grand Arbiter Augustin IV is better.drleg3nd wrote:Is it just me or does anyone else get excited forming new deck ideas with upcoming set ? Anyways I was wondering if Council of the Absolute and Righteous Authority is available ? These cards with hero of iroas can possibly make a nice azorious aggro enchantment deck
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Who is online
Users browsing this forum: No registered users and 6 guests