hypercam2
2015-09-26T15:00:30Z
I'm trying to make my own deck of custom cards in YGOPro. I'm using this method of scripting



I've got the basics down and have been able to create a few cards with working custom effects. But I keep running into the same problems while trying to create effects.


1. Continuous effects. No matter how much I mess around with the codes I can't seem to find a way to make certain effects continuous. For example, if I try to turn Mirror Force into a continuous trap card, the effect will work when I activate the card but it doesn't do anything after that except sit on the field. Is there a simple code I can input to any card effect to make it so I can activate it whenever it's needed?


2. Meshing different card effects. It's difficult to put together two or more different effects into one card. Sometimes I'm only able to activate one effect but not the other or I get errors when trying to mix two effects together no matter how I script it. Is there a simple format I need to follow or instructions on the proper way to script multiple effects in one?
MVPIII
2015-09-26T18:21:35Z
Originally Posted by: hypercam2 

I'm trying to make my own deck of custom cards in YGOPro. I'm using this method of scripting




I've got the basics down and have been able to create a few cards with working custom effects. But I keep running into the same problems while trying to create effects.


1. Continuous effects. No matter how much I mess around with the codes I can't seem to find a way to make certain effects continuous. For example, if I try to turn Mirror Force into a continuous trap card, the effect will work when I activate the card but it doesn't do anything after that except sit on the field. Is there a simple code I can input to any card effect to make it so I can activate it whenever it's needed?


2. Meshing different card effects. It's difficult to put together two or more different effects into one card. Sometimes I'm only able to activate one effect but not the other or I get errors when trying to mix two effects together no matter how I script it. Is there a simple format I need to follow or instructions on the proper way to script multiple effects in one?



For 1, you're talking about 2 different things. Are you trying to make a continuous trap with a continuous effect? Or do you want the trap to linger on the field and be reusable (be it a normal trap card or continuous)? It sounds like you're trying to go with the second option to me when you say "activate it whenever it's needed" so I'd say check out lightsworn barrier for an example. If you're trying to just make mirror force continuous that will go off on its own when a monster declares an attack I'm not sure how to do that.

https://www.ygopro.co/Fo...al--CURRENTLY-INCOMPLETE 

cane_63106
2015-09-28T20:16:37Z
Try this:

function cXXX.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(XXX,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cXXX.condition)
e1:SetTarget(cXXX.target)
e1:SetOperation(cXXX.activate)
c:RegisterEffect(e1)
end
function cXXX.condition(e,tp,eg,ep,ev,re,r,rp)


or this:

function cXXX.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cXXX.condition)
e1:SetTarget(cXXX.target)
e1:SetOperation(cXXX.activate)
c:RegisterEffect(e1)
end
function cXXX.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function cXXX.filter(c)
return c:IsAttackPos() and c:IsDestructable()
end
function cXXX.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cXXX.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cXXX.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cXXX.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cXXX.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
Kindrindra
2015-09-29T11:01:44Z
If it's a Continuous Trap you're going for, you're actually going to need two effects- an "ACTIVATE" effect for when you flip up the card, and a "TRIGGER_O" (or TRIGGER_F or CONTINUOUS) effect for while it's faceup.
Cards scripted: ...lost count
Cards released: 18
Cards illustrated: Double digits
Main Decks: D/D, Heraldic, Gusto on good days
Users browsing this topic