It is currently 28 Apr 2024, 23:39
   
Text Size

General XML/LUA Editing Findings

Moderator: CCGHQ Admins

Re: General XML/LUA Editing Findings

Postby Epiphany » 04 Jul 2010, 08:30

I just tested the Sliver deck. Lovely stuff!

However, I think something does indeed need to be tuned with the card value and whatnot.

I just attacked with all my slivers, and he had a Giant Spider out, had he blocked one of my creatures with it, two things would happen:

  • The computer would still be alive.
  • The Giant Spider would have survived too.

So he was either being rubbish, not understanding the importance of the cards, or just giving up. Any of the three are an option.
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 » 04 Jul 2010, 15:43

AI will always make dumb decisions.
still AI dont want to play slivers i changed the cardvalue for more slivers and throw them at a deck and Ai only plays 1 slivers then nothing.
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 » 05 Jul 2010, 19:41

Allright, after litterally hours of testing i finally nailed it !

At first i was putting all cards in the DATA_CORE folder, so i wanted to be able to see which pics i added in there (hence the NOVAXXXX).

Well the thing is, once those picture filenames are corrected, the AI plays every card in the deck. And honestly he plays some very good :)

CARDMAXNUMBER, COLLECTORNUMBER don't affect anything in the card. Though RARITY and CARDVALUE are directly linked to the AI's choice of which card to play.

So now i'm still making a huge DLC, here's an example of the cards i'm including (100 % tested working) :

Mutilate
Mogg Fanatic
Goblin Warrens
Empyrial Archangel

Thanks for the help on testing the cards out !

See ya soon

YannA a.k.a NOVA

EDIT : added a new card (and yes, threshold can be made with a 'function') :
Putrid Imp
Last edited by Yanna on 05 Jul 2010, 21:02, edited 1 time in total.
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 » 05 Jul 2010, 20:42

I really love the effort that you're putting in with this Yanna.

I've been constantly hitting brick walls, I keep trying to make a card, spend ages trying to get it to work and then end up giving up. It's very soul destroying! There are so many cards I can't get to work, just while trying to make them in alphabetical order.

Maybe I should just get on with documenting what we already know.
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

Re: General XML/LUA Editing Findings

Postby Huggybaby » 05 Jul 2010, 22:24

Good stuff fellas. And here's hoping omnix gets his internet back soon!
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times

Re: General XML/LUA Editing Findings

Postby Yanna » 06 Jul 2010, 00:04

Epiphany wrote:I really love the effort that you're putting in with this Yanna.

I've been constantly hitting brick walls, I keep trying to make a card, spend ages trying to get it to work and then end up giving up. It's very soul destroying! There are so many cards I can't get to work, just while trying to make them in alphabetical order.

Maybe I should just get on with documenting what we already know.
Thanks for the support guys ! It takes really lot of time to do the cards you want, and basically it's a step by step process. My advice is to hang on, start with an easy card then try to add some more abilities to it.

Soon enough you should be more confident with the way the code works. Althought it's true without any reference it's even longer because you have to scavenge through all the files to get the proper syntax...

Huggybaby wrote:Good stuff fellas. And here's hoping omnix gets his internet back soon!
Looking forward for omnix and other people to join, the more the merrier :)

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 » 06 Jul 2010, 07:20

Then, forced numbers in TXD names to solve crashing and AI issues playing cards, still cards values intrigues me....
anyone noticed in CONSTANTS.LUA the mana colors?? any idea how to call them?
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 » 06 Jul 2010, 07:36

Yanna wrote:Thanks for the support guys ! It takes really lot of time to do the cards you want, and basically it's a step by step process. My advice is to hang on, start with an easy card then try to add some more abilities to it.

Soon enough you should be more confident with the way the code works. Althought it's true without any reference it's even longer because you have to scavenge through all the files to get the proper syntax...

YannA a.k.a NOVA
Thanks for the advice! You're right, I should stick to it. I made the Altar of Dementia and it felt very rewarding to use it!
Uresti wrote:anyone noticed in CONSTANTS.LUA the mana colors?? any idea how to call them?
I haven't managed to. Do you mean to call them as a mana resource? I must admit it really sucks that we can't make a Llanowar Elves or Birds of Paradise based on the current system.
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 » 06 Jul 2010, 10:52

I must be doing something really stupid, but I'm trying to make Apocalypse and I have the following code:

Code: Select all
    <SPELL_ABILITY tag="APOCALYPSE_RULE_1" layer="0">
      <FILTER>
        return (Permanents() and InPlay())
      </FILTER>
      <EFFECT>
        Subject():RemoveFromGame()
   DiscardHand( Object():GetPlayer() )
      </EFFECT>
    </SPELL_ABILITY>
The first part works fine, it removes all permanents from the game, but the second part doesn't do the DiscardHand thing. What am I supposed to pass to the DiscardHand function for pPlayer?

The function is listed in Effects.LUA as "DiscardHand ( pPlayer )"

This should be really basic stuff, but I often struggle when targeting the card player.
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 » 06 Jul 2010, 11:05

Actually.

The above does work, except only when it destroys permanents. If there were no permanents in play already then it doesn't do the discard effect. Anyone know how to make it do the second ability regardless of whether anything has been removed from the game?
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 » 06 Jul 2010, 14:52

do another <spell ability>
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 » 06 Jul 2010, 15:42

Uresti wrote:do another <spell ability>
Ah, of course!

Cheers! :)
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 » 06 Jul 2010, 15:50

Has anyone had a go at implementing buyback yet?

I tried, and it went something like this:

Code: Select all
    <SPELL_ABILITY tag="SEARING_TOUCH_RULE_1" layer="0">
      <TARGET_DETERMINATION>
        return TargetCreatureOrPlayerBad()
      </TARGET_DETERMINATION>
      <PLAYTIME>
          Object():GetPlayer():BeginNewMultipleChoice()
          Object():GetPlayer():AddMultipleChoiceAnswer( "YES" )
          Object():GetPlayer():AddMultipleChoiceAnswer( "NO" )
          Object():GetPlayer():AskMultipleChoiceQuestion( "DoYouWantToPayBuyback" )
          if Object():GetMultipleChoiceResult() == 0 then
         IncreaseCost( 6 )
      end
        ChooseTarget( "ChooseCreatureOrPlayerTwoDamage" )
      </PLAYTIME>
      <EFFECT>
          if Object():GetMultipleChoiceResult() == 0 then
         DealDamageToTarget( 2 )
         ReturnThisCardToOwnersHand()
          else
            SacrificeThisCard()
         DealDamageToTarget( 2 )
          end
      </EFFECT>
    </SPELL_ABILITY>
But the above doesn't work. Anyone else fancy having a stab at it?

If you say "yes" then it will return to your hand without increasing the cost. So I'm not sure what to do.
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 » 07 Jul 2010, 00:22

Ouch im stuck in the same problem.
im trying something like (still dont work)
If not then
deladage()
end
<ELSE_EFfECT>
IncreaseCost()
DealDamage()
ReturnThisCardToHand()
<ELSE_EFFECT>
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 » 07 Jul 2010, 06:11

Uresti wrote:Ouch im stuck in the same problem.
im trying something like (still dont work)
If not then
deladage()
end
<ELSE_EFfECT>
IncreaseCost()
DealDamage()
ReturnThisCardToHand()
<ELSE_EFFECT>
Seems like a good way of approaching it! I'll have another try later today.

On other news:

I've made a file that combines all of the cards in the data_core folder into one text file.

http://padbury.uk.to/magic/combined_data_core_cards.rar

Basically if you open it in notepad it makes searching for certain keywords much easier because it searches every card at once! :)
Epiphany
 
Posts: 95
Joined: 30 Jun 2010, 13:27
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Documentation

Who is online

Users browsing this forum: No registered users and 3 guests


Who is online

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

Login Form