It is currently 08 Nov 2025, 15:28
   
Text Size

Card Contributions

Post MTG Forge Related Programming Questions Here

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

Re: Card Contributions

Postby kevvo » 27 Jun 2013, 02:45

swordshine wrote:Thanks, kevvo. The card script is correct, but if you downloaded the latest snapshot
...
BTW, M14 spoiler season is coming, if you are interested in some of the cards, you have plenty of opportunities to script them. http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=10360
I was just browsing the SVN repo and noticed Rev 22096 - Added 30 banding cards :) I am interested in learning more about the scripting of cards but I doubt I will figure it out fast enough to contribute to M14.
kevvo
 
Posts: 2
Joined: 26 Jun 2013, 22:33
Has thanked: 0 time
Been thanked: 0 time

Re: Card Contributions

Postby PowerClaws » 27 Jun 2013, 12:12

kevvo wrote:
swordshine wrote:Thanks, kevvo. The card script is correct, but if you downloaded the latest snapshot
...
BTW, M14 spoiler season is coming, if you are interested in some of the cards, you have plenty of opportunities to script them. http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=10360
I was just browsing the SVN repo and noticed Rev 22096 - Added 30 banding cards :) I am interested in learning more about the scripting of cards but I doubt I will figure it out fast enough to contribute to M14.
Just do what i do, look at a card, and see if there are cards in forge that either do parts, or do things that are similar, and then try mashing them together
It sometimes works, but you learn a lot in the process, for which im thankful that the people on these forums are patient enough to say whats the problem when i submit one thats way out of the ballpark :lol:
PowerClaws
 
Posts: 131
Joined: 30 Jan 2012, 11:33
Has thanked: 28 times
Been thanked: 8 times

Re: Card Contributions

Postby Max mtg » 27 Jun 2013, 22:54

Agetian wrote:Do you have an idea why the "creature buried" sound effect doesn't fire when Abu Ja'far destroys the card? Should there be an extra notification about the event somewhere that would still notify the sound system if the LKI of the card is used when determining that the card should be buried?
It does play an "AAAaaah...." sound, I've just tested.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Contributions

Postby Sloth » 30 Jun 2013, 22:06

Max mtg wrote:Then it results in just a couple of fields. CombatLki is to contain a reference to AttackingBand and a boolean flag.

  • If the flag equals true, then the Band indicates attacking band this creature used to belong to (note, that empty bands must not be cleared from combat). Given the band, we can get the (remaining in play) creatures blocking it and the defender.
  • If the flag is false, the Band reference indicates the attackers blocked by that creature.
This will allow to test if a LKI cards was attacking (+get target), was blocking or blocked. This would also allow to get remaning in play combatants fighting the LKI one.
It seems like CombatLKI's aren't created when cards move to the library from the battlefield, which causes NPE's when you Condemn an attacker with a trigger on the stack that uses DefendingPlayer (like Abyssal Nightstalker).

Maybe it's time to merge moveToLibrary into changeZone?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Contributions

Postby friarsol » 06 Jul 2013, 03:14

Max your conversion of Witch-Maw Nephilim doesn't look right. You scripted it as an intervening if of the trigger, but it's actually a conditional effect.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby Max mtg » 06 Jul 2013, 19:06

friarsol wrote:Max your conversion of Witch-Maw Nephilim doesn't look right. You scripted it as an intervening if of the trigger, but it's actually a conditional effect.
What should I change about the effect to make it right-scripted?

Or just give any example of card with conditional effect properly scripted... please.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Contributions

Postby Sloth » 06 Jul 2013, 19:55

Max mtg wrote:
friarsol wrote:Max your conversion of Witch-Maw Nephilim doesn't look right. You scripted it as an intervening if of the trigger, but it's actually a conditional effect.
What should I change about the effect to make it right-scripted?

Or just give any example of card with conditional effect properly scripted... please.
The trigger does not care about the power, the pump ability should have a condition like in the script of Rending Vines.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Contributions

Postby Max mtg » 06 Jul 2013, 21:30

Sloth wrote:The trigger does not care about the power, the pump ability should have a condition like in the script of Rending Vines.
Thank you for hints, Sloth.
Commited in 22459
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Contributions

Postby friarsol » 08 Jul 2013, 03:47

I have a script conversion of Master of the Wild Hunt coming. Have a bit more things to test with it, but assuming I have some free time in the next few days I'll commit it real soon.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Contributions

Postby AlexV » 14 Jul 2013, 11:25

Here's a script for Lost In Thought. If the principle is OK, then this can probably be used for other cards with "ignore this effect until end of turn." abilities:

Lost in Thought | Open
Code: Select all
Name:Lost in Thought
ManaCost:1 U
Types:Enchantment Aura
K:Enchant creature
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | CheckSVar$ IgnoreEffect | SVarCompare$ EQ0 | AddHiddenKeyword$ CARDNAME can't attack or block. & CARDNAME's activated abilities can't be activated. | Description$ Enchanted creature can't attack or block and its activated abilities can't be activated.
A:AB$ StoreSVAR | Cost$ ExileFromGrave<3/Card> | SVar$ IgnoreEffect | Type$ Number | Expression$ 1 | Description$ Ignore this effect until end of turn.
T:Mode$ Phase | Phase$ Cleanup | Execute$ EndOfTurnReset | Static$ True
SVar:EndOfTurnReset:AB$ StoreSVar | Cost$ 0 | SVar$ IgnoreEffect | Type$ Number | Expression$ 0
SVar:IgnoreEffect:Number$0

SVar:Picture:http://www.wizards.com/global/images/magic/general/lost_in_thought.jpg
Oracle:Enchant creature\nEnchanted creature can't attack or block, and its activated abilities can't be activated. Its controller may exile three cards from his or her graveyard for that player to ignore this effect until end of turn.
AlexV
 
Posts: 15
Joined: 14 Sep 2012, 16:17
Has thanked: 0 time
Been thanked: 1 time

Re: Card Contributions

Postby moomarc » 14 Jul 2013, 14:23

The idea is good as far as I can tell. Only issue at the moment is that only the controller of Lost in Though is the only player that can activate the ignore effect instead of the controller of the enchanted card. We'd need to add a parameter that only allows a defined player to activate the ability. We would probably also need to add some AI for cards like this.
AlexV wrote:Here's a script for Lost In Thought. If the principle is OK, then this can probably be used for other cards with "ignore this effect until end of turn." abilities:

Lost in Thought | Open
Code: Select all
Name:Lost in Thought
ManaCost:1 U
Types:Enchantment Aura
K:Enchant creature
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | CheckSVar$ IgnoreEffect | SVarCompare$ EQ0 | AddHiddenKeyword$ CARDNAME can't attack or block. & CARDNAME's activated abilities can't be activated. | Description$ Enchanted creature can't attack or block and its activated abilities can't be activated.
A:AB$ StoreSVar | Cost$ ExileFromGrave<3/Card> | SVar$ IgnoreEffect | Type$ Number | Expression$ 1 | Description$ Ignore this effect until end of turn.
T:Mode$ Phase | Phase$ Cleanup | Execute$ EndOfTurnReset | Static$ True
SVar:EndOfTurnReset:AB$ StoreSVar | Cost$ 0 | SVar$ IgnoreEffect | Type$ Number | Expression$ 0
SVar:IgnoreEffect:Number$0
SVar:Picture:http://www.wizards.com/global/images/magic/general/lost_in_thought.jpg
Oracle:Enchant creature\nEnchanted creature can't attack or block, and its activated abilities can't be activated. Its controller may exile three cards from his or her graveyard for that player to ignore this effect until end of turn.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Contributions

Postby AlexV » 14 Jul 2013, 14:48

Ah, that's a good catch about the controller. I don't see a good way around that - I could add an "AnyOpponent$ True" to the ability, but that's not quite right either. Oh well, another one for the half-implemented cards pile then, sorry.

Alex
AlexV
 
Posts: 15
Joined: 14 Sep 2012, 16:17
Has thanked: 0 time
Been thanked: 1 time

Re: Card Contributions

Postby swordshine » 14 Jul 2013, 16:00

Actually the "ignore this effect until end of turn" is a static ability, not an activated one. It won't use stack.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Contributions

Postby moomarc » 14 Jul 2013, 16:18

swordshine wrote:Actually the "ignore this effect until end of turn" is a static ability, not an activated one. It won't use stack.
I took that into account in the version I'm testing, but having some issues with checkActivatorRestrictions returning false but still making it through canPlay. So I'll keep trying to figure out what's going wrong...
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Contributions

Postby moomarc » 18 Jul 2013, 05:46

I'm trying to add a BlockersDeclared trigger for Tide of War. I still have a few kinks to work out but the most important at this point is I'm not sure whether the trigger should fire once for each defending player or once for the entire combat. Do any of you know perhaps?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 66 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 66 users online :: 0 registered, 0 hidden and 66 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 66 guests

Login Form