Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Conditional AI Availability
Moderator: CCGHQ Admins
Conditional AI Availability
by Xander9009 » 13 Nov 2014, 20:47
Is there a way to use AI Availability tags only if a condition is met? For Teferi, Temporal Archmage we need to add the AI availability tags to the abilities if his ultimate has been activated. Only, I don't know of a way to conditionalize them.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Conditional AI Availability
by NeoAnderson » 13 Nov 2014, 20:58
I think You can use Ai AVAILABILITY block as other blocks, set a variable to 1 when the ability is activated, reset it to 0 when the turn end. Inside the block you check the value and return true when the variable is 1.Xander9009 wrote:Is there a way to use AI Availability tags only if a condition is met? For Teferi, Temporal Archmage we need to add the AI availability tags to the abilities if his ultimate has been activated. Only, I don't know of a way to conditionalize them.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Conditional AI Availability
by thefiremind » 13 Nov 2014, 23:07
They are implicitly conditional already: if the AI can't follow some of the availability "advices", it will just ignore them. So I would add them without worrying about it.
This should need tests, I'm not sure if you can use AI_AVAILABILITY the same way as AI_CUSTOM_SCORE... if I were to guess, I'd guess not, but I can't be sure.NeoAnderson wrote:I think You can use Ai AVAILABILITY block as other blocks, set a variable to 1 when the ability is activated, reset it to 0 when the turn end. Inside the block you check the value and return true when the variable is 1.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Conditional AI Availability
by Xander9009 » 13 Nov 2014, 23:35
I put it together and gave it to fallenangel to try out. So I'm just waiting to see if it worked. However, if it'll just ignore them, then I'll just add them and let the AI ignore them.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Conditional AI Availability
by NeoAnderson » 14 Nov 2014, 14:24
I also haven't test but what about to use normal <AVAILABILITY> block and inside this block check if the player IsAI() condition??thefiremind wrote:They are implicitly conditional already: if the AI can't follow some of the availability "advices", it will just ignore them. So I would add them without worrying about it.This should need tests, I'm not sure if you can use AI_AVAILABILITY the same way as AI_CUSTOM_SCORE... if I were to guess, I'd guess not, but I can't be sure.NeoAnderson wrote:I think You can use Ai AVAILABILITY block as other blocks, set a variable to 1 when the ability is activated, reset it to 0 when the turn end. Inside the block you check the value and return true when the variable is 1.
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 12 guests