It is currently 19 Apr 2024, 16:17
   
Text Size

Appreciating advices about Bonds of Faith

Moderator: CCGHQ Admins

Appreciating advices about Bonds of Faith

Postby thefiremind » 05 May 2012, 16:35

Taking a break from the full localisation of my cards, I'm coding some cards that will form a Human deck. I made Bonds of Faith, and the effect works, but I'm having a problem because of the AI's dumbness...

I used return TargetNeutralF() in the TARGET_DETERMINATION since Bonds of Faith can be used for different purposes on player's or opponent's creatures. By doing this, in a mirror match, the AI used Bonds of Faith on my Mikaeus, the Lunarch... this taught me that the AI can't determine in which situations the card should be used on opponent's creatures. #-o

The "brutal" solution would be to force the AI to use Bonds of Faith for one purpose only, for example:
Code: Select all
    <TARGET_DETERMINATION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_IN_PLAY )
    if Object():GetPlayer():IsAI() ~= 0 then
      filter:AddSubType( CREATURE_TYPE_HUMAN )
      return TargetGoodF()
    else
      return TargetNeutralF()
    end
    </TARGET_DETERMINATION>
this would force the AI to use the card on its Human creatures only.

Does anybody have a better solution?
< 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: Appreciating advices about Bonds of Faith

Postby Pesi » 06 May 2012, 16:37

Is there no way to filter away only enemy-controlled humans (and it's own non-humans)? Since the Target-functions are all just a filter-function followed by...
Code: Select all
  if Object():GetFilter():CountStopAt(1) == 1 then
    return TARGET_DETERMINATION_ALL
  else
    return TARGET_DETERMINATION_NONE
  end
it feels like this kind of card should use it's own thing followed by the above instead of TargetGood/Bad/NeutralF()
Pesi
 
Posts: 21
Joined: 03 May 2012, 15:19
Has thanked: 0 time
Been thanked: 0 time

Re: Appreciating advices about Bonds of Faith

Postby thefiremind » 06 May 2012, 18:04

Pesi wrote:Is there no way to filter away only enemy-controlled humans (and it's own non-humans)? Since the Target-functions are all just a filter-function followed by...
Code: Select all
  if Object():GetFilter():CountStopAt(1) == 1 then
    return TARGET_DETERMINATION_ALL
  else
    return TARGET_DETERMINATION_NONE
  end
it feels like this kind of card should use it's own thing followed by the above instead of TargetGood/Bad/NeutralF()
The "filter-function" you are talking about is SetNeutral/ParentHint/ParentAntiHint. I'm not sure about the behaviour when not specifying this, but it could be the same as using SetNeutral.
And there's no way to combine sub-groups of functions in the same filter, so you can't say "(humans AND controlled by you) OR (non humans AND controlled by opponent)" because there's no way to express the parentheses.
< 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: Appreciating advices about Bonds of Faith

Postby Pesi » 06 May 2012, 19:52

The only other idea I have is to either:
1)Mess with the card's in-play value depending on what kind of target is picked... or
2)Have the card simply have a different targeting-schema when played by an AI; it would be modal with a "good" ability that targets only humans and a "bad" ability that targets only non-humans.
Pesi
 
Posts: 21
Joined: 03 May 2012, 15:19
Has thanked: 0 time
Been thanked: 0 time

Re: Appreciating advices about Bonds of Faith

Postby thefiremind » 06 May 2012, 19:55

Pesi wrote:2)Have the card simply have a different targeting-schema when played by an AI; it would be modal with a "good" ability that targets only humans and a "bad" ability that targets only non-humans.
I thought about this recently. It could be a nice idea if I can make it in practice.
< 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 26 guests


Who is online

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

Login Form