|
| Author | Message |
---|
AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Stuck again -__-' Sun Jun 08, 2014 2:01 pm | |
| I don't know whether I'm too stupid or the card I want to make is to difficult, but I don't know how I should script the following card: If this cards is synchro summoned, draw 1 card an perform following effects depending on the card you draw: *monster: gain lifepoints equal to the atk of the monster you draw *spell/ trap: destroy 1 card on the field What I have done so far: - Code:
-
function c900000004.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,c900000004.tfilter,aux.NonTuner(Card.IsSetCard,0x3E8),1) c:EnableReviveLimit() --synchro summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(900000004,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c900000004.drcon) e1:SetTarget(c900000004.drtarg) e1:SetOperation(c900000004.drop) c:RegisterEffect(e1) end
function c900000004.tfilter(c) return c:IsSetCard(0x3E8) end function c900000004.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO end function c900000004.drtarg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c900000004.cfilter(c) return c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP) end function c900000004.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) local dg=Duel.GetOperatedGroup() local d=dg:FilterCount(c900000004.cfilter,nil) if d>0 then else end end I tried to fill in the if-else a 2nd effect fo my cards (e2=Effect.CreateEffect(c)), but it says that the first parameter of this thing should be 'card' ^^ Hope someone can help me ^^' |
| | | VB99
Member Title : Legendary Planet Posts : 368 Join date : 2013-11-10
| Subject: Re: Stuck again -__-' Sun Jun 08, 2014 11:16 pm | |
| Card... maybe you didn't give the effect the right target? |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Mon Jun 09, 2014 11:51 am | |
| It says, that in the line, where I put e2=Effect.CreateEffect(c), the first parameter should be 'card', but I don't understand which target I should give the card besides 'c'which means card ^^' |
| | | overcold_ice
Member Title : Overfrost! Posts : 21 Join date : 2014-06-02
| Subject: Re: Stuck again -__-' Mon Jun 09, 2014 7:34 pm | |
| Use 'e:GetHandler()' instead. |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Mon Jun 09, 2014 11:10 pm | |
| Thank you, I will try it after I got me a new pc, because my old one isn't living anymore ;( |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Tue Jun 17, 2014 5:10 pm | |
| Ok, I tested it with 'e:GetHandler()' and the error stopped, thank you^^ My Problem now is, that the destruction effect activates the whole time instead of just once after the card was drawn. And I have no idea, what I should do about the lp effect *.*' The effect of my monster was: When this card is synchro summoned, draw 1 card and perform following effects depending on the card you draw: *monster: Get liefepoints equals to the atk of the monster you draw *spell/ trap: Destroy one card on the field My script so far: - Code:
-
function c900000004.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,c900000004.tfilter,aux.NonTuner(Card.IsSetCard,0x3E8),1) c:EnableReviveLimit() --synchro summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(900000004,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c900000004.drcon) e1:SetTarget(c900000004.drtarg) e1:SetOperation(c900000004.drop) c:RegisterEffect(e1) end
function c900000004.tfilter(c) return c:IsSetCard(0x3E8) end function c900000004.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO end function c900000004.drtarg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c900000004.cfilter(c) return c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP) end function c900000004.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) local dg=Duel.GetOperatedGroup() local d=dg:FilterCount(c900000004.cfilter,nil) if d>0 then local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(900000004,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetTarget(c900000004.target) e1:SetOperation(c900000004.operation) c:RegisterEffect(e1) else end end
function c900000004.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) 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 function c900000004.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Hope someone can help^^' |
| | | overcold_ice
Member Title : Overfrost! Posts : 21 Join date : 2014-06-02
| Subject: Re: Stuck again -__-' Thu Jun 19, 2014 3:09 pm | |
| This, perhaps: - Code:
-
if d>0 then local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(900000004,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) -- add this line e1:SetTarget(c900000004.target) e1:SetOperation(c900000004.operation) c:RegisterEffect(e1) else end |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Thu Jun 19, 2014 4:05 pm | |
| Thank you, but 'SetCountLimit' only limits how often you can activate the effect per turn. With that, I coul activate the effect each turn instead of just once after a spell/ trap was drawn^^' |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Stuck again -__-' Thu Jun 19, 2014 11:31 pm | |
| It looks like the destruction is related to the effect but the draw isn't. How to fix that though, idk. |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Fri Jun 20, 2014 10:41 am | |
| looks like it XD Anyway the effect of the card is a little bit too strong, maybe I change it.^^' |
| | | dye2556
Member Title : Just a passing man Posts : 17 Join date : 2014-06-05
| Subject: Re: Stuck again -__-' Fri Jun 20, 2014 5:54 pm | |
| Why must you add the new effect? You only want the destroy effect activated immediately after draw step, right? So try this. - Code:
-
function c900000004.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) local dg=Duel.GetOperatedGroup() local d=dg:FilterCount(c900000004.cfilter,nil) if d>0 then local dt=Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) if dt then local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local tc=g:GetFirst() if tc then Duel.Destroy(tc,REASON_EFFECT) end end end end |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Fri Jun 20, 2014 6:22 pm | |
| Cool it worked, thank you^^ |
| | | dye2556
Member Title : Just a passing man Posts : 17 Join date : 2014-06-05
| Subject: Re: Stuck again -__-' Sat Jun 21, 2014 4:38 am | |
| Spell/Trap draw effect is okay now. Then for the monster draw effect try this. - Code:
-
function c900000004.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) local dg=Duel.GetOperatedGroup() local d=dg:FilterCount(c900000004.cfilter,nil) if d>0 then local dt=Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) if dt then local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local tc=g:GetFirst() if tc then Duel.Destroy(tc,REASON_EFFECT) end end else lg=dg:Select(tp,1,1,nil) local tc2=lg:GetFirst() local rec=tc2:GetTextAttack() Duel.Recover(tp,rec,REASON_EFFECT) end end |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Sat Jun 21, 2014 11:32 am | |
| Thank you very much, it workes^^ Am I allowed to ask, where you learn scripting?? |
| | | dye2556
Member Title : Just a passing man Posts : 17 Join date : 2014-06-05
| Subject: Re: Stuck again -__-' Sat Jun 21, 2014 3:49 pm | |
| - AoO wrote:
- Thank you very much, it workes^^
Am I allowed to ask, where you learn scripting?? I practiced by myself. First of all, I start with copy and paste method. (Choose card that has similar effects for reference.) Then try to understand what code makes what effect. After some practices (cards I created until today over 100 cards), your skill will be improved. Also, learning from other people's custom cards helps much. Many of them have unique effects. |
| | | AoO
Member Title : Noob4ever Posts : 241 Join date : 2014-04-25 Location : I only know that it is dark :/
| Subject: Re: Stuck again -__-' Sat Jun 21, 2014 3:53 pm | |
| Thx, guess I have to script some more cards ^^ |
| | | Sponsored content
| Subject: Re: Stuck again -__-' | |
| |
| | | |
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 2 users online :: 0 Registered, 0 Hidden and 2 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 |
|