|
| Need help with making cards based on Owner's Seal | |
| |
Author | Message |
---|
Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Need help with making cards based on Owner's Seal Thu Apr 09, 2015 4:21 am | |
| Hi, i'm new to the forum and tracked this site down after realizing I could make custom cards for Ygopro. http://www.deviantart.com/art/Owner-s-Fusion-525486657I want to start with this card. I hunted down effects from other cards that I think might help and with my limited understanding took out all of the code that seemed like I would be able to use to use as reference for this card. None of this works of course but i'll do my best to explain my reasoning behind the copy/pasta - Spoiler:
--融合 function c24094655.initial_effect(c) --Activate Polymerization local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(c24094655.target) e1:SetOperation(c24094655.activate) c:RegisterEffect(e1)
--control and targeting from Rescue Warrior local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(70630741,0)) e2:SetCategory(CATEGORY_CONTROL) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCondition(c70630741.condition) e2:SetTarget(c70630741.target) e2:SetOperation(c70630741.operation) c:RegisterEffect(e2)
--destroyed destroy Artifact Sanctum local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(12444060,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCondition(c12444060.descon) e2:SetTarget(c12444060.destg) e2:SetOperation(c12444060.desop) c:RegisterEffect(e2)
-- no target destroy Vicious claw local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EFFECT_DESTROY_REPLACE) e4:SetTarget(c75524092.desreptg) e4:SetOperation(c75524092.desrepop) c:RegisterEffect(e4)
--Back to hand Compulsory local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetTarget(c94192409.target) e1:SetOperation(c94192409.activate) c:RegisterEffect(e1)
end
--Polymerization effect function c24094655.filter1(c,e) return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) end function c24094655.filter2(c,e,tp,m,f,chkf) return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) end function c24094653.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(Card.IsCanBeFusionMaterial,tp,LOCATION_HAND+LOCATION_MZONE,0,nil) local res=Duel.IsExistingMatchingCard(c24094653.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp) local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(c24094653.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) end end return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c24094655.activate(e,tp,eg,ep,ev,re,r,rp) local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c24094653.filter1,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e) local sg1=Duel.GetMatchingGroup(c24094653.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local mg2=nil local sg2=nil local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() mg2=fgroup(ce,e,tp) local mf=ce:GetValue() sg2=Duel.GetMatchingGroup(c24094653.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:Select(tp,1,1,nil) local tc=tg:GetFirst() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) tc:SetMaterial(mat1) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) else local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() elseif Duel.IsPlayerCanSpecialSummon(tp) then local cg1=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_MZONE,0) Duel.ConfirmCards(1-tp,cg1) local cg2=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0) Duel.ConfirmCards(1-tp,cg2) Duel.ShuffleHand(tp) end end
--Destroyed Destroy function c12444060.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end --Control function c70630741.filter(c,tp) return c:IsFaceup() and c:GetOwner()==tp and c:IsControlerCanBeChanged() end function c70630741.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c70630741.filter(chkc,tp) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,c70630741.filter,tp,0,LOCATION_MZONE,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) end function c70630741.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp) then if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then Duel.Destroy(tc,REASON_EFFECT) end
-- no target destroy function c75524092.desrepop(e,tp,eg,ep,ev,re,r,rp) local exc=e:GetHandler():GetEquipTarget():GetBattleTarget() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,exc) if Duel.Destroy(g,REASON_EFFECT)>0 then if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
end
--Back to hand function c94192409.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c94192409.activate(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) end
I put a name next to each effect I copy pasted for the card I used. I want to be able to target the monsters used for the fusion as if Rescue Warrior targeted them (I own). Then I want the secondary effect to be triggered upon destruction like artifact sanctum and resolve in the grave also using the same targeting to determine (if i'm the owner or not) but also add the code necessary for it to not count as targeting a monster like Vicious Claw. Vicious Claw - The equipped monster gains 300 ATK. If the equipped monster would be destroyed by battle, return this card to its owner's hand instead. Then, destroy 1 monster, except the one that battled the equipped monster, and inflict 600 damage to your opponent. After that, Special Summon 1 "Evil Token" (Fiend-Type/DARK/Level 7/ATK 2500/DEF2500) on your opponent's side of the field. During the turn this card is returned to your hand, you cannot use "Vicious Claw" from your hand.As you can see it determines a target but still allows the player to choose if there are multiple choices but is not counted as targeting a card. This is similar to what I want to happen when determining the monster that is bounced for the secondary effect.This is probably a round about way of doing things but it's the first thing that comes to mind. If anyone feels like helping me out it would be greatly appreciated.
Here are the other cards I referenced and their effects. Bolding and underlining what I want from them.
Rescue Warrior - You take no Battle Damage from battles involving this card. If this card is destroyed by battle, select 1 face-up monster your opponentcontrols that you own, and take control of it.Artifact Sanctum - Special Summon 1 "Artifact" monster from your Deck. You can onlyactivate 1 "Artifact Sanctum" per turn. You cannot conduct your Battle Phase the turn you activate this card. If this card in its owner'spossession is destroyed by an opponent's card: You can target 1 card on the field; destroy that target.I won't post Polymerization since I believe I should post Super Poly instead since it deals with targets on both sides of the field but at this moment I've yet to look at it's code. Also not compulsory since it's just bouncing a monster.
Super Poly - Discard 1 card; Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters from either side of the field as Fusion Materials. Cards and effects cannot be activated in response to this card's activation.
Last edited by Giyuo on Sat Apr 11, 2015 4:30 am; edited 1 time in total |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Thu Apr 09, 2015 8:50 pm | |
| Can someone tell me how to make the code not usable in chunks kinda like /* */ so I won't have to put -- on every line? XD
*Edit* It also seems I was missing a line from the Rescue Warrior that I needed after looking a bit closer and that was the filter parameters to check if I own the card or not.
function c70630741.filter(c,tp) return c:IsFaceup() and c:GetOwner()==tp and c:IsControlerCanBeChanged() end
Since I won't be changing controllers and am only trying to target monsters by if I own them or not am I correct in assuming that I can just delete the "c:IsControlerCanBeChanged()"?
I'll make another post eventually with that change made and with the rest of my guessing on how the code should look. |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Need help with making cards based on Owner's Seal Thu Apr 09, 2015 9:59 pm | |
| Does it have to be from both sides for the fusion or either side?
And I imagine you don't need that for the compuls effect, compuls doesn't have it. The system should know to give back cards on the field to their original owners unless you're using some obscure codes like with exchange or something.
For the compuls you'd just need to fix the target filter to check if it was originally yours. And I haven't tinkered around much with owner's seal type of decks, but I imagine that would be something like e:GetOriginalOwner() or something. Get Owner just checks to see who currently has it I believe, whereas original owner would check who it originally belonged to. |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Thu Apr 09, 2015 11:45 pm | |
| It has to be from both sides for this card. Another one i'm making for Synchro summoning should be from either side. And I looked at owner's seal. The function it had was return c:GetControler()~=c:GetOwner() But I will try the GetOriginalOwner as well. - Spoiler:
function c24094655.initial_effect(c)--Activate Super Polymerizationlocal e1=Effect.CreateEffect(c)e1:SetCategory(CATEGORY_SPECIAL_SUMMON)e1:SetType(EFFECT_TYPE_ACTIVATE)e1:SetCode(EVENT_FREE_CHAIN)e1:SetHintTiming(0,0x1e0)e1:SetTarget(c48130397.target)e1:SetOperation(c48130397.activate)c:RegisterEffect(e1)
--destroyed bouncelocal e2=Effect.CreateEffect(c)e2:SetDescription(aux.Stringid(24094655,1))e2:SetCategory(CATEGORY_TOHAND)e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)e2:SetCode(EVENT_DESTROYED)e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)e2:SetCondition(c24094655.descon)e2:SetTarget(c24094655.destg)e2:SetOperation(c24094655.desop)c:RegisterEffect(e2)end--Super Polymerization effectfunction c24094655.filter0(c,tp)return (c:GetControler()~=c:GetOwner()) or c:IsFaceup()) and c:IsCanBeFusionMaterial()endfunction c24094655.filter1(c,e,tp)return (c:GetControler()~=c:GetOwner()) or c:IsFaceup()) and c:IsCanBeFusionMaterial()endfunction c24094655.filter2(c,e,tp,m,f,chkf)return c:IsType(TYPE_FUSION) and (not f or f(c))and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)endfunction c24094655.target(e,tp,eg,ep,ev,re,r,rp,chk)if chk==0 thenlocal chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tplocal mg1=Duel.GetMatchingGroup(c24094655.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)local res=Duel.IsExistingMatchingCard(c24094655.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)if not res thenlocal ce=Duel.GetChainMaterial(tp)if ce~=nil thenlocal fgroup=ce:GetTarget()local mg2=fgroup(ce,e,tp)local mf=ce:GetValue()res=Duel.IsExistingMatchingCard(c24094655.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)endendreturn resendDuel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)--Duel.SetChainLimit(aux.FALSE)endfunction c24094655.activate(e,tp,eg,ep,ev,re,r,rp)local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tplocal mg1=Duel.GetMatchingGroup(c24094655.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)local sg1=Duel.GetMatchingGroup(c24094655.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)local mg2=nillocal sg2=nillocal ce=Duel.GetChainMaterial(tp)if ce~=nil thenlocal fgroup=ce:GetTarget()mg2=fgroup(ce,e,tp)local mf=ce:GetValue()sg2=Duel.GetMatchingGroup(c48130397.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)endif sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) thenlocal sg=sg1:Clone()if sg2 then sg:Merge(sg2) endDuel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)local tg=sg:Select(tp,1,1,nil)local tc=tg:GetFirst()if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) thenlocal mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)tc:SetMaterial(mat1)Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)Duel.BreakEffect()Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)elselocal mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)local fop=ce:GetOperation()fop(ce,e,tp,tc,mat2)endtc:CompleteProcedure()endend--Destroyed Bouncefunction c24094655.filter(c,tp)return c:IsFaceup() and c:GetOwner()==tpendfunction c24094655.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() and chkc:IsControler(1-tp) and c24094655.filter(chkc,tp) endif chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) endDuel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)endThis is my best guess at what it would need to look like. I tried the card and not surprisingly it doesn't even let me activate either effect XD
Last edited by Giyuo on Sat Apr 11, 2015 4:31 am; edited 1 time in total |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Thu Apr 09, 2015 11:54 pm | |
| TGAP-TrixieDoes it have to be from both sides for the fusion or either side?
Now that I think about it though. From either side would be fine as well. |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 2:31 am | |
| Says "attempt to call method 'GetOriginalOwner' (a nil value)"
If I understood what this meant I would be done with the first effect by now XD (c:GetControler()~=c:GetOwner())
*edit* What do all the function peripherals mean? e,tp,eg,ep,ev,re,r,rp,chk,chkc, etc.?
Also Rescue Warrior has c:GetOwner()==tp If this could be explained it might help as well |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 3:43 am | |
| Nvm, found it on this page http://www.ygopro.co/Forum/tabid/95/g/posts/t/16781/Scripting-Tutorial--CURRENTLY-INCOMPLETE#post88202 - Spoiler:
c - when in filters, this means to check any of the cards, when in summoning procs., this means itself.Example: You can Normal Summon this card by Tributing 3 monsters. Check Beast King Barbaros or Egyptian God Cards.e - effect. Which effect? Its own effect.tp - player. Not sure which, but most likely, the player using the effect.eg - event group. When you have something like "When a card(s) is destroyed", this will be the egep - event player. When you have something like "When your opponent summons an monster"ev - event value. When you have something like "When you take 2000 or more damage"re - reason event. Not sure if this is correct but this worked for some cards. "When this card is summoned by a Spell Card"r - reason. I haven't used this but I already saw how it works. "When this card is destroyed by a Trap Card"rp - reason player. This is different from ep, just learn more and you will understand. "When this card is banished by an opponent'scard effect"og/tuner - taken from Number F0/Hundred Eyed Dragon (TF) - sometimes, when you use special special summon conditions. I think you can change it to any variable, but to avoid confusion, let's choose the best variable. - meaning overlay group or make it like sg (synchro group) or whatever. This is more likely a predefined code to check the required materials to summon them.
Last edited by Giyuo on Sat Apr 11, 2015 4:35 am; edited 1 time in total |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 4:04 am | |
| I re-typed it as (c:GetControler()~=c:GetOwner()or c:IsControler(tp))I'm not sure if it recognizes if I control my opponent's monsters and I'm not the original owner though... but I can fuse from either side of the field now. *Edit** And have confirmed it's only monsters I own for at least if they are on my opponent's side of the field Also confirmed that if opponent's monsters are on my side of the field it doesn't stop me from using them as fusion materials.
Last edited by Giyuo on Fri Apr 10, 2015 12:11 pm; edited 2 times in total |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 5:42 am | |
| Mkay now on to the second effect, it's under "Destroyed Bounce" as of right now I get an error that says [string "./script/c24094655.lua]:19:Parameter 2 should be "Function"No idea what it means I'll highlight line 19 in red as well. - Spoiler:
function c24094655.initial_effect(c) --Activate Super Polymerization local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetTarget(c24094655.target) e1:SetOperation(c24094655.activate) c:RegisterEffect(e1) --destroyed bounce local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(24094655,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCondition(c24094655.condition) e2:SetTarget(c24094655.target) e2:SetOperation(c24094655.operation) c:RegisterEffect(e2) end
--Super Polymerization effect function c24094655.filter0(c,tp) return (c:GetControler()~=c:GetOwner()or c:IsControler(tp)and c:GetOwner()==tp) and c:IsCanBeFusionMaterial() end function c24094655.filter1(c,e,tp) return (c:GetControler()~=c:GetOwner()or c:IsControler(tp)and c:GetOwner()==tp) and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) end function c24094655.filter2(c,e,tp,m,f,chkf) return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) end
function c24094655.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c24094655.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp) local res=Duel.IsExistingMatchingCard(c24094655.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp) local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(c24094655.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) end end return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c24094655.activate(e,tp,eg,ep,ev,re,r,rp) local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c24094655.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) local sg1=Duel.GetMatchingGroup(c24094655.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local mg2=nil local sg2=nil local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() mg2=fgroup(ce,e,tp) local mf=ce:GetValue() sg2=Duel.GetMatchingGroup(c24094655.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:Select(tp,1,1,nil) local tc=tg:GetFirst() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) tc:SetMaterial(mat1) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) else local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() end end --Destroyed Bounce function c24094655.filter(c,tp) return c:IsFaceup() and c:GetOwner()==tp end function c24094655.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() and chkc:IsControler(1-tp) and c24094655.filter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end
Last edited by Giyuo on Sat Apr 11, 2015 4:32 am; edited 1 time in total |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 8:12 pm | |
| Wow you were busy I saw the error you mentioned about getting a nil value on e:getoriginalowner, and I was gonna mention variables, how they have to be set and etc. e:getoriginalowner was wrong anyways, because e would check where the effect was, I was just thinking about e:gethandler since I see that a lot. c:GetOriginalOwner could've possibly worked too.
That error message is common. It'll reference the line where the error is at so you know where to check. Basically just check to make sure everything is spelled right, the serial number is correct, you don't have something like "Setcost" as opposed to "SetCost" (yes, that one lowercase C does make a difference).
So you highlighted the error line but didn't include the condition function? :S Well I'm sure you can figure it out easily now |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 10:19 pm | |
| Thanks for the pointers Trixie, got it to work as expected. Haven't tested the secondary effect yet but I get no errors when a duel starts so hopefully everything is in order. Also was able to fix the fusion material selection to be only monsters I own on either side of the field. - Spoiler:
--融合 function c24094655.initial_effect(c) --Activate Super Polymerization local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetTarget(c24094655.target) e1:SetOperation(c24094655.activate) c:RegisterEffect(e1) --destroyed bounce local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(24094655,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCondition(c24094655.descon) e2:SetTarget(c24094655.destg) e2:SetOperation(c24094655.rtop) c:RegisterEffect(e2) end
--Super Polymerization effect function c24094655.filter0(c,tp) return c:GetOwner()==tp and c:IsCanBeFusionMaterial() end function c24094655.filter1(c,e,tp) return c:GetOwner()==tp and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) end function c24094655.filter2(c,e,tp,m,f,chkf) return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) end
function c24094655.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c24094655.filter0(chkc,tp) end if chk==0 then local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c24094655.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp) local res=Duel.IsExistingMatchingCard(c24094655.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp) local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(c24094655.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) end end return res end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end
function c24094655.activate(e,tp,eg,ep,ev,re,r,rp) local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c24094655.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) local sg1=Duel.GetMatchingGroup(c24094655.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local mg2=nil local sg2=nil local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() mg2=fgroup(ce,e,tp) local mf=ce:GetValue() sg2=Duel.GetMatchingGroup(c24094655.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:Select(tp,1,1,nil) local tc=tg:GetFirst() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) tc:SetMaterial(mat1) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) else local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() end end --Destroyed Destroy function c24094655.filter(c,tp) return c:IsFaceup() and c:GetOwner()==tp end
function c24094655.descon(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and e:GetHandler():GetPreviousControler()==tp end function c24094655.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() and chkc:IsControler(1-tp) and c24094655.filter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c24094655.rtop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.ToHand(tc,REASON_EFFECT) end end
Last edited by Giyuo on Sat Apr 11, 2015 4:32 am; edited 1 time in total |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Fri Apr 10, 2015 10:48 pm | |
| Alright, on to the next card http://giyuo.deviantart.com/art/Owner-s-Tuning-525487526This card is one i'm sure needs to be a selection on both sides not just either. (that would be kinda broke for tuning XD) So i'm going to be referencing "Urgent Tuning" for how to synchro summon a monster... hopefully I can just replace everything that says fusion in the card I already made with synchro or something... and then I will also be referencing "Offering to the Snake Deity" for it's ability to target on either side of the field. Here is it's code. - Spoiler:
--毒蛇の供物 function c93217231.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetTarget(c93217231.target) e1:SetOperation(c93217231.activate) c:RegisterEffect(e1) end function c93217231.filter1(c) return c:IsFaceup() and c:IsRace(RACE_REPTILE) and c:IsDestructable() end function c93217231.filter2(c) return c:IsDestructable() end function c93217231.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c93217231.filter1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(c93217231.filter2,tp,0,LOCATION_ONFIELD,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g1=Duel.SelectTarget(tp,c93217231.filter1,tp,LOCATION_MZONE,0,1,1,nil) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g2=Duel.SelectTarget(tp,c93217231.filter2,tp,0,LOCATION_ONFIELD,2,2,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0) end function c93217231.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) local sc=e:GetLabelObject() if sg:GetCount()~=3 or sc:IsFacedown() or not sc:IsRace(RACE_REPTILE) or sc:IsControler(1-tp) then return end Duel.Destroy(sg,REASON_EFFECT) end
Shall match colors with the stuff i'm talking about My guess is that the groups are what i'm going to have to add to the card to get it to check on either side of the field. I also checked Trishula before (Nekroz) and it also had groups. This i'm guessing means how many cards are going to be selected and maybe tells it which side of the field it's selecting on? Correct me if I'm wrong but (How many, Player side of the field) So for my card group 1 would be 1,1 and group 2 would be 1,2 possibly. No idea what this means... XDEdit* And here is the code for "Urgent Tuning" - Spoiler:
function c94634433.initial_effect(c) --synchro effect local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END) e1:SetCondition(c94634433.sccon) e1:SetTarget(c94634433.sctg) e1:SetOperation(c94634433.scop) c:RegisterEffect(e1) end function c94634433.sccon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()==PHASE_BATTLE end function c94634433.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c94634433.scop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil) if g:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SynchroSummon(tp,sg:GetFirst(),nil) end end
I'm going to be getting rid of this and replacing it with whatever timing super poly has... Just realized that my other card might still be a quick-play instead of a regular spell because I didn't change it XDIt seems that there isn't anything here that says "hey, are the monsters your using for a synchro summon on your side of the field?" So... I guess i'll have to add that or think of a card that does say that... Maybe "Blackwing -Vayu"?Edit* Here's the Vayu - Spoiler:
function c72714392.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(72714392,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_GRAVE) e1:SetTarget(c72714392.target) e1:SetOperation(c72714392.operation) c:RegisterEffect(e1) --synchro limit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e2:SetValue(aux.TRUE) c:RegisterEffect(e2) end function c72714392.filter(c,e,tp) local lv=c:GetLevel() return lv>0 and c:IsSetCard(0x33) and not c:IsType(TYPE_TUNER) and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(c72714392.exfilter,tp,LOCATION_EXTRA,0,1,nil,lv+1,e,tp) end function c72714392.exfilter(c,lv,e,tp) return c:IsSetCard(0x33) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c72714392.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c72714392.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c72714392.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,c72714392.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c72714392.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or not c:IsRelateToEffect(e) then return end local rg=Group.FromCards(c,tc) if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,c72714392.exfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetLevel()+1,e,tp) local sc=sg:GetFirst() if sc and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) sc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000) sc:RegisterEffect(e2) end end end
From my understanding all of this is probably something I could use but the problem i'm seeing is... it's setting a definite amount. 1 Vayu and 1 Blackwing card. I instead want to change it to 1 tuner and 0<Monsters. Halp! XD I'll go check other monsters that sync from the field but i'm guessing I'll run into the same problem I did with Urgent Tuning.*Edit* Had an idea... looking into "Chain Material" and "Synchro Material" now |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Sat Apr 11, 2015 4:46 am | |
| Well, gave it my best guess on what it should look like but doesn't work and gonna have to look at more cards before I understand how synchroing is done in card form... it just seems to be a hard coded thing that just happens instead of always being linked to a card like fusion summoning is. T_T - Spoiler:
--融合 function c94634434.initial_effect(c) --Activate Super Polymerization local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetTarget(c94634434.target) e1:SetOperation(c94634434.activate) c:RegisterEffect(e1)
--Super Polymerization effect function c94634434.filter0(c,tp) local lv=c:GetLevel() return c:GetOwner()==tp and c:IsCanBeSynchroMaterial() end function c94634434.filter1(c,e,tp) local lv=c:GetLevel() return c:GetOwner()==tp and c:IsCanBeSynchroMaterial() and not c:IsImmuneToEffect(e) end
function c94634434.filter2(c,lv,e,tp) return c:IsSetCard(0x33) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
function c94634434.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c94634434.filter0(chkc,tp) end if chk==0 then local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c94634434.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp) local res=Duel.IsExistingMatchingCard(c94634434.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp) local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(c94634434.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,c94634434.filter2,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetLevel()+1,e,tp) end end return res end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end
function c94634434.activate(e,tp,eg,ep,ev,re,r,rp) local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c94634434.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,c94634434.filter2,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetLevel()+1,e,tp) local mg2=nil local sg2=nil local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() mg2=fgroup(ce,e,tp) local mf=ce:GetValue() sg2=Duel.GetMatchingGroup(c94634434.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:Select(tp,1,1,nil) local tc=tg:GetFirst() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local mat1=Duel.SelectSynchroMaterial(tp,tc,mg1,nil,chkf) tc:SetMaterial(mat1) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) else local mat2=Duel.SelectSynchroMaterial(tp,tc,mg2,nil,chkf) local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() end end end
Any advice on the matter on how to proceed would be greatly appreciated |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Sat Apr 11, 2015 7:02 am | |
| Another failed attempt. Tried to use Vayu as a base but can't even get the card to activate to see if it will do what I want. - Spoiler:
function c94634434.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetRange(LOCATION_MZONE) e1:SetTarget(c94634434.target) e1:SetOperation(c94634434.operation) c:RegisterEffect(e1) end
function c94634434.filter0(c,e,tp) local lv=c:GetLevel() return lv>0 and c:IsCanBeSynchroMaterial() and c:IsAbleToGrave()and c:GetOwner()==tp and Duel.IsExistingMatchingCard(c94634434.exfilter,tp,LOCATION_EXTRA,0,1,nil,lv+1,e,tp) end
function c94634434.filter1(c,e,tp) local lv=c:GetLevel() return lv>0 and c:IsCanBeSynchroMaterial() and c:IsAbleToGrave()and c:GetOwner()==tp and c:GetControler()~=tp and Duel.IsExistingMatchingCard(c94634434.exfilter,tp,LOCATION_EXTRA,0,1,nil,lv+1,e,tp) end
function c94634434.exfilter(c,lv,e,tp) return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c94634434.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c94634434.filter0(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c94634434.filter0,tp,LOCATION_MZONE,0,1,e:GetHandler(),e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectTarget(tp,c94634434.filter0,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),e,tp)
end
function c94634434.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c94634434.filter1(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp and Duel.IsExistingTarget(c94634434.filter1,tp,LOCATION_MZONE,0,1,e:GetHandler(),e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g2=Duel.SelectTarget(tp,c94634434.filter1,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),e,tp)
end
function c94634434.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or not c:IsRelateToEffect(e) then return end local rg=Group.FromCards(c,tc) if Duel.ToGrave(rg,POS_FACEUP,REASON_EFFECT)==2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,c94634434.exfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetLevel()+1,e,tp) local sc=sg:GetFirst() if sc and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) sc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000) sc:RegisterEffect(e2) end end end
|
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Sat Apr 11, 2015 9:09 am | |
| My last try before going to sleep. Based this one off of Urgent Tuning and a Yang Zing Tuner. I was able to get the urgent tuning part to work by itself which I have marked green (along with some attempt to create groups). But it didn't do what I wanted exactly (only synchro'd from my side of the field) so I added the Yang Zing part, which for the most part was the same, just had "Matching groups" not sure what they meant but it was used in the YZ code to make sure it was from the same archetype using a filter, so I'm doing the same but making 2 so it will hopefully have to check if the materials are on both sides of the field with both filters being used checking to see if i'm the owner.- Spoiler:
function c94634434.initial_effect(c) --synchro effect local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetTarget(c94634434.sctg) e1:SetOperation(c94634434.scop) c:RegisterEffect(e1) end
function c94634434.filter0(c,e,tp,eg,ep,ev,re,r,rp) return c:IsCanBeSynchroMaterial() and c:IsFaceup() and c:GetOwner()==tp end
function c94634434.filter1(c,e,tp,eg,ep,ev,re,r,rp) return c:IsCanBeSynchroMaterial() and c:IsFaceup() and c:GetOwner()==tp and c:GetControler()~=tp end
function c94634434.sctg(e,tp,eg,ep,ev,re,r,rp,chk) --if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) -- end --local g1=Duel.IsExistingTarget(c94634434.filter0,tp,LOCATION_MZONE,0,1,1,nil) -- e:SetLabelObject(g1:GetFirst()) -- local g2=Duel.SelectTarget(tp,c94634434.filter1,tp,0,LOCATION_MZONE,2,2,nil) -- g1:Merge(g2)
-- Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) --end
if chk==0 then local mg=Duel.GetMatchingGroup(c94634434.filter0,tp,LOCATION_MZONE,0,nil) return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c94634434.scop(e,tp,eg,ep,ev,re,r,rp) local mg=Duel.GetMatchingGroup(c94634434.filter1,tp,0,LOCATION_MZONE,1,nil) local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg) if g:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) end end
--function c94634434.scop(e,tp,eg,ep,ev,re,r,rp) -- local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil) -- if g:GetCount()>0 then -- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) -- local sg=g:Select(tp,1,1,nil) -- Duel.SynchroSummon(tp,sg:GetFirst(),nil) -- end --end
again, not sure how to tell it to look on 1 side of the field vs the other. So I just looked at Fissure since it says opponent's side of the field and copy/pasted that. |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Sat Apr 11, 2015 11:36 am | |
| Found Yang Zing Unleashed. It does what I want pretty much already, just have to get rid of the archetype and add the requirements of both sides of the field and it should be good. Here's its code - Spoiler:
--竜星の極み function c77783947.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --must attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_MUST_ATTACK) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,LOCATION_MZONE) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_EP) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(0,1) e3:SetCondition(c77783947.becon) c:RegisterEffect(e3) --synchro effect local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END) e4:SetRange(LOCATION_SZONE) e4:SetCondition(c77783947.sccon) e4:SetCost(c77783947.sccost) e4:SetTarget(c77783947.sctg) e4:SetOperation(c77783947.scop) c:RegisterEffect(e4) end function c77783947.becon(e) return Duel.IsExistingMatchingCard(Card.IsAttackable,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function c77783947.sccon(e,tp,eg,ep,ev,re,r,rp) local ph=Duel.GetCurrentPhase() return ph==PHASE_MAIN1 or ph==PHASE_BATTLE or ph==PHASE_MAIN2 end function c77783947.mfilter(c) return c:IsSetCard(0x9e) end function c77783947.cfilter(c,syn) return syn:IsSynchroSummonable(c) end function c77783947.spfilter(c,mg) return mg:IsExists(c77783947.cfilter,1,nil,c) end function c77783947.sccost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end Duel.SendtoGrave(e:GetHandler(),REASON_COST) end function c77783947.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local mg=Duel.GetMatchingGroup(c77783947.mfilter,tp,LOCATION_MZONE,0,nil) return Duel.IsExistingMatchingCard(c77783947.spfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c77783947.scop(e,tp,eg,ep,ev,re,r,rp) local mg=Duel.GetMatchingGroup(c77783947.mfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c77783947.spfilter,tp,LOCATION_EXTRA,0,nil,mg) if g:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local tg=mg:FilterSelect(tp,c77783947.cfilter,1,1,nil,sg:GetFirst()) Duel.SynchroSummon(tp,sg:GetFirst(),tg:GetFirst()) end end
and here is what I've got so far, has the error Attempt to index local 'syn' (a nil value)*Edit* This is also an error, the above error is i'm guessing relating to this one since it is telling it to check if there is a matching monster (cfilter) in the extra deck. I made the changes I think I would need to have it select monsters on either side but yea....40:Parameter 5 should be "card"- Spoiler:
function c94634434.initial_effect(c) --synchro effect local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetCost(c94634434.sccost) e1:SetTarget(c94634434.sctg) e1:SetOperation(c94634434.scop) c:RegisterEffect(e1) end
function c94634434.filter0(c,e,tp,eg,ep,ev,re,r,rp) return c:IsCanBeSynchroMaterial() and c:IsFaceup() and c:GetOwner()==tp end
function c94634434.filter1(c,e,tp,eg,ep,ev,re,r,rp) return c:IsCanBeSynchroMaterial() and c:IsFaceup() and c:GetOwner()==tp and c:GetControler()~=tp end
function c94634434.sccost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end Duel.SendtoGrave(e:GetHandler(),REASON_COST) end
function c94634434.cfilter(c,syn) return syn:IsSynchroSummonable(c) end function c94634434.spfilter(c,mg) return mg:IsExists(c94634434.cfilter,1,nil,c) end
function c94634434.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then local mg1=Duel.GetMatchingGroup(c94634434.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil) local mg2=Duel.GetMatchingGroup(c94634434.filter1,tp,0,LOCATION_MZONE,0,nil) return Duel.IsExistingMatchingCard(c94634434.cfilter,tp,LOCATION_EXTRA,0,1,nil,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end
function c94634434.scop(e,tp,eg,ep,ev,re,r,rp) local mg1=Duel.GetMatchingGroup(c94634434.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil) local mg2=Duel.GetMatchingGroup(c94634434.filter1,tp,0,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil) if g:GetCount()>0 and mg2:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local tg=mg:FilterSelect(tp,c94634434.cfilter,1,1,nil,sg:GetFirst()) Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) end end
Last edited by Giyuo on Sat Apr 11, 2015 11:38 pm; edited 2 times in total |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Need help with making cards based on Owner's Seal Sat Apr 11, 2015 7:16 pm | |
| Well starting from the first msg you had questions on, you probably figured some of these out already
Blue: you're telling the eff to check what cards, in this case, to destroy. It references your filters, 1 and 2. 1 checks if it's a faceup reptile and can be destroyed, 2 checks if it's just able to be destroyed.
Now on those blue lines, the first target is one on your side of the field (LOCATION_MZONE,0) the first location in that set is on your side, while the 2nd is on the opponent's side. If you don't want it to check your side, a 0 is put here. If it said (LOCATION_MZONE,LOCATION_MZONE) it'd check both sides' monster zones
In short, the first target is a face-up reptile type monster you control that you can destroy.
so the 2nd blue line is checking a target on your opponent's side of the field, not just monster zone. that' sthe short version
Green: min, max, simple as that. For destroying a reptile, it checks only 1 on your side. For destroying an opps card on their field, the min is 2 and max is 2. I'm pretty sure that means you couldn't activate this if the opp only had 1 card on their side of the field.
And if you're wondering about the nil, I believe that's what target to exclude, usually I see e:GetHandler() (meaning which card the effect is coming from) and that usually excludes that card from being considered a target, although sometimes you can still activate it and not get it to resolve ;s.
Red: I'm not 100% sure, but I believe it's at least confirming there were appropriate targets. I'm pretty sure someone else can explain better. The operation info bit I'm sure you can figure out, it's destroying stuff, g1 references the local variable g1 which was the first target.
Before I look at the latest script, may I remind you you already have a working owner's fusion? You won't copy everything because the synchro procedure is much different from fusion, but copying the filters and target functions should be good enough. |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Sat Apr 11, 2015 11:52 pm | |
| Edited my last post after looking at what you said and took the targeting information from the Yang Zing Unleashed and compared it to my Owner's Fusion/super poly one. It's not the exact same seeing as how super poly doesn't have any operation to count but the Yang Zing's count is at 0 anyways so not sure if it matters or not. new code Duel.GetMatchingGroup(c94634434.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil) Super Poly Code mg1=Duel.GetMatchingGroup(c48130397.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp) Just switched it to see if the errors would go away but still the same thing so will prob have to find out what the problem is before I can proceed with the targeting filters. *Edit* Correction, it fixes the should be "card" and goes back to the 'syn' error *Edit** No errors now but it activates, sends nothing to the graveyard, summons no monster, and can only activate if all of the required materials are on my side of the field for the synchro instead of if it's on both sides. *sigh* - Spoiler:
function c94634434.initial_effect(c) --synchro effect local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetCost(c94634434.sccost) e1:SetTarget(c94634434.sctg) e1:SetOperation(c94634434.scop) c:RegisterEffect(e1) end
function c94634434.filter0(c,e,tp,eg,ep,ev,re,r,rp) return c:IsCanBeSynchroMaterial() and c:IsFaceup() and c:GetOwner()==tp end
function c94634434.filter1(c,e,tp,eg,ep,ev,re,r,rp) return c:IsCanBeSynchroMaterial() and c:IsFaceup() and c:GetOwner()==tp and c:GetControler()~=tp end
function c94634434.sccost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end Duel.SendtoGrave(e:GetHandler(),REASON_COST) end
function c94634434.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then local mg1=Duel.GetMatchingGroup(c94634434.filter0,tp,0,LOCATION_MZONE,nil,tp) local mg2=Duel.GetMatchingGroup(c94634434.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp) return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end
function c94634434.scop(e,tp,eg,ep,ev,re,r,rp) local mg1=Duel.GetMatchingGroup(c94634434.filter0,tp,0,LOCATION_MZONE,nil,tp) local mg2=Duel.GetMatchingGroup(c94634434.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp) local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil) if g:GetCount()>0 and mg2:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local tg=mg:FilterSelect(tp,c94634434.cfilter,1,1,nil,sg:GetFirst()) Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) end end
|
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Need help with making cards based on Owner's Seal Sun Apr 12, 2015 7:18 pm | |
| If you're sending the material to grave as cost, you might wanna reword owner's synchro.
The way you worded it, it doesn't send anything to the grave as cost, the synchro procedure takes care of that as part of the effect. If you keep it like that, it won't work under dimensional fissure/banishers/dark law/macro cosmos/DD grounds.
Filter0 is checking opps side of the field in the target function filter1 is checking both sides of the field in the target function, even though in the filter you already specified it's not under your control.
There's also a cfilter1 there at the bottom, dunno what that's for |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Mon Apr 13, 2015 12:25 am | |
| Having com problems right now so won't be able to try anything yet. Didn't know Yang Zing unleashed couldn't be activated while DFissure and the like were on field. But could you point out the line in Yang Zing Unleashed that sends the cards to the grave as a cost that I'm missing? I can't seem to find it. Also if I delete the cost lines since I don't have anything specifically telling it to do it and just leave the filters. It will still use them as requirements to activate and resolve the card? It won't do something silly like let me select only monsters on my side of the field and not summon a monster because I didn't select a monster on both sides of the field instead of just not allowing me to do that from the beginning? XD |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Mon Apr 13, 2015 12:30 am | |
| Nvm. I misunderstood it's effect. Yang Zing Unleashed is sending itself as a cost not the monsters. Just re read it. You don't have to look through it's code |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Need help with making cards based on Owner's Seal Mon Apr 13, 2015 2:10 am | |
| I was confused as to why the cost said e:GetHandler() that would be itself.
Yes delete any functions if you didn't set them, it shouldn't do anything but it's clunky and you might wanna go through the code again at some point and you won't know what that random function was for |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Tue Apr 14, 2015 2:25 pm | |
| Found a new card to use for reference. Psychic Feel Zone. Vayu refferenced itself in the code along with some other cards I found to get the level it needed so I didn't know how to get 2 monsters as targets to synchro with. After some searching I found this card. - Spoiler:
--サイコ・フィール・ゾーン function c11047543.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(11047543,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(c11047543.target) e1:SetOperation(c11047543.operation) c:RegisterEffect(e1) end function c11047543.filter1(c,e,tp) return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_TUNER) and Duel.IsExistingTarget(c11047543.filter2,tp,LOCATION_REMOVED,0,1,nil,e,tp,c:GetLevel()) end function c11047543.filter2(c,e,tp,lv) local clv=c:GetLevel() return clv>0 and c:IsFaceup() and c:IsRace(RACE_PSYCHO) and not c:IsType(TYPE_TUNER) and Duel.IsExistingMatchingCard(c11047543.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv+clv) end function c11047543.spfilter(c,e,tp,lv) return c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_SYNCHRO) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c11047543.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c11047543.filter1,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g1=Duel.SelectTarget(tp,c11047543.filter1,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g2=Duel.SelectTarget(tp,c11047543.filter2,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,g1:GetFirst():GetLevel()) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c11047543.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc1=g:GetFirst() local tc2=g:GetNext() if not tc1:IsRelateToEffect(e) or not tc2:IsRelateToEffect(e) then return end local sg=Duel.GetMatchingGroup(c11047543.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp,tc1:GetLevel()+tc2:GetLevel()) if sg:GetCount()==0 then return end Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local ssg=sg:Select(tp,1,1,nil) Duel.SpecialSummon(ssg,0,tp,tp,false,false,POS_FACEUP_DEFENCE) end
These are the things I think are stopping me from targeting more than one monster. Tell me if i'm wrong and what else if not that I would need to change... I also might have gotten what I changed it to wrong (as in not placed the right info in the right place)I would copy this verbatim and just switch out the filters... but it only targets two monsters while I want mine to have the potential to target multiple monsters on either side of the field or at least my opponent's side of the field that are able to be Synchro material with 1 tuner on my side. This is what I have so far, any reason why it wouldn't activate? - Spoiler:
function c94634434.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,0x1e0) e1:SetRange(LOCATION_MZONE) e1:SetTarget(c94634434.target) e1:SetOperation(c94634434.operation) c:RegisterEffect(e1) end
function c94634434.filter0(c,e,tp) return lv>0 and c:IsAbleToGrave()and c:GetOwner()==tp and c:GetLevel() end
function c94634434.filter1(c,e,lv,tp) local tlv=c:GetLevel() return lv>0 and c:IsAbleToGrave()and c:GetOwner()==tp and c:IsType(TYPE_TUNER) and Duel.IsExistingMatchingCard(c11047543.exfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv+tlv) end
function c94634434.exfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)and c:GetLevel()==lv and c:IsType(TYPE_SYNCHRO) end
function c94634434.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingTarget(c94634434.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)and Duel.IsExistingTarget(c94634434.filter0,tp,LOCATION_MZONE,0,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g1=Duel.SelectTarget(tp,c94634434.filter0,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g2=Duel.SelectTarget(tp,c94634434.filter1,tp,LOCATION_MZONE,0,nil,nil,e,tp,g1:GetFirst():GetLevel()) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_ToGrave,g1,nil,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end
function c94634434.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc1=g:GetFirst() local tc2=g:GetNext() local sg=Duel.GetMatchingGroup(c11047543.exfilter,tp,LOCATION_EXTRA,0,nil,e,tp,tc1:GetLevel()+tc2:GetLevel()) if sg:GetCount()==0 then return end Duel.SendtoGrave(g,POS_FACEUP,REASON_EFFECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local ssg=sg:Select(tp,1,1,nil) Duel.SpecialSummon(ssg,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) end
Last edited by Giyuo on Wed Apr 15, 2015 1:07 am; edited 4 times in total |
| | | Giyuo
Member Title : Giyuo Posts : 24 Join date : 2015-04-09
| Subject: Re: Need help with making cards based on Owner's Seal Tue Apr 14, 2015 11:35 pm | |
| What I've learned so far... |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Need help with making cards based on Owner's Seal Wed Apr 15, 2015 12:28 am | |
| There's a trap card called "Synchro Material" which would let you do that, but it's more like monarchs stormforth where you activate it and it simply resolves as a change in your legal actions. To summon, you don't start a chain with it. I used it for one of my cards. I could check it at some point, I'm not on that comp right now. Or you could check synchro material for yourself. |
| | | Sponsored content
| Subject: Re: Need help with making cards based on Owner's Seal | |
| |
| | | | Need help with making cards based on Owner's Seal | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 5 users online :: 0 Registered, 0 Hidden and 5 Guests None Most users ever online was 270 on Sun Apr 11, 2021 4:35 pm |
Latest topics | » Goodbye allMon Aug 08, 2016 7:53 pm by Zenas» [PLEASE READ] [VERY IMPORTANT] MACKPRO REVIVALMon Aug 08, 2016 7:47 pm by Zenas» D.D. Dragons vs KozmosSun Jul 10, 2016 11:02 pm by cane_63106» Where's everyone?!Sat May 28, 2016 2:58 am by cane_63106» Mech Archetype (crappy it be, maybe you guys would like it)Sun May 15, 2016 1:11 pm by barti02» My Assassin ArchetypeSun May 15, 2016 1:10 pm by barti02» SO I have a "NEW ARCHETYPE THE "WolfPack"Sun May 15, 2016 12:35 pm by barti02» Fusion monster doesn't appear in extra deck? Sat Apr 30, 2016 9:02 pm by Marc1» Mackpro update 10/6/2015Sat Apr 02, 2016 6:36 pm by Hulkty» Bionicle Cards AKA Japanese Children's Cardgames on Swedish Toy RobotsSun Mar 06, 2016 9:37 am by Utso |
|