It is currently 21 Aug 2019, 07:02
   
Text Size

[DotP2013] Lord of the Void

Moderators: Xander9009, CCGHQ Admins

[DotP2013] Lord of the Void

Postby 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
Please help me find the reason..

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>
BETenner
 
Posts: 36
Joined: 07 Mar 2013, 14:20
Has thanked: 7 times
Been thanked: 4 times

Re: [DotP2013] Lord of the Void

Postby thefiremind » 27 Mar 2013, 18:57

In the ChooseTargetsFromDC arguments you wrote
Code: Select all
EffectDC().Make_Targets(2)
instead of
Code: Select all
EffectDC():Make_Targets(2)
.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 717 times

Re: [DotP2013] Lord of the Void

Postby BETenner » 28 Mar 2013, 02:56

Ahhh...I'm still can't get used to lua yet...
BETenner
 
Posts: 36
Joined: 07 Mar 2013, 14:20
Has thanked: 7 times
Been thanked: 4 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 6 guests


Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 10 minutes)
Most users ever online was 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 6 guests

Login Form