| | Author | Message |
---|
Pullo
Member Title : Wolf Trainer Posts : 28 Join date : 2013-10-15 Age : 28
| Subject: Activation Messages Tue Oct 15, 2013 7:46 pm | |
| I've started making my own custom cards, and I borrowed one of the effects of a card I made from Elemental Hero Stratos (the S/T destruction effect), but I do not know how to make the game trigger a proper activation message (I only know that I have to write it down on the cards.cdb file, but I don't know exactly what to do). So, if a card has multiple effects, how do I program it to show the proper activation message? (In this case it would be the Yes/No selection "Destroy Spell/Trap Cards on the field?"). |
| | | outlaw1994
Admin
Member Title : Red-Eyes Lord Posts : 797 Join date : 2013-07-09 Age : 29 Location : bundaberg qld australia
| Subject: Re: Activation Messages Wed Oct 16, 2013 12:37 am | |
| post the code you have atm and i will fix and show you how to do it |
| | | Pullo
Member Title : Wolf Trainer Posts : 28 Join date : 2013-10-15 Age : 28
| Subject: Re: Activation Messages Wed Oct 16, 2013 3:33 pm | |
| The card effect is "If this card is Normal or Special Summoned, you can destroy Spell or Trap Cards on the field up to the number of "Wolf" monsters you control." When you Summon it ingame, the box with the Yes/No selection will display "???" as the text. I'd be glad if you showed me how to change that. Thanks in advance. - Code:
-- Wolf Warrior Mikaboshi function c502.initial_effect(c) --destruction local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(c502.target) e1:SetOperation(c502.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) end function c502.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable() end function c502.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x258) end function c502.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then local ct=Duel.GetMatchingGroupCount(c502.cfilter,tp,LOCATION_MZONE,0,nil) e:SetLabel(ct) return Duel.IsExistingMatchingCard(c502.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end local ct=e:GetLabel() local sg=Duel.GetMatchingGroup(c502.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,ct,0,0) end function c502.operation(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(c502.cfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c502.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if ct>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(502,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=g:Select(tp,1,ct,nil) Duel.HintSelection(dg) Duel.Destroy(dg,REASON_EFFECT) end end
|
| | | outlaw1994
Admin
Member Title : Red-Eyes Lord Posts : 797 Join date : 2013-07-09 Age : 29 Location : bundaberg qld australia
| Subject: Re: Activation Messages Thu Oct 17, 2013 12:47 am | |
| use this code i put in bold and commented what i changed
-- Wolf Warrior Mikaboshi function c502.initial_effect(c) --destruction local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(502,0))--sets the ??? that comes up to what it says in str1 of the cdb for another str in the cdb just change the 0 to that str number-1 e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)--Change this to optional as your description says you can e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(c502.target) e1:SetOperation(c502.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) end function c502.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable() end function c502.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x258) end function c502.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then local ct=Duel.GetMatchingGroupCount(c502.cfilter,tp,LOCATION_MZONE,0,nil) e:SetLabel(ct) return Duel.IsExistingMatchingCard(c502.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end local ct=e:GetLabel() local sg=Duel.GetMatchingGroup(c502.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,ct,0,0) end function c502.operation(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(c502.cfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c502.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if ct>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(502,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=g:Select(tp,1,ct,nil) Duel.HintSelection(dg) Duel.Destroy(dg,REASON_EFFECT) end end |
| | | Pullo
Member Title : Wolf Trainer Posts : 28 Join date : 2013-10-15 Age : 28
| Subject: Re: Activation Messages Fri Oct 18, 2013 1:04 am | |
| Thanks, I'll try that out! |
| | | Sponsored content
| Subject: Re: Activation Messages | |
| |
| | | |
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 6 users online :: 0 Registered, 0 Hidden and 6 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 |
|