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
 
HomePortalLatest imagesSearchRegisterLog in

Share
 

 Activation Messages

View previous topic View next topic Go down 
AuthorMessage
Pullo

Pullo


Member Title : Wolf Trainer
Posts : 28
Join date : 2013-10-15
Age : 28

Activation Messages Empty
PostSubject: Activation Messages   Activation Messages Icon_minitimeTue 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?").
Back to top Go down
outlaw1994

outlaw1994
Admin
Admin

Member Title : Red-Eyes Lord
Posts : 797
Join date : 2013-07-09
Age : 29
Location : bundaberg qld australia

Activation Messages Empty
PostSubject: Re: Activation Messages   Activation Messages Icon_minitimeWed Oct 16, 2013 12:37 am

post the code you have atm and i will fix and show you how to do it
Back to top Go down
https://mackpro.forumotion.com
Pullo

Pullo


Member Title : Wolf Trainer
Posts : 28
Join date : 2013-10-15
Age : 28

Activation Messages Empty
PostSubject: Re: Activation Messages   Activation Messages Icon_minitimeWed 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:
Back to top Go down
outlaw1994

outlaw1994
Admin
Admin

Member Title : Red-Eyes Lord
Posts : 797
Join date : 2013-07-09
Age : 29
Location : bundaberg qld australia

Activation Messages Empty
PostSubject: Re: Activation Messages   Activation Messages Icon_minitimeThu 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
Back to top Go down
https://mackpro.forumotion.com
Pullo

Pullo


Member Title : Wolf Trainer
Posts : 28
Join date : 2013-10-15
Age : 28

Activation Messages Empty
PostSubject: Re: Activation Messages   Activation Messages Icon_minitimeFri Oct 18, 2013 1:04 am

Thanks, I'll try that out! Smile
Back to top Go down
Sponsored content





Activation Messages Empty
PostSubject: Re: Activation Messages   Activation Messages Icon_minitime

Back to top Go down
 

Activation Messages

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

 Similar topics

-
» banishing cards for an activation

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Custom Card Ruling and Bugs-