Aalnius wrote:I am stupid i just realised i copied the art into a separate folder inside the magic folder instead of just copying it into the magic folder.
just loaded it up when testing a card and the art is showing up now.
thank you for that also thank you for explaining how to link the art i'll start doing that in future cards.
i've managed to code one more card so far working on a third atm which uses the opponents hand size to decrease the cost of itself.
Just done it and it seems to work properly but it chucks out a list when the game closes with errors that are apparently attempting to index nil value.
Code below:
- | Open
- <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Affinity for opponent's hand size]]></LOCALISED_TEXT>
<TRIGGER value="CONSIDERED_FOR_CAST" simple_qualifier="self" pre_trigger="1" />
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local total = 12 - target_player:Hand_Count()
TriggerObject():DecreaseCost(total)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
This tried to access a chest marked as a target chest. There is no target chest, though, because it doesn't target anything. This kind of ability would be tricky. However, you would be able to do it. You'd need the card to have an activated ability with active_zone="ZONE_ANY" which has replacement_effect="1" and linked_ability_group="1". In that ability, target a player with a normal player targeting tag, but add not_targeted="1". Then, store that player in LinkedDC():Set_PlayerPtr(0, EffectDC():Get_Targets(0):Get_PlayerPtr(0)). This way, the player chooses an opponent and that choice is stored in a variable the other ability can access. Then, in the other ability (the one that reduces the cost), make sure it also has linked_ability_group="1", and get LinkedDC():Get_PlaterPtr(0). If it's not nil, then reduce the cost based on that player's Hand_Count().
Also, if you put code inside of a [ code][ /code] block (which itself is inside of a spoiler block), then the code will keep the spacing, making it much easier to read.
- Something like this | Open
- Code: Select all
<ACTIVATED_ABILITY replacement_effect="1" active_zone="ZONE_ANY" linked_ability_group="1">
<LOCALISED_TEXT LanguageCose="en-US"><![CDATA[Choose an opponent.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_OPPONENT" definition="0" compartment="0" count="1" not_targeted="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
if target_player ~= nil then
LinkedDC():Set_PlayerPtr(0, target_player)
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY" linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Affinity for opponent's hand size]]></LOCALISED_TEXT>
<TRIGGER value="CONSIDERED_FOR_CAST" simple_qualifier="self" pre_trigger="1" />
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
local target_player = LinkedDC():Get_PlayerPtr(0)
if target_player ~= nil then
local total = 12 - target_player:Hand_Count()
TriggerObject():DecreaseCost(total)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>