It is currently 28 Apr 2024, 02:30
   
Text Size

Force a draw game? (Edit, new problem involving counters.)

Moderator: CCGHQ Admins

Force a draw game? (Edit, new problem involving counters.)

Postby Chakan » 11 Sep 2014, 16:56

Sorry for the second help topic in two days, but I just wanted to know what, or if there is, a string for forcing a draw game? I'm asking because I'm doing Divine Intervention.

Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, rimuovi un segnalino intervento dall’Intervento Divino. Se non ha più segnalini intervento, la partita è patta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
      <COUNTER_REGISTRATION name="Intervention" proliferate="11" />
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():RemoveCounters( MTG():GetCountersType("Intervention"), 1 )
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil and EffectSource():CountCounters( MTG():GetCountersType("Intervention") ) &gt; 0 then
       EffectController():TieGame()
    end
    </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
(I've tried both TieGame and DrawGame, none of them seems to work.)

EDIT
I've figured out how to force a draw game, but the card is doing it's trigger too early. It should trigger only if there are 0 counters on it, instead, it triggers when there is 1 counter on it.

Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, rimuovi un segnalino intervento dall’Intervento Divino. Se non ha più segnalini intervento, la partita è patta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
      <COUNTER_REGISTRATION name="Intervention" proliferate="11" />
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():RemoveCounters( MTG():GetCountersType("Intervention"), 1 )
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil and EffectSource():CountCounters( MTG():GetCountersType("Intervention") ) &gt; 0 then
       EffectController():TieGame()
    end
    </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
User avatar
Chakan
 
Posts: 166
Joined: 07 Jun 2014, 23:08
Has thanked: 11 times
Been thanked: 10 times

Re: Force a draw game? (Edit, new problem involving counters

Postby RiiakShiNal » 11 Sep 2014, 22:24

Chakan wrote:Sorry for the second help topic in two days, but I just wanted to know what, or if there is, a string for forcing a draw game? I'm asking because I'm doing Divine Intervention.

| Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, rimuovi un segnalino intervento dall’Intervento Divino. Se non ha più segnalini intervento, la partita è patta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
      <COUNTER_REGISTRATION name="Intervention" proliferate="11" />
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():RemoveCounters( MTG():GetCountersType("Intervention"), 1 )
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil and EffectSource():CountCounters( MTG():GetCountersType("Intervention") ) &gt; 0 then
       EffectController():TieGame()
    end
    </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
(I've tried both TieGame and DrawGame, none of them seems to work.)

EDIT
I've figured out how to force a draw game, but the card is doing it's trigger too early. It should trigger only if there are 0 counters on it, instead, it triggers when there is 1 counter on it.

| Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, rimuovi un segnalino intervento dall’Intervento Divino. Se non ha più segnalini intervento, la partita è patta.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, remove an intervention counter from Divine Intervention.]]></LOCALISED_TEXT>
      <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
      <COUNTER_REGISTRATION name="Intervention" proliferate="11" />
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():RemoveCounters( MTG():GetCountersType("Intervention"), 1 )
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil and EffectSource():CountCounters( MTG():GetCountersType("Intervention") ) &gt; 0 then
       EffectController():TieGame()
    end
    </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
Code: Select all
    if EffectSource() ~= nil and EffectSource():CountCounters( MTG():GetCountersType("Intervention") ) &gt; 0 then
Should be:
Code: Select all
    if EffectSource() ~= nil and EffectSource():CountCounters( MTG():GetCountersType("Intervention") ) &lt;= 0 then
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Force a draw game? (Edit, new problem involving counters

Postby migookman » 11 Sep 2014, 22:51

Thanks! I'm a noob when it comes to coding and I was wondering what the lt meant. Now I know to change some of my coded cards to gt that needs to be greater than a certain characteristic.
User avatar
migookman
 
Posts: 135
Joined: 05 Aug 2014, 06:37
Has thanked: 21 times
Been thanked: 28 times

Re: Force a draw game? (Edit, new problem involving counters

Postby RiiakShiNal » 12 Sep 2014, 00:49

Those are actually HTML symbols for greater than (>, &gt;) and less than (<, &lt;). Certain symbols can't be used directly inside of XML without either being converted to HTML friendly symbols such as in this case or using <!CDATA[Some text here.]]> to allow characters that would not otherwise be allowed. For code purposes about the only ones you will need to convert will be greater than and less than.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 23 guests


Who is online

In total there are 23 users online :: 0 registered, 0 hidden and 23 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 23 guests

Login Form