It is currently 16 Apr 2024, 12:45
   
Text Size

Creating abit more advanved cards - ISSUE

Moderators: nantuko84, CCGHQ Admins

Creating abit more advanved cards - ISSUE

Postby zaxxz » 12 Oct 2010, 14:10

Hi I recently stumbled upon your GENIOUS - MagicWars. And as an old MTG card player I must say I'm willing to become rather addicted again. Thanks for a great program so far mate(s)! :) Good job!

However, I have a problem adding some cards that I would like added. As I played 'Buried Alive' style with MTG I would like to do that in MagicWars as well, but I can't seem to get it loaded into the card database so far I kinda copied the Demonic Tutor as it with a few changes would be able do to what I want, oh well hope you can help me get this card added:


name = "Buried Alive"
manacost = "2 B"
types = [ "Sorcery" ]
text = ["Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library."]

prints = [
["10E", "C", 135199, 182],
["MRD", "C", 45988, 79],
["6ED", "C", 16624, 160]
]

script = '''\

addSpell(
effect:{
def search = Search(
source:$this,
effect:{
moveToZone(from:GameZone.Library, to:GameZone.Graveyard, card:$chosen)
shuffleLibrary($this.controller)
},
choose: {$card.type('Creature')
)
run(search)

},
)

I did read the post where a similar problem was named, but I tried to both Alt+U and also the "New Constructed (All cards)" option, but it won't appear.

Hope you can help me out.

//Zaxxz
zaxxz
 
Posts: 5
Joined: 12 Oct 2010, 14:02
Has thanked: 0 time
Been thanked: 0 time

Re: Creating abit more advanved cards - ISSUE

Postby nantuko84 » 13 Oct 2010, 14:54

Hi,
I'm glad that you liked MagicWars. Nice to hear such complements, especially as the project is not so popular as others.

Anyway, I've looked into your script and it has at least two mistypes: comma after curly braces and missing ''' at the end. This explains why you couldn't find it in deckeditor, it just wasn't compiled.


But there are another two problems with that card:
bug in api.mw (I checked and Demonic Tutor actually doesn't work either) and no possibility to choose "up to N" cards (easy to fix).

So if you want to try it, just replace the Object Search(Map params) method in /cards/groovy/api.mw by this:
Code: Select all
Object Search(Map params) {
   def source = params.source?:$this
   if(params.effect != null) {
      def playerId = params.player?: source.controller
      getPlayer(playerId).getGameStatistics().searchedLibraryForCardThisTurn = true
      def action = Action(params)
      params.zone = params.zone?:GameZone.Library
      if(params.choose != null && params.zone != null) {
         action.setNeedsToChooseCard(playerId, params.zone, params.choose)
      }
      if(params.countUpTo != null) {
         action.setTargetCount(params.countUpTo)
         action.setExactCount(false)
      }
      return action
   } else {
      builder.logError($this, "Error: not enough parameters Search(effect[,...])")
   }
}
After that Buried Alive will work in 1.3.4.1, here is your script, updated a little:
Code: Select all
name = "Buried Alive"
manacost = "2 B"
types = [ "Sorcery" ]
text = ["Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library."]

prints = [
   ["10E", "C", 135199, 182],
   ["MRD", "C", 45988, 79],
   ["6ED", "C", 16624, 160]
]

script = '''\

addSpell(
   effect:{
      def search = Search(
         source:$this,
         effect:{
            moveToZone(from:GameZone.Library, to:GameZone.Graveyard, card:$chosen)
            shuffleLibrary($this.controller)
         },
         choose: {$card.type('Creature')},
         countUpTo: 3
      )
      run(search)
   }
)

'''
Checked twice, it works. If you want to choose only one or two cards, just press Cancel.

Hope you know how to test cards quickly, you may put any card directly to your hand (no need to create deck and wait until you draw a card) and put any cards onto battlefield, graveyard or top of your library.

~regards
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Creating abit more advanved cards - ISSUE

Postby Huggybaby » 13 Oct 2010, 20:27

nantuko84 wrote:Hi,
I'm glad that you liked MagicWars. Nice to hear such complements, especially as the project is not so popular as others.
Don't worry nantuko, popularity is partially a function of time and persistence. And screenshots help!

Image
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: Creating abit more advanved cards - ISSUE

Postby ProphetSword » 14 Oct 2010, 12:27

nantuko84 wrote:Hi,
I'm glad that you liked MagicWars. Nice to hear such complements, especially as the project is not so popular as others.
Personally, I love Magic Wars. I consider it the program to watch, as I think it has a better Graphical Interface than most of the other programs.

The problem I have right now is that the version I have only lets the AI play one deck. And it gets boring battling the same deck over and over again.

I noticed in these screenshots, people are using different versions than I have. Are there releases going on that I'm not hearing about?
ProphetSword
 
Posts: 56
Joined: 13 Jul 2010, 18:20
Has thanked: 0 time
Been thanked: 2 times

Re: Creating abit more advanved cards - ISSUE

Postby zaxxz » 27 Oct 2010, 19:35

Sorry for the late reply - been busy like hell. I dont know what I'm doing wrong, but I still cant get the card to even show up in my deck builder. I tried 're-unpacking' the game and doing it all over, but cant even get the card visible to me. :/
zaxxz
 
Posts: 5
Joined: 12 Oct 2010, 14:02
Has thanked: 0 time
Been thanked: 0 time

Re: Creating abit more advanved cards - ISSUE

Postby nantuko84 » 28 Oct 2010, 05:56

ProphetSword> the screen is from not published version from svn

zaxxz> Have you tried my scripts and did you made a fix to api.mw I wrote about above?
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Creating abit more advanved cards - ISSUE

Postby zaxxz » 28 Oct 2010, 11:19

Yes I did, copying the correction you wrote to the card and making the changes in the api.mw

Can't see what I'm doing wrong. Hmm.
zaxxz
 
Posts: 5
Joined: 12 Oct 2010, 14:02
Has thanked: 0 time
Been thanked: 0 time

Re: Creating abit more advanved cards - ISSUE

Postby nantuko84 » 01 Nov 2010, 03:27

if you want, I can't pack my working version and upload it to some public server

from other side, magicwars is not developed anymore (viewtopic.php?f=45&t=3483). just wait few weeks when mage will be released with lots of new cards, new gui and competitive ai.
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Creating abit more advanved cards - ISSUE

Postby zaxxz » 01 Nov 2010, 18:54

Yes I saw that mate, looking forward to what you guys get mixed together! :) And no worries I will just wait a few weeks for the next version of mage. But if you would be a cool guy and add Buried Alive I would send you sweet thoughts! :D
zaxxz
 
Posts: 5
Joined: 12 Oct 2010, 14:02
Has thanked: 0 time
Been thanked: 0 time

Re: Creating abit more advanved cards - ISSUE

Postby nantuko84 » 02 Nov 2010, 07:10

:) seems I found the problem, just wonder the Buried Alive script worked previously (though it was on another environment). as I said, you always need to look into console messages as they may help to find out what was wrong. I've downloaded 1.3.4.1 again and added the script and api.mw fix, and here what I've got:

Code: Select all
FATAL [2010-11-02 09:48 [06:982]] ReadGroovyCards$1[RMI TCP Connection(2)-169.25
4.181.126]: Couldn't load a card: mw.server.card.Terror. Exception: java.lang.Ex
ception: This multiverse id (135199) is already used for Buried Alive. Multivers
e id numbers should be unique.
So Terror and Buried Alive have the same multiverse id. Then I went to gatherer and found out this: http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=29846

and now everything is easier, Buried Alive.card should have had:

Code: Select all
prints = [
   ["ODY", "C", 29846, 118]
]
also there should be $chosenCards, not $chosen in moveToZone(...,cards:)

But anyway, not to spend time, I've uploaded 1.3.4.2 with this additional card:
http://www.2shared.com/file/-aapbQdG/Magic_Wars_v1342.html

p.s. you also can check watchdog.log that collects all errors and fatal errors while application is running.
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Creating abit more advanved cards - ISSUE

Postby zaxxz » 03 Nov 2010, 17:05

Wow, thats some service, ty mate! :)
zaxxz
 
Posts: 5
Joined: 12 Oct 2010, 14:02
Has thanked: 0 time
Been thanked: 0 time


Return to MagicWars

Who is online

Users browsing this forum: No registered users and 9 guests


Who is online

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

Login Form