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, August 02, 2020 2:36:44 PM(UTC)
Marc

Rank: Advanced Member

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

Thanks: 9 times
Was thanked: 1 time(s) in 1 post(s)
I can't activate this effect in Edopro. I tried changing things but nothing works.


Doctor Strange

Once per turn: You can add 1 Spell card from your Deck to your hand.

Quote:
--Avenger - Doctor Strange
local s,id=GetID()
function s.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_DECK) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
DM999  
#2 Posted : Monday, August 03, 2020 11:59:59 PM(UTC)
DM999

Rank: Newbie

Joined: 12/1/2015(UTC)
Posts: 26

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Marc Go to Quoted Post
I can't activate this effect in Edopro. I tried changing things but nothing works.


Doctor Strange

Once per turn: You can add 1 Spell card from your Deck to your hand.

Quote:
--Avenger - Doctor Strange
function c(code).initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid((code),0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function c(code)filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c(code).target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c(code).filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c(code).operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c(code).filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end


Try this instead. You don't need the "SetProperty:Effect flag card target", also change the (code) to whatever ID your card has.

Edited by user Tuesday, August 04, 2020 11:55:05 AM(UTC)  | Reason: Not specified

Marc  
#3 Posted : Tuesday, August 04, 2020 5:27:09 PM(UTC)
Marc

Rank: Advanced Member

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

Thanks: 9 times
Was thanked: 1 time(s) in 1 post(s)
I am getting an error something 105 bitwise. It disappears to fast for me to write it down.

This what I have from what you gave me.

Quote:
--Avenger - Doctor Strange
function c10230000.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid((code),0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function c10230000.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c10230000.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10230000).filter,tp,LOCATION_DECK,0,1,nil end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10230000.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10230000.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
DM999  
#4 Posted : Tuesday, August 04, 2020 6:52:22 PM(UTC)
DM999

Rank: Newbie

Joined: 12/1/2015(UTC)
Posts: 26

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
Did you put in your card's code in place of the "s" in e1:SetTarget and e1:SetOperation? Maybe that's all that's missing.
Marc  
#5 Posted : Tuesday, August 04, 2020 8:04:33 PM(UTC)
Marc

Rank: Advanced Member

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

Thanks: 9 times
Was thanked: 1 time(s) in 1 post(s)
Just tried that & still giving the same error. Tried it with the "c" & without.

Quote:
--Avenger - Doctor Strange
function c10230000.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid((code),0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c10230000.target)
e1:SetOperation(c10230000.operation)
c:RegisterEffect(e1)
end
function c10230000.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c10230000.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10230000).filter,tp,LOCATION_DECK,0,1,nil end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10230000.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10230000.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
BananaPhone42  
#6 Posted : Friday, August 14, 2020 6:03:21 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 190

Thanks: 13 times
Was thanked: 10 time(s) in 10 post(s)
Originally Posted by: Marc Go to Quoted Post
Just tried that & still giving the same error. Tried it with the "c" & without.

Quote:
--Avenger - Doctor Strange
function c10230000.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid((code),0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c10230000.target)
e1:SetOperation(c10230000.operation)
c:RegisterEffect(e1)
end
function c10230000.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c10230000.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10230000).filter,tp,LOCATION_DECK,0,1,nil end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10230000.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10230000.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end


Here. Try this out:
Code:
local s,id=GetID()
    function s.initial_effect(c)
    --search
    local e1=Effect.CreateEffect(c)
    e1:SetDescription(aux.Stringid(id,0))
    e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
    e1:SetType(EFFECT_TYPE_IGNITION)
    e1:SetRange(LOCATION_MZONE)
    e1:SetCountLimit(1,id)
    e1:SetTarget(s.thtg)
    e1:SetOperation(s.thop)
    c:RegisterEffect(e1)
end
function s.thfilter(c)
    return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
    if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
    Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
    local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
    if #g>0 then
        Duel.SendtoHand(g,nil,REASON_EFFECT)
        Duel.ConfirmCards(1-tp,g)
    end
end
thanks 1 user thanked BananaPhone42 for this useful post.
Marc  
#7 Posted : Friday, August 14, 2020 7:49:54 PM(UTC)
Marc

Rank: Advanced Member

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

Thanks: 9 times
Was thanked: 1 time(s) in 1 post(s)
That worked. Thanks!
BananaPhone42  
#8 Posted : Friday, August 14, 2020 8:27:29 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 190

Thanks: 13 times
Was thanked: 10 time(s) in 10 post(s)
Originally Posted by: Marc Go to Quoted Post
That worked. Thanks!


No prob; glad this old banana could help out.
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