It is currently 16 Apr 2024, 04:28
   
Text Size

General XML/LUA Editing Findings

Moderator: CCGHQ Admins

General XML/LUA Editing Findings

Postby Epiphany » 01 Jul 2010, 07:56

I've taken it upon myself to start this thread with the hopes that people will have somewhere to post to enter into completely random discussions with regards to the editing of DotP.

I was prompted to make this thread last night after I noticed that Shadow is mentioned in the KEYWORDS.LUA file and decided to build a creature using it.

On first testing the opponent who could not block my creature with Shadow decided to cast a Giant Growth on his creature that couldn't block, thus wasting it.

I have assumed the AI didn't realise it wasn't blocking, which is a bit weird. I would've thought the Giant Growth would've only been cast as an instant after declaring blockers, so maybe it's just the AI pretending to be a random silly human.

Once I've had a more thorough test of Shadow, I'll get back to you with my findings.

Like I said before, this thread is for saying anything at all random that you discover/try/fail. The more information people bring to the community the more ideas we'll have and can take things further.

For starters, if anyone fancies it, feel free to have a poke around the KEYWORDS.LUA file for other abilities like Shadow that aren't actually featured on any cards in the game, and then playtest them to see if they react the way you think they should.

On an another topic, you can find my current notes on the trigger for creatures' "triggered abilities" at the following page:

http://padbury.uk.to/magic/triggers/

If you have anything to add to it, let me know and I'll change it.
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Epiphany » 01 Jul 2010, 09:56

On the subject of illustration naming, I tried to name an illustration "GM00001.TDX" (using my initials so that I can keep track of my own creations, but it wouldn't work in game.

However I have tried the naming convention starting with "90001GM.TDX" and that worked fine for me. If the numbering system works for me then it means I'll have nearly 10000 image slots without stepping on anyone's toes.
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Uresti » 01 Jul 2010, 14:57

we dont know yet whats the exact mode to work with the image names, but we know letters can make your card crash the game. i suggest use only numbers
Uresti
 
Posts: 151
Joined: 25 Jun 2010, 15:26
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Uresti » 01 Jul 2010, 21:52

About the weird behavior of Ai with the shadow creature i think can be solved adding something like EVASION_INDEX, check CLOUD SPRITE CARD for this:
<STATIC_ABILITY tag="CLOUD_SPRITE_RULE_2" layer="0">
<EFFECT>
CanOnlyBlockFlying()
</EFFECT>
this call a function on KEYWORDS.LUA
function CanOnlyBeBlockedByFlying()
Subject():GetCurrentCharacteristics():CanOnlyBeBlockedBy_Set( EVASION_INDEX_FLYING )
end
make a new function lets say CanOnlyBeBlockedByShadow() , give it to your creature and lets see what happen
Subject():GetCurrentCharacteristics():CanOnlyBeBlockedBy_Set( EVASION_INDEX_SHADOW )

you can find EVASION_INDEX in CONSTANTS.LUA
Uresti
 
Posts: 151
Joined: 25 Jun 2010, 15:26
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Epiphany » 02 Jul 2010, 08:06

Uresti wrote:make a new function lets say CanOnlyBeBlockedByShadow() , give it to your creature and lets see what happen
Subject():GetCurrentCharacteristics():CanOnlyBeBlockedBy_Set( EVASION_INDEX_SHADOW )
Thanks for that! Will give that a try later today.

On another topic, I've been trying to make Hermetic Study for my brother. It works, but as soon as you use the ability for the first time, Hermetic Study goes to the graveyard. Does anyone have any idea how to fix that?

All I did was copy the code from Prodigal Pyromancer, and put it into an enchantment.

Here's my code:

Code: Select all
<?xml version="1.0"?>
<MULTICARDS>
  <CARD>
    <TITLE text="HERMETIC_STUDY_TITLE" />
    <FILENAME text="HERMETIC_STUDY" />
    <COLLECTIONMAX value="383" />
    <COLLECTORNUMBER value="40" />
    <ARTID value="101032" />
    <FRAMECOLOUR name="U" />
    <COLOR value="U" />
    <ARTIST name="Ron Spencer" />
    <SUB_TYPE metaname="Aura" />
    <CASTING_COST cost="{1}{U}" />
    <CARDNUMBER value="18" />
    <TYPE metaname="Enchantment" />
    <EXPANSION metaname="US" />
    <RARITY metaname="uncommon" />
    <STATIC_ABILITY layer="0" tag="HERMETIC_STUDY_RULE_1">
      <TARGET_DETERMINATION>
        return TargetCreatureGood()
      </TARGET_DETERMINATION>
      <PLAYTIME>
        ChooseTarget( "ChooseCreatureToGainPing" )
      </PLAYTIME>
      <EFFECT>
        EnchantCreature()
      </EFFECT>
    </STATIC_ABILITY>
    <ACTIVATED_ABILITY simple_filter="Parent" tag="HERMETIC_STUDY_RULE_1" unlikely_to_attack="1" layer="6">
      <COST type="TapSelf" />
      <TARGET_DETERMINATION>
        return TargetCreatureOrPlayerBad()
      </TARGET_DETERMINATION>
      <PLAYTIME>
        ChooseTarget( "ChooseCreatureOrPlayerOneDamage" )
      </PLAYTIME>
      <EFFECT>
        DealDamageToTarget( 1 )
      </EFFECT>
        <AI_PLAY_SCORE>
        if (MTG():GetStep() == STEP_MAIN_2 and Object():GetController():MyTurn() == 0) then
          return (2000)
        else
          if (MTG():GetStep() == STEP_DECLARE_BLOCKERS) then
            return (1000)
          else
            if (MTG():GetStep() == STEP_DECLARE_ATTACKERS) then
              return (500)
            else
              return (0)
            end
          end
        end
      </AI_PLAY_SCORE>
      <AI_AVAILABILITY behaviour="InResponseOrBeforeMyUntap"/>
    </ACTIVATED_ABILITY>
    <HELP title="INFO_BADGE_TITLE_10" body="INFO_BADGE_BODY_10" />
    <HELP title="INFO_BADGE_TITLE_13" body="INFO_BADGE_BODY_13" />
  </CARD>
</MULTICARDS>
Any thoughts? :)

EDIT: In fact it doesn't work for another reason - it doesn't tap the card it enchants. Just sacs itself.
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Uresti » 02 Jul 2010, 14:46

mhhhh....i have no idea you choose to do a simple at sight card to do but for me looks tricky for a reason.Aura will provide a creature the ability to do 1 damage not the aura itself.
let me try to do mine too see what happen
Uresti
 
Posts: 151
Joined: 25 Jun 2010, 15:26
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Yanna » 03 Jul 2010, 18:28

Hi all, First post on these boards but i've been reading them alot !

I'm not sure i should post in this thread or start a new one, but i've found something annoying about DOTP editing.

For a start, i've made many cards (preparing a DLC for upload :p) and althought they play very nice with a human player, the AI seems to not even consider playing them.

And this is even if he has enough mana and nothing else to do.

The below pic is a game i was playing vs AI. I gave him a full sliver deck that consists only of creatures and mana (so it's pretty straightforward to play). Notice that i've forced him to discard with howling mines to see what he would drop... When you look at his graveyard you can see many slivers he could play... I don't have a clue what's wrong with the new cards.

Image

I'll make some new cards meanwhile but if someone has a clue on what to fix i'd be glad...

BR,

Yanna a.k.a NOVA

PS : I've tested the sliver decks it works like a charm ^^
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: General XML/LUA Editing Findings

Postby Epiphany » 03 Jul 2010, 19:43

Does he play any of them ever? It's very strange that he's not bothering to.

Although to be perfectly honest, I haven't actually tried any of my new cards with the computer using them yet, might be something I need to test extensively.

I would've thought he'd at least play the creature even if it's just to get a 2/2 creature into play, regardless of whether he understands the extra ability.

Can't wait to see your cards up for download! Will they be in English too?
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Yanna » 03 Jul 2010, 20:00

Well, he doesn't play any at all, right now i'm testing some 'grizzly bears' duplicates and the AI seems to act weird (plays one then stop playing the others, even with no defenders...).

For the cards, they are french/english ready ^^ i'll pack new cards and decks in DLC, too bad for now there won't be any AI to fight against :S
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: General XML/LUA Editing Findings

Postby Uresti » 03 Jul 2010, 20:10

Welcome Yanna to the forums!

You made an interesting point in editing DOTP Testing! im sure all the cards made by now plays very well for a human but honestly didnt care to test AI playing them. maybe has something to do with AI_BEHAVIOR> ?? or with
<COLLECTIONMAX value="0" />
<COLLECTORNUMBER value="117" />
<CARDNUMBER value="9" />
many cards have a CARDNUMBERVALUE numbered between 2 and 18 (that i remember)
and surely cant be COLLECTIONMAX "0" cuz supposedly is 383
BTW nice work with the SLIVERS!
maybe ill try to do some allies :)
Uresti
 
Posts: 151
Joined: 25 Jun 2010, 15:26
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Epiphany » 03 Jul 2010, 20:18

Yanna wrote:Well, he doesn't play any at all, right now i'm testing some 'grizzly bears' duplicates and the AI seems to act weird (plays one then stop playing the others, even with no defenders...).

For the cards, they are french/english ready ^^ i'll pack new cards and decks in DLC, too bad for now there won't be any AI to fight against :S
Can't wait to see them! :)

And welcome to the forums, feel free to post anything that comes to mind, sharing our findings is the best way to move this community forwards.
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Uresti » 03 Jul 2010, 21:17

i tested some of the cards and seem to work fine for the Ai except for some dumb decisions
Tested:
black vise OK!
Resurrection: Ok! until i saw AI choosed a sould warden instead Serra angel
Regrowth: ok! and again sould warden instead of resurrection/angel
soul net ok! Ai sent a soul warden against a Serra died and then activated 4 soul Net to gain life
rod of ruin Ok this is an exact copy of pyromancer so seems no problem with AI
i didnt see Ai played a Swords to ploshares maybe wasnt in hand??
Uresti
 
Posts: 151
Joined: 25 Jun 2010, 15:26
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Yanna » 03 Jul 2010, 22:15

Uresti wrote:You made an interesting point in editing DOTP Testing! im sure all the cards made by now plays very well for a human but honestly didnt care to test AI playing them. maybe has something to do with AI_BEHAVIOR> ?? or with
<COLLECTIONMAX value="0" />
<COLLECTORNUMBER value="117" />
<CARDNUMBER value="9" />
many cards have a CARDNUMBERVALUE numbered between 2 and 18 (that i remember)
and surely cant be COLLECTIONMAX "0" cuz supposedly is 383
Yeah I thought of that but have absolutely no clue about the 'correct values'.
I'm really trying to make AI play custom decks for improved challenge/fun. Good thing your cards work i'll take a look at them :p

BTW, here's my DLC with some cards and decks in it. It's DLC 7777 so it shouldn't be conflicting with the alpha one (thanks btw i've used it as a basis ^^)

Until i find a better host here's the link on rapidshare : http://rapidshare.com/files/404772451/Data_DLC_7777.rar
It's got a 10 times download limit thought :S

Included cards are :

Fetchlands :
------------
Arid Mesa
Bloodstained Mire
Flooded Strand
Marsh Flats
Misty Rainforest
Polluted Delta
Scalding Tarn
Verdant Catacombs
Windswept Heath
Wooded Foothills

Slivers :
------------
Battering Sliver
Blade Sliver
Essence Sliver
Bonesplitter Sliver
Fury Sliver
Heart Sliver
Horned Sliver
Might Sliver
Muscle Sliver
Plated Sliver
Reflex Sliver
Sinew Sliver
Spinneret Sliver
Talon Sliver
Watcher Sliver

Zombies :
------------
Death Baron
Nantuko Husk
Shepherd Of Rot
Soulless One
Undead Warchief
Zombie Infestation

Reanimator :
------------
Careful Study
Doomed Necromancer
Merfolk Looter

Mono Black Control :
------------
Crypt Rats
Diabolic Tutor
Disfigure
Font of Myhtos
Hideous End
Infest
Jet medallion
Mutilate
Phyrexian Arena

Hope you'll find something interesting in it !

YannA a.k.a NOVA
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: General XML/LUA Editing Findings

Postby Uresti » 04 Jul 2010, 01:07

Yanna i have some observations. and a new discover
first of all thanks for sharing your hard work to the community but you should use real ARTIST name on the cards you share, as is the Artist name who made the image for the card and aside, for my humble point of view we arent in pursuit of glory and fame.
1.- i couldnt open your TEXT.DUELTIME office dont recognize the format.
2.- For the cards we must assign a determinated value so the AI can "think" the usefulness of the card, im not really sure about what numbers correspond to that as we dont have a comparative table. Example:
Thalon sliver
<COLLECTORNUMBER value="207"/>
<CARDNUMBER value="10" />

I changed the values of your card for this ones, then AI started to play slivers. I took the values from Goblin King as he gives bonuses for other goblins.
Uresti
 
Posts: 151
Joined: 25 Jun 2010, 15:26
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Epiphany » 04 Jul 2010, 08:19

This is some great work you've put in here, Yanna, I'm really impressed.

I must admit I'm being really slow, I hoped to make some cards from Tempest but I've been very busy lately.

I don't mind too much right now that the AI isn't working, I mostly like just playing with these decks myself, but of course it's something we should work on.

Recently, I just made Altar of Dementia, and it works exactly as intended, however I get a message when I quit the game saying "[lua] [string "ALTAR_OF_DEMENTIA_TITLE (EFFECT)"]:2: attempt to index a nil value"

Here's the code for the card:

Code: Select all
<?xml version="1.0"?>
<MULTICARDS>
 
  <CARD name="Angel's Feather">
    <TITLE text="ALTAR_OF_DEMENTIA_TITLE" />
    <FILENAME text="ALTAR_OF_DEMENTIA" />
    <COLLECTIONMAX value="383" />
    <COLLECTORNUMBER value="311" />
    <ARTID value="75223" />
    <FRAMECOLOUR name="A" />
    <COLOR value="A" />
    <ARTIST name="Brom" />
    <CASTING_COST cost="{2}" />
    <CARDNUMBER value="8" />
    <FLAVOURTEXT text="ALTAR_OF_DEMENTIA_FLAVOUR" />
    <TYPE metaname="Artifact" />
    <EXPANSION metaname="10E" />
    <RARITY metaname="uncommon" />
    <ACTIVATED_ABILITY tag="ALTAR_OF_DEMENTIA_RULE_1" layer="0">
      <COST type="Sacrifice">
        <TARGET_DETERMINATION>
          Object():GetFilter():Clear()
          Object():GetFilter():SetController( Object():GetPlayer() )
          Object():GetFilter():SetCardInstance( Object() )
          Object():GetFilter():AddExtra( FILTER_EXTRA_FLIP_CARD_INSTANCE )
          return TargetCreatureBadF()
        </TARGET_DETERMINATION>
        <PLAYTIME>
          ChooseTarget( "CreatureToSacrifice" )
        </PLAYTIME>
      </COST>
      <TARGET_DETERMINATION>
        return TargetPlayerBad()
      </TARGET_DETERMINATION>
      <PLAYTIME>
        ChooseTarget( "ChoosePlayerMillCards" )
      </PLAYTIME>
      <EFFECT>
        MillCards( Object():GetTargetPlayer(), Object():GetAuxTargetCard():GetCurrentPower())
      </EFFECT>
      <AI_AVAILABILITY behaviour="InResponseOrBeforeMyUntap"/>
    </ACTIVATED_ABILITY>
  </CARD>
</MULTICARDS>
The card works as it should, I'm just not sure why it throws up an error message.
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Documentation

Who is online

Users browsing this forum: No registered users and 12 guests


Who is online

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

Login Form