YGOPRO Forum

Welcome Guest! To enable all features please try to register or login.
Options
Go to last post Go to first unread
Marc  
#1 Posted : Sunday, February 09, 2020 11:27:07 PM(UTC)
Marc

Rank: Advanced Member

Joined: 1/6/2013(UTC)
Posts: 162

Thanks: 6 times
Was thanked: 1 time(s) in 1 post(s)
I am trying to get this card working but says there is an error in parameter 11: Should be function.

Any clue where I went wrong?

Dark Chains From the Shadows
Normal Trap card
During your opponent's Standby Phase you can activate this effect; Neither player can Special Summon from the Extra Deck this turn.

Quote:
--Dark Chains From the Shadows
function c10440000.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE)
e1:SetCondition(c10440000.condition)
e1:SetOperation(c10440000.activate)
c:RegisterEffect(e1)
end
function c10440000.dop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(0,1)
e1:SetTarget(c10440000.sumlimit)
Duel.RegisterEffect(e1,tp)
end
function c10440000.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
kvanir  
#2 Posted : Tuesday, February 11, 2020 4:15:20 AM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
Much wrong.

"parameter 11: Should be function" that should be line 11. I highly recommend using MS Visual Code, has really useful find/replace functions.

e1:SetCondition(c10440000.condition)
e1:SetOperation(c10440000.activate)

These are missing function entries at the bottom. You need function for every (xxxxx.blahblah) that matches the entry at the top. Look you have a function for .sumlimit but not for the other 2. Take a look at few other card codes for examples.

Hope this makes sense.
Marc  
#3 Posted : Tuesday, February 11, 2020 11:57:18 PM(UTC)
Marc

Rank: Advanced Member

Joined: 1/6/2013(UTC)
Posts: 162

Thanks: 6 times
Was thanked: 1 time(s) in 1 post(s)
I tried adding those two lines in the bottom code but it still doesn't work.

I'm not a programmer. I just copy & paste & hope for the best. :)

What should the code look like?

Thanks!
kvanir  
#4 Posted : Thursday, February 13, 2020 8:02:21 PM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
I'm not a programmer either... I only copy and paste from other cards. You need to find another card that has similar effects to what you want and then use parts of their code for your card. You can get different effects/conditions from different cards and weave them together.

I̶n̶ ̶y̶o̶u̶r̶ ̶c̶a̶s̶e̶ ̶y̶o̶u̶ ̶w̶a̶n̶t̶ ̶t̶o̶ ̶l̶o̶o̶k̶ ̶a̶t̶ ̶t̶h̶e̶s̶e̶ ̶c̶a̶r̶d̶s̶:̶

i̶n̶s̶p̶e̶c̶t̶i̶o̶n̶ ̶>̶>̶ ̶t̶a̶k̶e̶ ̶t̶h̶e̶ ̶t̶i̶m̶i̶n̶g̶ ̶p̶o̶r̶t̶i̶o̶n̶ ̶s̶i̶n̶c̶e̶ ̶i̶t̶ ̶a̶c̶t̶i̶v̶a̶t̶e̶s̶ ̶d̶u̶r̶i̶n̶g̶ ̶o̶p̶p̶o̶n̶e̶n̶t̶'̶s̶ ̶s̶t̶a̶n̶d̶-̶b̶y̶ ̶p̶h̶a̶s̶e̶

a̶r̶t̶i̶f̶a̶c̶t̶ ̶s̶c̶y̶t̶h̶e̶/̶ ̶d̶o̶m̶i̶n̶i̶o̶n̶ ̶o̶f̶ ̶t̶h̶e̶ ̶l̶e̶g̶e̶n̶d̶a̶r̶y̶ ̶m̶o̶n̶a̶r̶c̶h̶ ̶>̶>̶ ̶t̶h̶e̶s̶e̶ ̶b̶o̶t̶h̶ ̶h̶a̶v̶e̶ ̶e̶f̶f̶e̶c̶t̶s̶ ̶w̶h̶e̶r̶e̶ ̶y̶o̶u̶r̶ ̶o̶p̶p̶o̶n̶e̶n̶t̶ ̶c̶a̶n̶'̶t̶ ̶s̶u̶m̶m̶o̶n̶ ̶f̶r̶o̶m̶ ̶E̶D̶.̶ ̶s̶o̶ ̶t̶a̶k̶e̶ ̶t̶h̶a̶t̶ ̶e̶f̶f̶e̶c̶t̶ ̶a̶n̶d̶ ̶h̶a̶v̶e̶ ̶i̶t̶ ̶a̶p̶p̶l̶y̶ ̶t̶o̶ ̶b̶o̶t̶h̶ ̶p̶l̶a̶y̶e̶r̶s̶.̶

Do the above and post your code.

EDIT: I just read the code, duh..., do you even need these 2 functions:
e1:SetCondition(c10440000.condition)
e1:SetOperation(c10440000.activate)
You only need the trap to activate during standby, then 2nd effect is preventing the special summon?
If so you don't need condition or operation. Try testing it without those 2.







And in case, my first post didn't hit the mark -You were missing the function parts. They need to be added like this.
Quote:
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35950025,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c35950025.spcon)
e2:SetTarget(c35950025.sptg)
e2:SetOperation(c35950025.spop)
c:RegisterEffect(e2)
end

function c35950025.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c35950025.spfilter(chkc,e,tp) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c35950025.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0,nil)
end
function c35950025.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end

Edited by user Thursday, February 13, 2020 8:14:49 PM(UTC)  | Reason: Not specified

kvanir  
#5 Posted : Friday, February 14, 2020 5:13:43 PM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 14

Was thanked: 2 time(s) in 2 post(s)
Update:

I tried your code, I couldn't even activate your card... I'll show you what you need but you put it together.

You need .condition function, it's missing, I used the one from thunder of ruler so it now activates during op's standby phase. Without this .condtion function, I could activate the card at any time.

function c91781589.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY
end


2nd part is good and works but as you coded it >> .activate =/= .dop << these can be any letter but they need to match up (above and below)



minor stuff:

e1:SetTargetRange(0,1) >> change to (1,1) so both players cannot summon
(e,c,sump,sumtype,sumpos,targetp,se) >> only needs (e,c) I don't know what the rest of them mean, but I looked at dominion's code it only used (e,c).

Try these 3 changes and post your code if it still doesn't work.

Edited by user Friday, February 14, 2020 5:15:21 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error