It is currently 19 Jul 2025, 07:58
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Tribute Mechanic of Born of the Gods

Postby NeoAnderson » 13 Jan 2014, 14:27

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. :mrgreen:
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) :mrgreen:
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. :mrgreen: make the choice.
On the other side when you use PutOntoBattlefield while the A.I. :mrgreen: is choosing the message is displayed.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby 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. :(
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Formal Request Thread

Postby NeoAnderson » 14 Jan 2014, 00:50

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. :(
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).
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 {4} {G} {G}
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

Postby 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 ?
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby RiiakShiNal » 14 Jan 2014, 04:03

drleg3nd wrote:HEY GUYS I DONT KNOW IF ANYONE TOUCH ON THIS TOPIC , BUT IS THERE A WAY TO change badge pic on cards ?
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.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby 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." ?
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby NeoAnderson » 14 Jan 2014, 21:53

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." ?
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">
  <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

Postby thefiremind » 14 Jan 2014, 22:45

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.
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.
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>
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). The code can be modified so that it treats this event separately, but is it worth complicating?

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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby NeoAnderson » 14 Jan 2014, 23:01

thefiremind wrote:
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.
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.
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>
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).

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.
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.
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 :D .
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Formal Request Thread

Postby drleg3nd » 14 Jan 2014, 23:09

thanks Neo and TFM for your help.
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby 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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby 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
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby sumomole » 14 Jan 2014, 23:31

thefiremind wrote:I made another important modification, please look at the new code and read my last 2 edits.
If you are talking about the last ability of Ephara, God of the Polis, I try to use another method of making it.
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 &gt; 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>
EDIT:I don't use ZONECHANGE_END because I can't solve the problem of itself enter the battlefield twice.
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Formal Request Thread

Postby 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
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby sumomole » 15 Jan 2014, 23:28

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
yes, but if you just want reduce cost, Grand Arbiter Augustin IV is better.
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 2 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 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 2 guests

Login Form