a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | .
 

 Skeleton Warrior - DeeKay Error

View previous topic View next topic Go down 
AuthorMessage
Marc1




Posts : 43
Join date : 2013-08-03

PostSubject: Skeleton Warrior - DeeKay Error   Sun Feb 28, 2016 3:43 am

When this card is sent to the Graveyard; destroy 1 monster on the Field.

I copied Man-Eater Bug code into this but when it goes to the Graveyard, It tries to activate but nothing happens.

Where did I go wrong?


--Skeleton Warrior - DeeKay
function c10550000.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10550000,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetOperation(c10550000.operation)
c:RegisterEffect(e1)
end
function c10550000.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10550000.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
Back to top Go down
View user profile
Utso

avatar


Member Title : Barnacle Yoghurt
Posts : 6
Join date : 2016-02-21
Age : 20

PostSubject: Re: Skeleton Warrior - DeeKay Error   Sun Feb 28, 2016 11:34 am

Marc1 wrote:
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10550000,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetOperation(c10550000.operation)
c:RegisterEffect(e1)
You forgot to assign the target function to the effect with e1:SetTarget here. Because of that, the operation is called right away and doesn't produce any results because no target has been selected, leading to the described behavior.
Back to top Go down
View user profile
Marc1




Posts : 43
Join date : 2013-08-03

PostSubject: Re: Skeleton Warrior - DeeKay Error   Sun Feb 28, 2016 7:37 pm

I added e1:SetTarget(c10550000.destg) to the script & it gave me an error with that line.  What did I do wrong?
Back to top Go down
View user profile
Utso

avatar


Member Title : Barnacle Yoghurt
Posts : 6
Join date : 2016-02-21
Age : 20

PostSubject: Re: Skeleton Warrior - DeeKay Error   Sun Feb 28, 2016 9:07 pm

Isn't the function called c10550000.target and not .destg? Unless you changed it since the initial post.
Back to top Go down
View user profile
Marc1




Posts : 43
Join date : 2013-08-03

PostSubject: Re: Skeleton Warrior - DeeKay Error   Mon Feb 29, 2016 4:05 am

Thanks, that works! (I don't know how to code. I just copy & paste & hope it works! LOL)
Back to top Go down
View user profile
StormWing0




Member Title : Over Creative Card Ideas
Posts : 451
Join date : 2013-07-14
Age : 25
Location : Tacoma, WA

PostSubject: Re: Skeleton Warrior - DeeKay Error   Tue Mar 01, 2016 2:00 am

lol at least you are willing to learn unlike some other person on the forum. XD

_________________
Own Archetypes being worked on: RoseHarpie, OrbLit, Crystal Elemental (No cards yet on the last one).

Current Hamachi Room that isn't full:
Name: StormWing120V3
Pass: 1234

Discord Channel: Instant Invite Let me know if this fails to work right.  If it fully works it'll replace the Hamachi above.

Keep in mind these below are just estimates and even if it says 100% it only means what is needed for the main dueling deck is done
RoseHarpie 50% finished but no code or images
OrbLit 80% finished some images but no code
Crystal Elemental 0% finished
Back to top Go down
View user profile
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Re: Skeleton Warrior - DeeKay Error   Thu Mar 03, 2016 2:31 am

Yup, I started with basic stuff like this too Smile good times. I'm at 300+ scripted cards right now, but I did redo like 50 because they were too basic. Anyways I'll give you rep points cause it's nice to see people actually try instead of just ask requests without trying anything first, not that there's been many people here (just that one guy, I forget his name. I think his location mentions something about living under a bridge)
Back to top Go down
View user profile
Sponsored content





PostSubject: Re: Skeleton Warrior - DeeKay Error   

Back to top Go down
 

Skeleton Warrior - DeeKay Error

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» my warrior deck
» The Sigmarite Warrior Priest HS (TC#28)
» equip spell/warrior combo
» Light Warrior Deck
» Warrior priest of Sigmar

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Custom cards - Single cards-