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 | .
 

 Activation Messages

View previous topic View next topic Go down 
AuthorMessage
Pullo

avatar


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

PostSubject: 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?").
Back to top Go down
View user profile
outlaw1994

avatar
Admin
Admin

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

PostSubject: 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
Back to top Go down
View user profile http://mackpro.userboard.net
Pullo

avatar


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

PostSubject: 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:
 

_________________
Back to top Go down
View user profile
outlaw1994

avatar
Admin
Admin

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

PostSubject: 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
Back to top Go down
View user profile http://mackpro.userboard.net
Pullo

avatar


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

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

Thanks, I'll try that out! Smile

_________________
Back to top Go down
View user profile
Sponsored content





PostSubject: Re: Activation Messages   

Back to top Go down
 

Activation Messages

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

 Similar topics

-
» Ghostly private messages?
» secret village of the sepllcasters
» Days of the Week Images
» Happy b day lovely Nathy!!!
» RGSS = Scripting Basics - Window Class

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