It is currently 11 Sep 2025, 11:27
   
Text Size

So I got a little sidetracked... again.

Post MTG Forge Related Programming Questions Here

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

So I got a little sidetracked... again.

Postby Hellfish » 21 Apr 2012, 11:27

I'll just leave this here.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby friarsol » 21 Apr 2012, 12:37

Oh dear... For those that can't see the cards involved:

Duct Crawler, <something that gives a +1/+1 counter, wasn't paying attention>, and... Experiment Kraj
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: So I got a little sidetracked... again.

Postby moomarc » 21 Apr 2012, 13:16

OMG! That's awesome!

Do you think its anywhere near possible to make it work for scripted cards? If so is there anything we need to do to help. Maybe if activated abilities in scripts were blocked out (including all relevant svars) for easy reference? Something like this:
Code: Select all
Name:Baku Altar
ManaCost:2
Types:Artifact
Text:no text
T:Mode$ ...
SVar:Trig...
<Start Activated Abilities>
A:AB$ Token | Cost$ 2 T SubCounter<1/KI> | TokenAmount$ 1 | TokenName$ Spirit | TokenTypes$ Creature,Spirit | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | TokenOwner$ You | SpellDescription$ Put a 1/1 colorless Spirit creature token onto the battlefield.
<End Activated Abilities>
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/baku_altar.jpg
SetInfo:BOK|Rare|http://magiccards.info/scans/en/bok/152.jpg
Oracle:Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Baku Altar.\n{2}, {T}, Remove a ki counter from Baku Altar: Put a 1/1 colorless Spirit creature token onto the battlefield.
End
I'd be willing to start converting the scripts for the Experimental Kraj (and I'm guessing it could then be carried across to cards like Havengul Lich etc).
-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: So I got a little sidetracked... again.

Postby Hellfish » 21 Apr 2012, 13:37

Marc: The simplest solution would be to just copy every SVar except Picture,Picture1,Rarity,RemAIDeck,RemRandomDeck and the like. Your suggestion is much more elegantly functioning though.A lot of X SVars will to be renamed for uniqueness too(And some places that demand X is used will probably need to be rewritten to allow arbitrary SVar names.

Sol: Travel Preparations. ;)

This requires turning all anonymous instances of AbilityActivated into local subclasses. Simple enough with a C&P job. Not sure if/how this affects heap space,though.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby silly freak » 21 Apr 2012, 16:55

the Compiler takes care of inline classes; in the end, they are all ordinary classes with some generated fields and fancy access ti the outer class. so no problem there. if the nested class could even be made static, It's even possible that there's a positive performance impact ;)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: So I got a little sidetracked... again.

Postby Hellfish » 22 Apr 2012, 11:30

Thanks, good to know. :)

Small update: Working on interaction with ability-granting things like Blazing Torch.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby Hellfish » 22 Apr 2012, 17:27

Update:Moved the hardcoded bit that actually handled the copying of the abilities into StaticAbilityContinuous.Converted Experiment Kraj to script and added Necrotic Ooze. AFAICT, every AbilityActivated anonymous instance has been turned into a subclass that can be "stolen".Added "ActivatedAbilitiesBegin" and "ActivatedAbilitiesEnd" flags as per Marc's suggestion, though no cards use them yet.

Also, have a jar & patch combo meal for testing :)
AbilityPatch 1.txt
(186.12 KiB) Downloaded 228 times


EDIT:Apparentyl uploadstation is shit and won't let anybody download the jar (gives "Only uploader may download" message even to me!). Hold tight while I upload elsewhere.APPARENTLY Filehosting sites as a whole have gone to shit since megaupload. :(
Last edited by Hellfish on 22 Apr 2012, 17:49, edited 2 times in total.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby friarsol » 22 Apr 2012, 17:32

I'm not sure how I feel about the Activated Abilites Block. It feels cluttered to me.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: So I got a little sidetracked... again.

Postby Hellfish » 22 Apr 2012, 17:51

I'm not sure how else to handle "assistant" SVars,though. Copying all the non-omnipresent svars could concievably break things that grant Kraj or Ooze svars..
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby Hellfish » 25 Apr 2012, 18:14

Been thinking a bit and there *might* be a way for spellabilities to autodetect "assistant" SVar with a bit of invasive surgery to them and Costs. Still, a ton of SVars would have to be renamed for uniqueness, XYZ SVars foremost. Cost would need to accept arbitrary SVar names too.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby Hellfish » 27 Apr 2012, 20:03

Rethinking *again*... Previous idea is likely not doable without really,and I mean really, tainting the Cost and AbilityFactories codebase. Least intrusive method (but most arduous) would probably be to rename all SVars for all activated abilities on all cards according to the pattern "AAB_<Card Name>_<Identifier>".

EDIT:We'd still need to add the possibility for arbitrary SVar names in a few places still,also.

EDIT:Maybe a more strict SVar naming regimen overall is called for, in case we ever get a card that gains "all triggered abilities" or even "all abilities". "<Type(AAB,TRIG,STAT,more?)>_<Card Name>_<Identifier>"?
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby friarsol » 27 Apr 2012, 20:37

Hellfish wrote:Rethinking *again*... Previous idea is likely not doable without really,and I mean really, tainting the Cost and AbilityFactories codebase. Least intrusive method (but most arduous) would probably be to rename all SVars for all activated abilities on all cards according to the pattern "AAB_<Card Name>_<Identifier>".

EDIT:We'd still need to add the possibility for arbitrary SVar names in a few places still,also.
I almost feel like we need to move away from using SVars at all to handle all of this. Instead of having a arbitrary String Variables attached to a card, maybe we need to have them strictly attached to the SpellAbility they are apart of.

This might sidetrack this thread, but maybe we can compile a list of SVars, how they are used and see if we can figure out a way to move them off of Card objects.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: So I got a little sidetracked... again.

Postby Hellfish » 27 Apr 2012, 21:45

    Subabilities -> SpellAbilities (Already there,right?)
    Triggered abilities -> Trigger Object?
    Statically granted abilities -> StaticAbility?
    XCounts -> ?
    Rarity (Not even referenced in code,AFAICT) -> absolutely-removed-from-the-freaking-game-forever zone
    LQ Picture URLs -> nowhere else
    AI Usage limitations -> nowhere else
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: So I got a little sidetracked... again.

Postby Max mtg » 27 Apr 2012, 22:07

Hellfish wrote:
    Rarity (Not even referenced in code,AFAICT) -> absolutely-removed-from-the-freaking-game-forever zone
You may learn rarity for CardPrinted objects. forge.Card did not need it anyway.
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: So I got a little sidetracked... again.

Postby Hellfish » 28 Apr 2012, 06:47

Exactly;CardPrinted gets the rarity from the SetInfo, so the rarity SVar is just filler nowadays.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 33 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form