Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
[DotP2013] Lord of the Void
Moderator: CCGHQ Admins
[DotP2013] Lord of the Void
by BETenner » 27 Mar 2013, 17:54
I'm trying to code Lord of the Void, but always get this error:
- Code: Select all
[lua] attempt to index a number value
- Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_IN_PLAY">
<TRIGGER value="CREATURE_DEALS_COMBAT_DAMAGE_TO_PLAYER" simple_qualifier="self">
return TriggerPlayer() ~= nil
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local player = TriggerPlayer()
local browser = EffectDC():Make_Chest(1)
local j = 0
if (player ~= nil) then
if (browser ~= nil) then
for i=0,6 do
local card = player:Library_GetNth(0)
if (card ~= nil) then
card:RemoveFromGame()
if (card:GetCardType():Test(CARD_TYPE_CREATURE) ~= 0) then
browser:Set_CardPtr(j, card)
j = j + 1
end
end
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local browser = EffectDC():Get_Chest(1)
local player = EffectController()
if (player ~= nil) then
if (browser ~= nil) then
player:SetTargetCount(1)
player:SetTargetPrompt(0, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD")
player:ChooseTargetsFromDC(NO_VALIDATION, browser, EffectDC().Make_Targets(2))
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(2) and EffectDC():Get_Targets(2):Get_CardPtr(0)
if (target ~= nil) then
target:PutIntoPlay(EffectController())
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Re: [DotP2013] Lord of the Void
by thefiremind » 27 Mar 2013, 18:57
In the ChooseTargetsFromDC arguments you wrote
- Code: Select all
EffectDC().Make_Targets(2)
- Code: Select all
EffectDC():Make_Targets(2)
< 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: 721 times
Re: [DotP2013] Lord of the Void
by BETenner » 28 Mar 2013, 02:56
Ahhh...I'm still can't get used to lua yet...
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 13 guests