Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Crashing and don't know why
Moderator: CCGHQ Admins
Crashing and don't know why
by Malocus » 04 Jan 2012, 22:54
Hi, I am trying to get Goblin Offensive working but for some reason it crashes my game. I have done some testing and it seems like it only crashes when I use three or more different color mana to pay it's casting cost. I just can't figure out why. I'm new to creating cards so I really need some help, I don't have a clue how to fix it.
- | Open
- <?xml version="1.0"?>
<MULTICARDS>
<CARD>
<TITLE text="GOBLIN_OFFENSIVE_TITLE"/>
<FILENAME text="GOBLIN_OFFENSIVE"/>
<COLLECTIONMAX value="0"/>
<COLLECTORNUMBER value="0"/>
<ARTID value="77770136"/>
<FRAMECOLOUR name="R"/>
<COLOR value="R"/>
<ARTIST name="Carl Critchlow"/>
<CASTING_COST cost="{X}{1}{R}{R}"/>
<CARDNUMBER value="0"/>
<FLAVOURTEXT text="GOBLIN_OFFENSIVE_FLAVOUR"/>
<TYPE metaname="Sorcery"/>
<EXPANSION metaname="7777"/>
<RARITY metaname="Uncommon"/>
<TOKEN_REGISTRATION type="Goblin11ALA_Token"
reservation="5" />
<SPELL_ABILITY>
<EFFECT>
Object():Register_Set( 0, Object
():GetManaX() )
local pCount = Object():GetManaX()
while (pCount > 0) do
pCount = pCount - 1
local token = MTG():ObtainToken(
"Goblin11ALA_Token", Object():GetPlayer() )
if (token ~= nil) then
token:Register_Object_Set( 0,
Object())
token:PutIntoPlay( Object
():GetPlayer() )
end
end
</EFFECT>
</SPELL_ABILITY>
<AI_SCORE_MULTIPLIER zone="hand" value="30" />
<SFX text="special_Martial_Coup" />
</CARD>
</MULTICARDS>
- Malocus
- Posts: 1
- Joined: 04 Jan 2012, 22:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Crashing and don't know why
by thefiremind » 05 Jan 2012, 09:29
I'm more familiar with DotP2012, so I could say something wrong, anyway I can't understand the use of registers. I would do it this way:
- Code: Select all
<EFFECT>
local pCount = Object():GetManaX()
while (pCount > 0) do
pCount = pCount - 1
local token = MTG():ObtainToken("Goblin11ALA_Token", Object():GetPlayer())
if (token ~= nil) then
token:PutIntoPlay( Object():GetPlayer() )
end
end
</EFFECT>
< 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
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 27 guests