TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: [RESOLVED] Target error Wed Oct 08, 2014 9:54 pm | |
| Exactly what the title says, this card let's me target face-down monsters to copy their stats :S. The problem is in bold. And the part of the script that I'm sure is the problem is the tg function (you'll see I added c:isface up and not c:isfacedown but it still doesn't understand xD. I'm surprised it's actually copying the type, atk and def, i expected to mess that part up completely) Also should I post these half finished requests on here or in the custom cards- singles forum? I feel like sometimes it takes a while to get any help on these. - Card Text:
When this card is normal summoned: special summon as many copies of "Changeling Grunt" from your hand, deck or graveyard to your side of the field. Once per turn: you can target 1 face-up monster your opponent controls; this card's type becomes that monster's type and its ATK and DEF becomes that monster's current ATK and DEF. If this card is in your graveyard: you can special summon this card from your graveyard to your side of the field. You can only special summon "MLP- Changeling Grunt" once per turn this way and only once that turn.
- Code:
- Code:
-
function c60000034.initial_effect(c) --multiply local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(c60000034.sptg) e1:SetOperation(c60000034.spop) c:RegisterEffect(e1) --copy stats local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetTarget(c60000034.tg) e2:SetOperation(c60000034.op) c:RegisterEffect(e2) --Special Summon local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_FIELD) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,60000034) e3:SetTarget(c60000034.target) e3:SetOperation(c60000034.operation) c:RegisterEffect(e3) end function c60000034.spfilter(c,e,tp) return c:IsCode(60000034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c60000034.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c60000034.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) end function c60000034.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c60000034.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,ft,ft,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function c60000034.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsFaceup() and not c:IsFacedown() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_MONSTER) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_MZONE,1,1,nil,TYPE_MONSTER) Duel.SetOperationInfo(0,CATEGORY_TARGET,g,1,0,0) end function c60000034.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetCode(EFFECT_CHANGE_RACE) e1:SetValue(tc:GetRace()) e1:SetReset(RESET_EVENT+0x1ff0000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_ATTACK) e2:SetValue(tc:GetAttack()) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EFFECT_SET_DEFENCE) e3:SetValue(tc:GetDefence()) c:RegisterEffect(e3) end end function c60000034.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c60000034.operation(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end end
|
|
outlaw1994
Admin
Member Title : Red-Eyes Lord Posts : 797 Join date : 2013-07-09 Age : 29 Location : bundaberg qld australia
| Subject: Re: [RESOLVED] Target error Thu Oct 09, 2014 3:09 am | |
| i will have a look when i get home atm at town library |
|
TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: [RESOLVED] Target error Wed Oct 22, 2014 8:59 pm | |
| I think i can figure this one out while I'm in the mood to script, since tons of cards have "target 1 face-up monster your opponent controls" as an activation "cost"/requirement. But If I can't, I'll leave this open. If I do, I'll make sure to edit the title as resolved |
|
TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: [RESOLVED] Target error Wed Oct 22, 2014 9:28 pm | |
| OK I don't know how to edit the title as resolved, but this has been resolved. Dunno why I couldn't figure out something so simple that day; I guess I was having a noob moment . |
|
outlaw1994
Admin
Member Title : Red-Eyes Lord Posts : 797 Join date : 2013-07-09 Age : 29 Location : bundaberg qld australia
| Subject: Re: [RESOLVED] Target error Thu Oct 23, 2014 11:59 am | |
| lol i will change it and lock completely forgot about this but glad you solved it |
|