| | Help with Destroy + Special Summon effect | |
| Author | Message |
---|
ShikaShika
Member Title : Card newbie Posts : 11 Join date : 2014-07-12
| Subject: Help with Destroy + Special Summon effect Wed Oct 01, 2014 10:46 pm | |
| Hey, all. I've been trying to script the following effect, but I can't get it to work:Quote:Continuous Spell Once per turn, you can target any number of "XX" monsters you control; destroy them and Special Summon from your Deck a "XX" monster(s) with a combined Level equal to or lower than the destroyed monster(s).As a base, I've been working with http://yugioh.wikia.com/wiki/Worm_Queen (c81254059) and http://yugioh.wikia.com/wiki/Circle_of_the_Fire_Kings (c59388357), but I can't get it to work at all.If anyone can help with this script, I'd greatly appreciate it. |
| | | StormWing0
Member Title : Over Creative Card Ideas Posts : 451 Join date : 2013-07-14 Age : 32 Location : Tacoma, WA
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 2:33 am | |
| Looks like you need to change the Archetype target but I can't remember how to make a new one in the DB so it can be used. >.> |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 2:47 am | |
| You'd just need to type a random number from 514 to... I forget the max for the archetype number in the DB.
And for the script you'd have to get its hexidecimal number to reference the archetype in the script itself.
Anyways, if not that, what was the exact problem? |
| | | ShikaShika
Member Title : Card newbie Posts : 11 Join date : 2014-07-12
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 3:12 am | |
| The particular archetype I'm trying to work with is Yang Zings, and the set code is 0x9e. The problems I'm running into are the following:
Worm Queen lets you tribute 1 monster to special summon 1 monster. Firstly, I don't want to tribute but rather to destroy 1, because I want to proc Yang Zing effects when they are destroyed. I figured I could use Circle of the Fire Kings to replicate this, by changing Worm Queen's cost to a target and changing the location from LOCATION_GRAVE to LOCATION_DECK. The second problem is that I want to be able to destroy and special summon more than 1 monster, but I don't know how to do this.
Anyway, when I combine Worm Queen and Circle of the Fire Kings to destroy rather than tribute, I find that I can no longer activate the effect. For what it's worth, here is my code:
function c6000200.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Destroy then special summon local e17=Effect.CreateEffect(c) e17:SetProperty(EFFECT_FLAG_CARD_TARGET) e17:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e17:SetType(EFFECT_TYPE_IGNITION) e17:SetRange(LOCATION_SZONE) e17:SetCode(EVENT_FREE_CHAIN) e17:SetCountLimit(1) e17:SetTarget(c6000200.dsstg) e17:SetOperation(c6000200.dssop) c:RegisterEffect(e17) end function c6000200.dsscostfilter(c) return c:IsDestructable() and c:IsSetCard(0x9e) and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(c6000200.dsspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel()) end function c6000200.dsstg(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(c6000200.dsscostfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(c6000200.dsspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g1=Duel.SelectTarget(tp,c6000200.dsscostfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local lv=g1:GetLevel() local g2=Duel.SelectTarget(tp,c6000200.dsspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0) e:SetLabelObject(g1:GetFirst()) end function c6000200.dsspfilter(c,e,tp,lv) return c:IsSetCard(0x9e) and c:GetLevel()<=lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c6000200.dssop(e,tp,eg,ep,ev,re,r,rp) local tc1,tc2=Duel.GetFirstTarget() if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end if tc1:IsControler(tp) and tc1:IsRelateToEffect(e) and Duel.Destroy(tc1,REASON_EFFECT)>0 and tc2:IsRelateToEffect(e) then Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP) end end
The jump in effect numbers is just because I've omitted other, unrelated effects. |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 4:01 am | |
| Try just copying the circle of the fire kings cost. That dsscostfilter looks like you're trying to destroy the monster that you would special summon as a cost from the deck (and well, it wouldn't be in the deck anymore to summon).
That SHOULD be the only thing you need to do...
function c6000200.dsscostfilter(c) return c:IsFaceup() and c:IsSetCard(0x9e) and c:IsDestructable() |
| | | ShikaShika
Member Title : Card newbie Posts : 11 Join date : 2014-07-12
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 4:32 am | |
| Alright, I did that. And now there is an issue with the following segment:
function c6000200.dsspfilter(c,e,tp,lv) return c:IsSetCard(0x9e) and c:GetLevel()<=lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Undoubtedly it's the "c:GetLevel()<=lv", as it says it's trying to make a comparison with a non-existent number, but I don't know how to set lv aside from what I've already included. |
| | | outlaw1994
Admin
Member Title : Red-Eyes Lord Posts : 797 Join date : 2013-07-09 Age : 29 Location : bundaberg qld australia
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 9:36 am | |
| in this line add
local g2=Duel.SelectTarget(tp,c6000200.dsspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
,lv at the end so it would be like this
local g2=Duel.SelectTarget(tp,c6000200.dsspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
any variable you declare in the filter has to also be declared in the variable that uses the filter so the lv at the end of local g2 has to be the number you want to use in your filter as lv in this case the level hope this helps |
| | | ShikaShika
Member Title : Card newbie Posts : 11 Join date : 2014-07-12
| Subject: Re: Help with Destroy + Special Summon effect Thu Oct 02, 2014 10:02 am | |
| Alright, I did that, but I'm still getting an error from the same line, and the error reads: - Code:
-
attempt to compare number with nil This is how the updated script looks: - Quote :
- function c6000200.initial_effect(c)
--activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Destroy then special summon local e17=Effect.CreateEffect(c) e17:SetProperty(EFFECT_FLAG_CARD_TARGET) e17:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e17:SetType(EFFECT_TYPE_IGNITION) e17:SetRange(LOCATION_SZONE) e17:SetCode(EVENT_FREE_CHAIN) e17:SetCountLimit(1) e17:SetTarget(c6000200.dsstg) e17:SetOperation(c6000200.dssop) c:RegisterEffect(e17) end function c6000200.dsscostfilter(c) return c:IsDestructable() and c:IsSetCard(0x9e) and c:IsFaceup() end function c6000200.dsstg(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(c6000200.dsscostfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(c6000200.dsspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g1=Duel.SelectTarget(tp,c6000200.dsscostfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local lv=g1:GetLevel() local g2=Duel.SelectTarget(tp,c6000200.dsspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0) e:SetLabelObject(g1:GetFirst()) end function c6000200.dsspfilter(c,e,tp,lv) return c:IsSetCard(0x9e) and c:GetLevel()<=lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c6000200.dssop(e,tp,eg,ep,ev,re,r,rp) local tc1,tc2=Duel.GetFirstTarget() if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end if tc1:IsControler(tp) and tc1:IsRelateToEffect(e) and Duel.Destroy(tc1,REASON_EFFECT)>0 and tc2:IsRelateToEffect(e) then Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP) end end |
| | | ShikaShika
Member Title : Card newbie Posts : 11 Join date : 2014-07-12
| Subject: Re: Help with Destroy + Special Summon effect Fri Oct 03, 2014 1:35 pm | |
| I managed to figure it out. The script, for anyone who is interested: - Quote :
- function c6000200.initial_effect(c)
--activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Destroy then special summon local e17=Effect.CreateEffect(c) e17:SetProperty(EFFECT_FLAG_CARD_TARGET) e17:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e17:SetType(EFFECT_TYPE_IGNITION) e17:SetRange(LOCATION_SZONE) e17:SetCode(EVENT_FREE_CHAIN) e17:SetCountLimit(1) e17:SetTarget(c6000200.dsstg) e17:SetOperation(c6000200.dssop) c:RegisterEffect(e17) end function c6000200.dsscostfilter(c,e,tp) return c:IsSetCard(0x9e) and c:IsFaceup() and c:IsDestructable() and Duel.IsExistingMatchingCard(c6000200.dsspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel()) end function c6000200.dsstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,c6000200.dsscostfilter,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) local sg=Duel.SelectReleaseGroup(tp,c6000200.dsscostfilter,1,5,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,1,0,0) local tlv=0 local bc=sg:GetFirst() while bc do local clv=bc:GetLevel() tlv=tlv+clv bc=sg:GetNext() end e:SetLabel(tlv) end function c6000200.dsspfilter(c,e,tp,lv) return c:IsSetCard(0x9e) and c:GetLevel()<=lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c6000200.dsspfilter2(c,e,tp) return c:IsSetCard(0x9e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c6000200.dssop(e,tp,eg,ep,ev,re,r,rp) local ex,sg=Duel.GetOperationInfo(0,CATEGORY_DESTROY) Duel.Destroy(sg,REASON_EFFECT) if not e:GetHandler():IsRelateToEffect(e) then return end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local c=e:GetHandler() local slv=e:GetLabel() local sg=Duel.GetMatchingGroup(c6000200.dsspfilter2,tp,LOCATION_DECK,0,nil,e,tp) sg:Remove(Card.IsLevelAbove,nil,slv+1) if sg:GetCount()==0 then return end local cg=Group.CreateGroup() repeat Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=sg:Select(tp,1,1,nil):GetFirst() sg:RemoveCard(tc) slv=slv-tc:GetLevel() Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) sg:Remove(Card.IsLevelAbove,nil,slv+1) ft=ft-1 until ft<=0 or sg:GetCount()==0 or not Duel.SelectYesNo(tp,aux.Stringid(6000200,0)) Duel.SpecialSummonComplete() Duel.ConfirmCards(1-tp,cg) end |
| | | Sponsored content
| Subject: Re: Help with Destroy + Special Summon effect | |
| |
| | | | Help with Destroy + Special Summon effect | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 3 users online :: 0 Registered, 0 Hidden and 3 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 |
|