Karakuri M-D-X
2015-06-30T11:48:11Z
I've been scripting Karakuri cards for the past 3 days.
I've scripted 4 cards with no problem but for some reason I can't script those 2 cards correctly.

Field Spell
All "Karakuri" monsters gain 2000 ATK.
When this card is activated: Add 3 "Karakuri" monsters from your deck to your hand.

Monster
When this monster is summoned: Declare a level from 1-8 and make this monster's level the declared level.
Your opponent cannot special summon monsters.

Script for Field Spell:
function c99112233.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(3,99112233+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c99112233.target)
e1:SetOperation(c99112233.activate)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x11))
e2:SetValue(2000)
c:RegisterEffect(e2)
end
function c99112233.mtfilter(c)
return c:IsSetCard(0x11) and c:IsType(TYPE_MONSTER)
end


Script for Monster:
function c166655.initial_effect(c)
--lv change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(166655,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c166655.tg)
e1:SetOperation(c166655.op)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
c:RegisterEffect(e2)
end
function c166655.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local t={}
local i=1
local p=1
local lv=e:GetHandler():GetLevel()
for i=1,8 do
if lv~=i then t[p]=i p=p+1 end
end
t[p]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(166655,1))
e:SetLabel(Duel.AnnounceNumber(tp,table.unpack(t)))
end



Can someone help?
Because i've been scratching my head for 3 hours about this [:confu:] [:confu:] [:confu:]
F539
  • F539
  • Advanced Member
2015-06-30T15:30:29Z
i created this scripts using the card effect text and not your scripts as the guidelines.

I created 2 versions of the field spell:

version 1: the field spell when activated adds 1 to 3 karakuri


version 2 can only be activated if you have at least 3 or more karakuri monsters in your deck, otherwise cannot be activated

the reason why i created 2 versions is because some cards can only be activated if you have the necessary cards, others are optional, since your text can apply to both cases (in my opinion) i scripted both

in last i scripted the level changing monster following the card text effect
Karakuri M-D-X
2015-06-30T18:37:10Z
Again, thanks XD
Karakuri M-D-X
2015-06-30T19:13:21Z
Hey, it keeps saying "99112233(spell card) initial_effect: Attempt to call function error"
o-o Did I mess up the code without knowing XD?
F539
  • F539
  • Advanced Member
2015-06-30T19:16:23Z
you have to change my script card code to your card code, change all 712559 (my card code) to 99112233 (your card code)
Karakuri M-D-X
2015-06-30T19:41:08Z
I did, 3 times. I also double checked that I changed them all o-o am I missing something?