It is currently 11 Sep 2025, 20:48
   
Text Size

StaticEffectFactory

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 11:46

I see that Sol made an interesting merge recently. The new AF_Attach has/had a section for adding additional code that would handle pump like abilities. With this section filled out we could migrate the enPump cards over to AF_Attach.

With Sloth's recent work in static effects we have a second possible solution to AF_Attach. So Sol, I saw your Holy Strength merge. What are your plans? Should the enPump auras be converted to this format or do you plan to fill out the code in AF_Attach to handle the pump like abs?

Holy Strength | Open
Name:Holy Strength
ManaCost:W
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ W | ValidTgts$ Creature | AILogic$ Pump
S:Mode$ Continuous | Affected$ Creature.AttachedBy | AddPower$ 1 | AddToughness$ 2 | Description$ Enchanted creature gets +1/+2.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/holy_strength.jpg
SetInfo:8ED|Common|http://magiccards.info/scans/en/8e/24.jpg
SetInfo:LEA|Common|http://magiccards.info/scans/en/al/208.jpg
SetInfo:LEB|Common|http://magiccards.info/scans/en/be/210.jpg
SetInfo:7ED|Common|http://magiccards.info/scans/en/7e/20.jpg
SetInfo:5ED|Common|http://magiccards.info/scans/en/5e/311.jpg
SetInfo:4ED|Common|http://magiccards.info/scans/en/4e/280.jpg
SetInfo:9ED|Common|http://magiccards.info/scans/en/9e/19.jpg
SetInfo:10E|Common|http://magiccards.info/scans/en/10e/22.jpg
SetInfo:M11|Common|http://magiccards.info/scans/en/m11/16.jpg
SetInfo:M10|Common|http://magiccards.info/scans/en/m10/15.jpg
SetInfo:3ED|Common|http://magiccards.info/scans/en/rv/208.jpg
SetInfo:2ED|Common|http://magiccards.info/scans/en/un/209.jpg
End
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby friarsol » 09 Jul 2011, 13:19

Chris H. wrote:I see that Sol made an interesting merge recently. The new AF_Attach has/had a section for adding additional code that would handle pump like abilities. With this section filled out we could migrate the enPump cards over to AF_Attach.

With Sloth's recent work in static effects we have a second possible solution to AF_Attach. So Sol, I saw your Holy Strength merge. What are your plans? Should the enPump auras be converted to this format or do you plan to fill out the code in AF_Attach to handle the pump like abs?
What you see is the plan, instead of enPump and all the extra baggagage, we can just let StaticAbilities do the work they are already doing.

Attach will be have few parameters (What it can Attach, and How the AI will attempt to play it). And the AI portions of the code will look through the Static Effects of the Attachment and pick the most "suitable" to attach. We could start on converting enPumps to Attach and Statics as I continue to improve the AI. (Keyword repetition doesn't quite happen yet, although it's almost there. Other "weighting" doesn't occur yet either, but will slowly come around)

Once this conversion happens: we can start coding something for Auras that ETB without being Cast. The simplest way to do it is to have a non-Targeted "Choose Something to Attach" based off the SpellPermanent Attach Target.

Oh also, Holy Strength should probably be "Creature.EnchantedBy" not "AttachedBy" although, I think it's impossible for it to turn into a non-Aura Equipment.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 13:39

friarsol wrote:What you see is the plan, instead of enPump and all the extra baggagage, we can just let StaticAbilities do the work they are already doing.

Attach will be have few parameters (What it can Attach, and How the AI will attempt to play it). And the AI portions of the code will look through the Static Effects of the Attachment and pick the most "suitable" to attach. We could start on converting enPumps to Attach and Statics as I continue to improve the AI. (Keyword repetition doesn't quite happen yet, although it's almost there. Other "weighting" doesn't occur yet either, but will slowly come around)

Once this conversion happens: we can start coding something for Auras that ETB without being Cast. The simplest way to do it is to have a non-Targeted "Choose Something to Attach" based off the SpellPermanent Attach Target.

Oh also, Holy Strength should probably be "Creature.EnchantedBy" not "AttachedBy" although, I think it's impossible for it to turn into a non-Aura Equipment.
`
Sounds like a good plan, AF_Attach does the attaching and detaching and pass off the pumps to StaticAbilities. The StaticAbilities are turning out to be more human readable than the older style of st keywords.

Might as well start the conversion even if AF_Attach is not yet finished. I spent a few days recently looking at the old aura keyword code. Decided that it was not worth the effort to re-write. And there may be a problem outside of the aura keyword code itself. Not sure about it though.

Good catch on the "Creature.EnchantedBy", with over 400 auras it would be best to do this once and not have to go back and correct this.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 13:58

I have a question about StaticAbilities granting more than one keyword. How is this being handled? The original way in the enPump keywords would be to have:

keyword1 & keyword2 & keyword3

Does StaticAbilities use this system or some other?
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby friarsol » 09 Jul 2011, 14:08

Hmm.. I just tested EnchantedBy and it doesn't seem to work. Maybe it's called something else? Looks like we don't have anything for that. We just have AttachedBy for both Enchantment and Equipment.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 14:14

friarsol wrote:Hmm.. I just tested EnchantedBy and it doesn't seem to work. Maybe it's called something else? Looks like we don't have anything for that. We just have AttachedBy for both Enchantment and Equipment.
`
Do you you want to add something to the code to make this distinction? Granted, it may not make a difference now, but what about those unforeseen circumstances that crop up now and then. :mrgreen:
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby friarsol » 09 Jul 2011, 14:28

Chris H. wrote:Do you you want to add something to the code to make this distinction? Granted, it may not make a difference now, but what about those unforeseen circumstances that crop up now and then. :mrgreen:
Yea might as well have em in there.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby jeffwadsworth » 09 Jul 2011, 14:30

Chris H. wrote:I have a question about StaticAbilities granting more than one keyword. How is this being handled? The original way in the enPump keywords would be to have:

keyword1 & keyword2 & keyword3

Does StaticAbilities use this system or some other?
AddKeyword$ Flying & HIDDEN Indestructible
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: StaticEffectFactory

Postby Sloth » 09 Jul 2011, 16:14

jeffwadsworth wrote:
Chris H. wrote:I have a question about StaticAbilities granting more than one keyword. How is this being handled? The original way in the enPump keywords would be to have:

keyword1 & keyword2 & keyword3

Does StaticAbilities use this system or some other?
AddKeyword$ Flying & HIDDEN Indestructible
Yes it's the same as in AF Pump.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 18:17

Thank you Sloth and Jeff. That should make things easier.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 18:33

friarsol wrote:
Chris H. wrote:Do you you want to add something to the code to make this distinction? Granted, it may not make a difference now, but what about those unforeseen circumstances that crop up now and then. :mrgreen:
Yea might as well have em in there.
`
Thank you Sol.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby Chris H. » 09 Jul 2011, 22:52

I am slowly working my way through the auras. I am only converting the very simple enPump auras that are similar to the aura that Sol converted today, Holy Strength.

Auras that use the enPumpCurse variant may need to wait, unless the AI code is in place.

We also have a large number of auras that use the "enPump:0/0" variant. They use the keyword solely to attach and to detach. The actual abilities of these auras are granted by one of the static keywords.

I think that it may be OK to replace just the "K:enPump:0/0" with "A:SP$ Attach | Cost$ | ValidTgts$ Creature | AILogic$ Pump" unless there is some sort of a reason to hold off at this time?

It should be possible to replace the "K:enPump:0/0" keyword now and to replace the static keyword portion once the StaticAbility AF can handle this.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: StaticEffectFactory

Postby Sloth » 10 Jul 2011, 09:34

Chris H. wrote:It should be possible to replace the "K:enPump:0/0" keyword now and to replace the static keyword portion once the StaticAbility AF can handle this.
I'm pretty sure all stPumpEnchanted keywords can be converted to continuous static effects already. :D
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby jeffwadsworth » 10 Jul 2011, 16:51

The StaticEffect scripts make the stPumpSelf stuff so much clearer. Love the CheckSVar idea.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: StaticEffectFactory

Postby Chris H. » 11 Jul 2011, 01:38

I have finished the simple enPump conversions. I plan to check out the enPump:0/0 auras that use stPumpEnchanted. With luck I may be able to convert a few dozen more auras.

EDIT:

I think that Jeff was able to do a total conversion of White Scarab. I think that the scarabs are/were using a combo of enPump:0/0 and stPumpEnchanted.


Do we have enough AI in place to handle the enPumpCurse auras at this time? If so, how is this handled. Is it as simple as giving it "IsCurse$ True"?

How will the AI handle auras like Twisted Experiment? This aura gives +3/-1. There may be times when this could be a buff and times when it could be a curse and used as a threat removal.
Last edited by Chris H. on 11 Jul 2011, 01:44, edited 1 time in total.
Reason: White Scarab conversion
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 29 guests

Main Menu

User Menu

Our Partners


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 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 29 guests

Login Form