It is currently 18 Jul 2025, 23:50
   
Text Size

Overgrown battlement help

Moderator: CCGHQ Admins

Overgrown battlement help

Postby wtb300 » 13 Nov 2013, 01:31

Sorry i am new to the site and i hope im posting this in the right place. the card works to the point that it taps and the mana pool comes up but it doesn't add the mana to my pool.and the script log shows this.

[lua] [string "OVERGROWN_BATTLEMENT_100193610_TITLE (CONTINUOUS_ACTION)~0x0000..."]:8: ')' expected near 'characteristic'

dont know how to post the cards code lol sry i can email it if you like
figured it out
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="OVERGROWN_BATTLEMENT_100193610" />
  <CARDNAME text="OVERGROWN_BATTLEMENT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Overgrown Battlement]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="100193610" />
  <ARTID value="100193610" />
  <ARTIST name="Franz Vohwinkel" />
  <CASTING_COST cost="{1}{G}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Our enemy is nothing less than the end of all life. We shall not want for allies.”
—The War Diaries]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Wall" />
  <EXPANSION value="ROE" />
  <RARITY metaname="C" />
  <POWER value="0" />
  <TOUGHNESS value="4" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Defender]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_DEFENDER" />
  </STATIC_ABILITY>
  <ACTIVATED_ABILITY forced_skip="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {G} to your mana pool for each creature with defender you control.]]></LOCALISED_TEXT>
    <COST type="TapSelf" />
  <PLAY_TIME_ACTION>
    RSN_MarkManaAbilityStart()
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, INTRINSIC characteristic="CHARACTERISTIC_DEFENDER" )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController())
    RSN_Produce( "{G}", filter:Count() )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    RSN_EliminateExtraManaTokens()
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    G2K_DisplayManaPool(EffectController())
    RSN_MarkManaAbilityEnd()
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY window_step="upkeep" type="window" />
    <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="begin_combat" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY window_step="declare_attackers" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY window_step="declare_blockers" type="window" />
    <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
    <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
    <AI_AVAILABILITY type="in_response" response_source="1" />
    <AI_AVAILABILITY type="in_response" response_target="1" />
  </ACTIVATED_ABILITY>
  <STATIC_ABILITY>
    <CONTINUOUS_ACTION layer="0">
    RSN_ClearCanProduceMana()
    RSN_MarkCanProduceMana( "{G}" )
    </CONTINUOUS_ACTION>
    <CONTINUOUS_ACTION layer="8">
    local oCard = EffectSource()
    if (oCard ~= nil) then
      local oCharacteristics = oCard:GetCurrentCharacteristics()
      if (((oCharacteristics ~= nil) and (oCharacteristics:Bool_Get( CHARACTERISTIC_CANT_USE_ACTIVATED_ABILITIES ))) or
        (EffectController():GetCurrentCharacteristics():Bool_Get( PLAYER_CHARACTERISTIC_CANT_ACTIVATE_NONMANA_ABILITIES ))) then
        local filter = ClearFilter()
        filter:Add( FE_TYPE, OP_IS, INTRINSIC characteristic="CHARACTERISTIC_DEFENDER" )
        filter:Add( FE_CONTROLLER, OP_IS, EffectController())
        local numAbilities = filter:CountStopAt(19)
        oCharacteristics:GrantAbility( numAbilities )
      end
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY forced_skip="1" replacement_effect="1">
    <TRIGGER value="BEGINNING_OF_STEP" pre_trigger="1" />
    <RESOLUTION_TIME_ACTION>
    RSN_ClearProducedMana()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <MANA_ABILITY resource_id="0">
    <PRODUCES amount="{0}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="1">
    <PRODUCES amount="{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="2">
    <PRODUCES amount="{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="3">
    <PRODUCES amount="{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="4">
    <PRODUCES amount="{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="5">
    <PRODUCES amount="{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="6">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="7">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="8">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="9">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="10">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="11">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="12">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="13">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="14">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="15">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="16">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="17">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="18">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <MANA_ABILITY resource_id="19">
    <PRODUCES amount="{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}{G}" />
  </MANA_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="RSN_TOKEN_MANA_G" />
  <HELP title="MORE_INFO_BADGE_TITLE_6" body="MORE_INFO_BADGE_BODY_6" zone="ZONE_ANY" />
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
Last edited by wtb300 on 13 Nov 2013, 01:51, edited 3 times in total.
wtb300
 
Posts: 46
Joined: 02 Nov 2013, 21:04
Has thanked: 5 times
Been thanked: 0 time

Re: Overgrown battlement help

Postby RiiakShiNal » 13 Nov 2013, 01:35

That error means there is a problem in the coding of the card (syntax error) on line 8 of one of the CONTINUOUS_ACTION blocks, though without seeing the code I can't tell you any more.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Overgrown battlement help

Postby wtb300 » 13 Nov 2013, 01:39

i tried posting the code but im not sure how. it says the xml is an attack
wtb300
 
Posts: 46
Joined: 02 Nov 2013, 21:04
Has thanked: 5 times
Been thanked: 0 time

Re: Overgrown battlement help

Postby MC Brodie » 13 Nov 2013, 01:51

I think you need 5 posts before you can have somewhat large posts. So try it now.
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Overgrown battlement help

Postby wtb300 » 13 Nov 2013, 01:53

i got the code up. thanks MC Broodie
wtb300
 
Posts: 46
Joined: 02 Nov 2013, 21:04
Has thanked: 5 times
Been thanked: 0 time

Re: Overgrown battlement help

Postby MC Brodie » 13 Nov 2013, 02:07

That's an interesting take on Riiak's backup mana abilities :). I'm not sure all of that is needed but I'm not the person to ask. I'm sure he'll add his input for that section.

I think your problem lies in your filter for defender. To test for defender use:
Code: Select all
filter:Add( FE_CHARACTERISTIC, OP_HAS, CHARACTERISTIC_DEFENDER )
edit- Well after looking at Riiak's Azorius Chancery it looks like that's the way to do it. So I take it back :).
Last edited by MC Brodie on 13 Nov 2013, 02:40, edited 1 time in total.
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: Overgrown battlement help

Postby wtb300 » 13 Nov 2013, 02:22

Brilliant. Works perfectly now. thank you so much.
wtb300
 
Posts: 46
Joined: 02 Nov 2013, 21:04
Has thanked: 5 times
Been thanked: 0 time

Re: Overgrown battlement help

Postby RiiakShiNal » 13 Nov 2013, 02:37

It's recommended to start using RSN_CheckSwitchToFallback() as it handles some more situations and requires less code on the card so your fallback block could look more like this:
Code: Select all
    <CONTINUOUS_ACTION layer="8">
    local oCard = EffectSource()
    if (oCard ~= nil) then
      local oCharacteristics = oCard:GetCurrentCharacteristics()
      if (RSN_CheckSwitchToFallback(oCard)) then
        local filter = ClearFilter()
        filter:Add( FE_CHARACTERISTIC, OP_HAS, CHARACTERISTIC_DEFENDER )
        filter:Add( FE_CONTROLLER, OP_IS, EffectController())
        local numAbilities = filter:CountStopAt(19)
        oCharacteristics:GrantAbility( numAbilities )
      end
    end
    </CONTINUOUS_ACTION>
As for how the backup mana abilities are handled, yep, that is about the only way to handle it properly due to all the limitations the engine has on MANA_ABILITY blocks.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Overgrown battlement help

Postby wtb300 » 13 Nov 2013, 02:55

Thanks for all the help. It was my first attempt at coding so I used the code from Tolarian Academy and tried to modify it to fit. I'll take your advice and switch it to RSN_CheckSwitchToFallback().
wtb300
 
Posts: 46
Joined: 02 Nov 2013, 21:04
Has thanked: 5 times
Been thanked: 0 time


Return to 2014

Who is online

Users browsing this forum: No registered users and 6 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form