It is currently 22 Jun 2025, 21:59
   
Text Size

Come into play tapped unless you pay 2 life

Moderator: CCGHQ Admins

Come into play tapped unless you pay 2 life

Postby pcastellazzi » 05 Nov 2012, 01:48

I was coding Blood Crypt while i found this little problem. I will start with the solution i am using to show what i want to achieve.

Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_TRANSITION" replacement_query="1">
  <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY">
    EffectDC():Set_Int(0, EffectController():GetLifeTotal() > 2 and 1 or 0)
  ]]>
  </TRIGGER>

  <PLAY_TIME_ACTION target_choosing="1">
    if EffectDC():Get_Int(0) == 1 then
      YesNoPrompt("CARD_QUERY_OPTION_PAY_2_LIFE")
    end
  </PLAY_TIME_ACTION>

  <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Int(0) == 1 and Object():GetMultipleChoiceResult() == 0 then
      EffectController():LoseLife(2)
    else
      Object():ComesIntoPlayTapped()
    end
  </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
The code before this lines works ok, but i think the same effect can be achieved with a conditianl cost. Something like this:

Code: Select all
<TRIGGERED_ABILITY internal="1">
  <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />

  <COST type="Life" points="2" qualifier="conditional" />
 
  <RESOLUTION_TIME_ACTION conditional="else">
    Object():ComesIntoPlayTapped()
  </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
The prolem is while the dialog about paying the cost is presented, the resolution time action never run. What's wrong?
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: Come into play tapped unless you pay 2 life

Postby thefiremind » 05 Nov 2012, 09:36

My guess is that the "internal" has something to do with it. Have you tried with a "hybrid" between the 2 solutions? Something like:
Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_TRANSITION" replacement_query="1">
  <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
  <COST type="Life" points="2" qualifier="conditional" />
  <RESOLUTION_TIME_ACTION conditional="else">
  Object():ComesIntoPlayTapped()
  </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
< 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: Come into play tapped unless you pay 2 life

Postby pcastellazzi » 11 Nov 2012, 15:03

I was playing a little bit more with this today. You were right, internal="1" is the problem. After i removed it the conditional cost work as expected, same for the conditional action.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 5 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form