Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Report cards error here
Moderator: CCGHQ Admins
Re: Report cards error here
by -Sekki- » 02 Jul 2013, 22:06
Im new to creating card, and hit a snag...my card will not show up in game in my deck?? I can't see what i've done wrong, i was using traproot kami as a base.
I'm coding treefolk seedlings:
I'm coding treefolk seedlings:
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="TREEFOLK_SEEDLINGS_25589" />
<CARDNAME text="TREEFOLK_SEEDLINGS" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Plants de sylvins]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Baumvolksprösslinge]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Treefolk Seedlings]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="25589" />
<ARTID value="25589" />
<ARTIST name="Don Hazeltine" />
<CASTING_COST cost="{2}{G}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Even the grandest forest begins with a single seedling. -Llanowar saying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Même la plus grande des forêts vient d’une graine minuscule. — Diction de la Llanowar.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Even the grandest forest begins with a single seedling. —Llanowar saying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Selbst der größte Wald hat mit einem Sprössling klein angefangen. —Redewendung aus dem Llanowar]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Even the grandest forest begins with a single seedling. —Llanowar saying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Even the grandest forest begins with a single seedling. —Llanowar saying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Even the grandest forest begins with a single seedling. —Llanowar saying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Even the grandest forest begins with a single seedling. —Llanowar saying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Even the grandest forest begins with a single seedling. —Llanowar saying]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Treefolk" />
<EXPANSION value="7E" />
<RARITY metaname="U" />
<POWER value="2" />
<TOUGHNESS value="*" />
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Treefolk Seedlings's toughness is equal to the number of Forests you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Ces Plants de sylvins ont une endurance égale au nombre de forêts que vous contrôlez.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Treefolk Seedlings’s toughness is equal to the number of Forests you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Die Widerstandskraft der Baumvolksprösslinge ist gleich der Anzahl an Wäldern, die du kontrollierst.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La costituzione dei Germogli di Silvantropi è pari al numero di Foreste che tu controlli.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Treefolk Seedlings’s toughness is equal to the number of Forests you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Treefolk Seedlings’s toughness is equal to the number of Forests you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Treefolk Seedlings’s toughness is equal to the number of Forests you control.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Treefolk Seedlings’s toughness is equal to the number of Forests you control.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="7A">
local total = 0
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_IN_PLAY )
filter:AddSubType( LAND_TYPE_FOREST )
filter:SetController( EffectController() )
filter:NotTargetted()
total = filter:Count()
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Toughness_Set(total)
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
- -Sekki-
- Posts: 10
- Joined: 29 Jun 2013, 20:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: Report cards error here
by RiiakShiNal » 02 Jul 2013, 22:39
My guess would be that you saved it in ANSI format instead of in UTF-8, but it's just a guess. I'm not seeing anything wrong otherwise.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Report cards error here
by -Sekki- » 02 Jul 2013, 23:00
You were right! that was the issue...hmmmm how bizzare how something so simple can prevent the entire thing from working, i really do hate coding haha. Thanks, i'm making a treefolk deck and in tern i'm making a bunch of new cards too, well, trying to! Lol. I'm also fixing the art for a lot of card's too so yeah, cheers for that
.
- -Sekki-
- Posts: 10
- Joined: 29 Jun 2013, 20:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: Report cards error here
by RiiakShiNal » 02 Jul 2013, 23:02
The reason for that is XML doesn't like foreign characters when it is stored in ANSI (causes XML parsers to throw exceptions), but if it is saved in a Unicode format (UTF-8, UTF-16, etc...) it has no problem with them.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Report cards error here
by -Sekki- » 02 Jul 2013, 23:29
Good to know for future reference! Cheers. Your deckbuilder is just brilliant too
.
- -Sekki-
- Posts: 10
- Joined: 29 Jun 2013, 20:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: Report cards error here
by GrovyleXShinyCelebi » 05 Jul 2013, 19:02
Right now, I'm working on importing Erratic Portal into Duels 2014, and I've hit a brick wall.
I can make the portal bounce its target, but the code that activates the multiple choice question of whether or not the target pays one doesn't activate, and the debug keeps telling me I'm trying to index "player" as a nil value...
I can make the portal bounce its target, but the code that activates the multiple choice question of whether or not the target pays one doesn't activate, and the debug keeps telling me I'm trying to index "player" as a nil value...
- Code: Select all
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{1}, {T}: Il proprietario riprende in mano una creatura bersaglio a meno che il suo controllore paghi {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
<COST mana_cost="{1}" type="Mana" />
<COST type="TapSelf" />
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local controller = target:GetPlayer()
EffectDC():Set_PlayerPtr(1, controller)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local player = EffectDC():Get_PlayerPtr(1)
if player ~= nil then
if player:CanPayResourceCost(1) then
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
else
target:PutInHand()
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_PlayerPtr(1)
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
local result = player:GetMultipleChoiceResult()
if result == 0 then
player:PayResourceCost(1)
else
target:PutInHand()
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
</CARD_V2>
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-

GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 05 Jul 2013, 20:40
By looking at the code I can't see anything wrong... can you tell me exactly which line of code the error is being reported in?
In the meanwhile, just to rewrite some code and maybe unintentionally fix the error, try to always declare the player variable as target:GetPlayer(), without saving it in another register: it should be OK because you aren't moving the target's zone until you return it back to hand. You just need to add a check for target ~= nil in the last action as well, so that it doesn't generate an error when you successfully PutInHand() from the previous action.
In the meanwhile, just to rewrite some code and maybe unintentionally fix the error, try to always declare the player variable as target:GetPlayer(), without saving it in another register: it should be OK because you aren't moving the target's zone until you return it back to hand. You just need to add a check for target ~= nil in the last action as well, so that it doesn't generate an error when you successfully PutInHand() from the previous action.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by GrovyleXShinyCelebi » 05 Jul 2013, 22:05
I don't have access to the game right now, but I'll try your suggestions and see how they turn out.
A few questions though seeing as you're experienced:
-You mentioned that I should just declare "player" without saving it again. The main reason I indexed "controller" then "player" is because I borrowed the part of the code that affects the player after a creature is targeted from Path to Exile. Do you know why was that necessary, and what's the difference between declaring player directly and saving it again?
-What exactly does checking a variable for ~= null do? Is it to check if a statement involving a specific variable is true or something?
A few questions though seeing as you're experienced:
-You mentioned that I should just declare "player" without saving it again. The main reason I indexed "controller" then "player" is because I borrowed the part of the code that affects the player after a creature is targeted from Path to Exile. Do you know why was that necessary, and what's the difference between declaring player directly and saving it again?
-What exactly does checking a variable for ~= null do? Is it to check if a statement involving a specific variable is true or something?
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-

GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 05 Jul 2013, 22:17
Path to Exile exiles the target first, and then it needs to know who was the target's controller, but the target is exiled and has no controller (if you ask for the controller of something not on the battlefield the game returns the owner), so saving the controller before exiling the target is required. In your scenario the target isn't leaving the battlefield before you need to know who its controller is, so you can always access target:GetPlayer(). Actually there shouldn't be any difference in saving the controller or not in your code, but since you get an error that we can't figure out, I'd suggest to try even a seemingly useless change.GrovyleXShinyCelebi wrote:-You mentioned that I should just declare "player" without saving it again. The main reason I indexed "controller" then "player" is because I borrowed the part of the code that affects the player after a creature is targeted from Path to Exile. Do you know why was that necessary, and what's the difference between declaring player directly and saving it again?
I was just trying to say that the last RESOLUTION_TIME_ACTION will need to start withGrovyleXShinyCelebi wrote:-What exactly does checking a variable for ~= null do? Is it to check if a statement involving a specific variable is true or something?
- Code: Select all
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
If a variable is equal to nil, then it contains nothing at all. No false, no 0, just nothing.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by GrovyleXShinyCelebi » 06 Jul 2013, 14:02
Alright, I've looked in the error report, and this is the error I keep getting:
[string "ERRATIC_PORTAL_6163_TITLE (RESOLUTION_TIME_ACTION)~0x000001c9"]:2: attempt to index global 'player' (a nil value)
[lua]
Hopefully someone can help me with this, cause I've tried firemind's suggestions and it still doesn't work (funny, all my other cards worked perfectly fine... ) :/
[string "ERRATIC_PORTAL_6163_TITLE (RESOLUTION_TIME_ACTION)~0x000001c9"]:2: attempt to index global 'player' (a nil value)
[lua]
Hopefully someone can help me with this, cause I've tried firemind's suggestions and it still doesn't work (funny, all my other cards worked perfectly fine... ) :/
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-

GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 06 Jul 2013, 15:06
There's something really weird going on: it says that you are indexing "player" on line #2 of a RESOLUTION_TIME_ACTION, which is actually the 1st line of code, but you are never indexing "player" on the 1st line of code, the most you do is declaring it. Are you sure that you don't have another copy of Erratic Portal that you forgot in some other custom WAD?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by GrovyleXShinyCelebi » 06 Jul 2013, 15:49
I checked, and I'm sure that I didn't make another one/download another mod... This is the only one I have...
I wonder, what could be happening...
EDIT: Oh, I have another question. In a few of the cards I made I get an error message that says something along the lines of:
[lua] [string "KOR_HOOKMASTER_222763_TITLE (CONTINUOUS_ACTION)~0x00000202"]:7: '<eof>' expected near 'end'
[lua] [string "SPIKESHOT_ELDER_209404_TITLE (RESOLUTION_TIME_ACTION)~0x0000034..."]:11: '<eof>' expected near 'end'
By any chance do you know what they mean?
Thanks!
I wonder, what could be happening...
EDIT: Oh, I have another question. In a few of the cards I made I get an error message that says something along the lines of:
[lua] [string "KOR_HOOKMASTER_222763_TITLE (CONTINUOUS_ACTION)~0x00000202"]:7: '<eof>' expected near 'end'
[lua] [string "SPIKESHOT_ELDER_209404_TITLE (RESOLUTION_TIME_ACTION)~0x0000034..."]:11: '<eof>' expected near 'end'
By any chance do you know what they mean?
Thanks!
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-

GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by RiiakShiNal » 06 Jul 2013, 16:07
This generally means you have one or more "end" lines too many. Though this can also occur if you declare a function incorrectly, or a few other issues.GrovyleXShinyCelebi wrote:Oh, I have another question. In a few of the cards I made I get an error message that says something along the lines of:
[lua] [string "KOR_HOOKMASTER_222763_TITLE (CONTINUOUS_ACTION)~0x00000202"]:7: '<eof>' expected near 'end'
[lua] [string "SPIKESHOT_ELDER_209404_TITLE (RESOLUTION_TIME_ACTION)~0x0000034..."]:11: '<eof>' expected near 'end'
By any chance do you know what they mean?
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2189
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Report cards error here
by fabiopinhao » 06 Jul 2013, 18:51
Hey, Firemind!
Your combo (Niv-Mizzet, the Firemind) with 'Curiosity' isn't working. One of these cards have a problem.
Also, 'Ischoron Scepter' doesn't seem to work too well with 'Fire/Ice' and Izzet Charm.
I hope I'm helping in reporting these errors.
Your combo (Niv-Mizzet, the Firemind) with 'Curiosity' isn't working. One of these cards have a problem.
Also, 'Ischoron Scepter' doesn't seem to work too well with 'Fire/Ice' and Izzet Charm.
I hope I'm helping in reporting these errors.
- fabiopinhao
- Posts: 2
- Joined: 06 Jul 2013, 18:43
- Has thanked: 0 time
- Been thanked: 0 time
Re: Report cards error here
by thefiremind » 06 Jul 2013, 20:00
If you are talking about DotP2013, I'm well aware that the official Curiosity is bugged and takes only combat damage into account. If you use my core-fixing WAD it will work.fabiopinhao wrote:Hey, Firemind!
Your combo (Niv-Mizzet, the Firemind) with 'Curiosity' isn't working. One of these cards have a problem.
Also, 'Ischoron Scepter' doesn't seem to work too well with 'Fire/Ice' and Izzet Charm.
I hope I'm helping in reporting these errors.
About Isochron Scepter I can't help, I have never coded one.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Who is online
Users browsing this forum: No registered users and 8 guests