It is currently 26 Apr 2024, 16:29
   
Text Size

How to target cards in the exile zone?

Moderator: CCGHQ Admins

How to target cards in the exile zone?

Postby thefiremind » 04 Aug 2013, 09:57

I was attempting to code Jhoira's Timebug (yes, suspend might come back in my mod, if I solve this issue...) and I stumbled upon a major problem. Leaving aside the choice about which zone I want to target, I tried to ignore the possibility to target permanents and I made a target definition like this:
Code: Select all
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetZone(ZONE_EXILE)
    filter:Add( FE_OWNER, OP_IS, EffectController() )
    -- plus a characteristic that I gave to suspended cards, it's not important here
    </TARGET_DEFINITION>
When I tested it, I realized that the game can't handle targets in exile: the exile zone browser doesn't pop up, I can't pop it up by myself with the mouse, and the permanents are all greyed out because I'm not supposed to choose a card on the battlefield.
In previous DotP games this problem was easily ignored by making players choose their target from a chest... but in DotP2014 we have the TARGET block which, as far as I know, doesn't allow to choose the target from a chest. So, does anybody have an idea about how to target cards in the exile zone?
< 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: 721 times

Re: How to target cards in the exile zone?

Postby gorem2k » 09 Aug 2013, 09:12

the best I could do is by not "Targeting"

Code: Select all
    <RESOLUTION_TIME_ACTION>
    EffectController():MoveLocalZone( ZONE_EXILE, ZONE_STACK )
    local filter = ClearFilter()
    local effectController = EffectController()
    filter:SetZone( ZONE_STACK, effectController )
    effectController:SetItemCount( 1 )
    for i = 0, (1-1) do
       effectController:SetItemPrompt(i, "CARD_QUERY_CHOOSE_CARD" )
    end
    effectController:ChooseItems( EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
by moving local zone to stack I was able to choose an exiled card, but after that, every cards from exile resolves.. should be a way to make them go back to exile. I've also tried playing with ZONE_NOWHERE_YET, thought about moving ZONE_GRAVEYARD to nowhere, ZONE_EXILE to ZONE_GRAVEYARD, then put them back, but that made the engine crash :lol:
Last edited by gorem2k on 09 Aug 2013, 09:19, edited 1 time in total.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: How to target cards in the exile zone?

Postby thefiremind » 09 Aug 2013, 09:16

This could make unwanted triggers trigger, and what if there are some cards already on the stack at the time the ability resolves? You would be able to choose them as well.
< 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: 721 times

Re: How to target cards in the exile zone?

Postby gorem2k » 09 Aug 2013, 09:24

I don't know.

Seems that the exile zone can't be targeted, like you said. At least I'm trying :D
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: How to target cards in the exile zone?

Postby thefiremind » 09 Aug 2013, 11:50

And I appreciate that, but what I was hoping to see here is someone who accidentally found a way to let the TARGET block select the target from a chest, or to target without using a TARGET block, maybe with some filter option I overlooked.
If I don't need to target, there's no reason to move the cards anywhere, I can use a ChooseItemFromDC. :wink:
< 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: 721 times

Re: How to target cards in the exile zone?

Postby gorem2k » 09 Aug 2013, 13:10

Any idea what LoadTargetDefinitionFromDC actually do? I can't find any example.

At least, I've learned from this problem. I made a card that can return an exiled card to hand using ChooseItemFromDC.

Sorry I can't help you as much as you can help me. But I might stumble on a solution. who knows
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: How to target cards in the exile zone?

Postby thefiremind » 09 Aug 2013, 14:06

gorem2k wrote:Any idea what LoadTargetDefinitionFromDC actually do? I can't find any example.
Did you read this? If not, do it now, it will be easier for me to explain.
After you "extracted" a data chest from a spell with GetDataChest, you could extract a specified target chest with the Get_NthTargets function, then LoadTargetDefinitionFromDC should allow you to set the filter as it was set in the definition for that spell's target chest. I don't know if DotP2014 still supports Get_NthTargets and LoadTargetDefinitionFromDC (yes they are into the executable but do they still work?), and even if it does, I can't think of a good use of them that doesn't include the TestFilter function, which was returning true if a card could have been targeted by another one through a specific filter and is missing in DotP2014.
< 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: 721 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 29 guests


Who is online

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

Login Form