Need coding help on Psionic Blast
Posted: 01 Jun 2013, 16:21
Let me start by saying this community is awesome for the work its doing and the availability of information out there to help someone new try to pick up modding. I don't really have much of a programming background (limited to a hangman game I made for a school project 8 yrs ago), but you've all made it easy for me to pick up and get started. Though I still have far to go before I can be somewhat competent.
I am trying to make an Ally deck Orion79 made from the version of Manalink 3.0 I downloaded. Some of the cards I could not find on the site so I took to making them myself. I potentially (haven't found any problems yet) have successfully made Utopia Tree, Oran-Rief Survivalist, and Umara Raptor. I ran into somewhat of my first stepping stone with Psionic Blast (deals 4 to target creature/player and 2 to you). I am having trouble with the 2 damage thats done back to you. Like I said, I have a limited programming background. My method of card creation consists of starting with thefiremind's xml generator and copy/pasting in the ability text. For Psionic Blast I took text from the Searing Spear in the original Duels 2013 Chandra deck and added an additional <resolution> block for the damage back to you (of which I stole from Solemn Offering and changed life gain to damage). Unfortunately when I added the damage back to the casting player, it made the game crash. The code I came up with is below. If it looks like a bunch of junk, that's probably because it is. I was hoping for some advice or guidance to fix the card.
I do have some other general coding questions besides the issue above.
- I have been using my own ID scheme for the cards instead of the multiverseID. Is this bad? I started it when I first started messing with existing cards and adding abilities. I didn't want to break an already working card in the game. I'm only doing this to the filename and not the actual multiverseID variable in the card.
- In looking at some of the cards that came with the game, I see that there is some AI definitions (like the ones I stole from searing spear). I assume these aren't required but are useful if you want the AI to make somewhat decent plays. Is this true? Also, is there a source where I can find what their definitions mean if I need to start programming these?
Thanks for any help. It is much appreciated.
edit: for some reason I cannot post the code (says there are URLs). I'm trying to figure it out.
I am trying to make an Ally deck Orion79 made from the version of Manalink 3.0 I downloaded. Some of the cards I could not find on the site so I took to making them myself. I potentially (haven't found any problems yet) have successfully made Utopia Tree, Oran-Rief Survivalist, and Umara Raptor. I ran into somewhat of my first stepping stone with Psionic Blast (deals 4 to target creature/player and 2 to you). I am having trouble with the 2 damage thats done back to you. Like I said, I have a limited programming background. My method of card creation consists of starting with thefiremind's xml generator and copy/pasting in the ability text. For Psionic Blast I took text from the Searing Spear in the original Duels 2013 Chandra deck and added an additional <resolution> block for the damage back to you (of which I stole from Solemn Offering and changed life gain to damage). Unfortunately when I added the damage back to the casting player, it made the game crash. The code I came up with is below. If it looks like a bunch of junk, that's probably because it is. I was hoping for some advice or guidance to fix the card.
I do have some other general coding questions besides the issue above.
- I have been using my own ID scheme for the cards instead of the multiverseID. Is this bad? I started it when I first started messing with existing cards and adding abilities. I didn't want to break an already working card in the game. I'm only doing this to the filename and not the actual multiverseID variable in the card.
- In looking at some of the cards that came with the game, I see that there is some AI definitions (like the ones I stole from searing spear). I assume these aren't required but are useful if you want the AI to make somewhat decent plays. Is this true? Also, is there a source where I can find what their definitions mean if I need to start programming these?
Thanks for any help. It is much appreciated.
edit: for some reason I cannot post the code (says there are URLs). I'm trying to figure it out.