|
| Author | Message |
---|
yugitom
Member Title : A man Posts : 1 Join date : 2014-12-20
| Subject: Help with effect Sat Dec 20, 2014 11:15 pm | |
| I just need help programming the effect of a monster I am trying to make. The effect reads: - Code:
-
When a level 3 or below Angel-type monster is summoned to your side of the field; Special summon this card in face-up defense position. I have tried basing the code off Kagetokage and this is what I have so far: - Code:
-
function c98182297.initial_effect(c) c:EnableReviveLimit() --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(98182297,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_SUMMON_SUCCESS+EVENT_SPSUMMON_SUCCESS+EVENT_FLIP_SUMMON_SUCCESS) e1:SetCondition(c98182297.spcon) e1:SetTarget(c98182297.sptg) e1:SetOperation(c98182297.spop) c:RegisterEffect(e1) end function c98182297.spcon(e,tp,eg,ep,ev,re,r,rp) local ec=eg:GetFirst() return ec:IsControler(tp) and ec:GetLevel()==IsLevelBelow(3) and ec:GetRace()==IsRace(RACE_FAIRY) end function c98182297.sptg(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,true,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c98182297.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP) c:CompleteProcedure() end end I am new to programming cards and this is the first I have tried doing so the problem may be blatantly obvious to some but not me. Thank you. |
| | | cane_63106
Member Title : D.D. Dragon Kaiser Posts : 454 Join date : 2013-07-23 Location : St. Louis, MO
| Subject: Re: Help with effect Sun Dec 21, 2014 5:51 am | |
| is angel the same as fairy or do you have an angel archetype? I'm pretty sure I can just knock this off for you without looking at your script. This card is only being special summoned from the hand when these conditions are met, right? |
| | | thatjacksonboy
Member Title : ScrapKing Posts : 8 Join date : 2014-10-06
| Subject: Re: Help with effect Tue Dec 23, 2014 9:56 pm | |
| IF YOUR code for the most part was written correctly then this is how it should look
function c98182297.initial_effect(c) c:EnableReviveLimit() --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(98182297,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCondition(c98182297.spcon) e1:SetTarget(c98182297.sptg) e1:SetOperation(c98182297.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) end function c98182297.spcon(e,tp,eg,ep,ev,re,r,rp) local ec=eg:GetFirst() return ec:IsControler(tp) and ec:GetLevel()==IsLevelBelow(3) and ec:GetRace()==IsRace(RACE_FAIRY) end function c98182297.sptg(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,true,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c98182297.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_DEFENSE) c:CompleteProcedure() end end
Remember when you want it to do stuff on summon events they have to be there own SetCode so u have to make the SetCode in a Clone format
example local e2=e1:Clone e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) |
| | | Sponsored content
| Subject: Re: Help with effect | |
| |
| | | |
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 4 users online :: 0 Registered, 0 Hidden and 4 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 |
|