Jump to content

YGOPRO custom card scripting help/question (plz)


Vengevoid

Recommended Posts

Hello, this is a Ygopro custom card scripting related question.

I'm currently running into a problem with the functionality of the effects that I'm using for this card. I'm hoping anyone can help me answer or at least help with scripting this effect. Some of the effects below are already finished but feel free to make changes along the way. I just need help on the others. 

 

Effect 1 (done):

When this card attacks a Defense Position monster, if the attack target is a non-LIGHT or a non-DARK monster during the Damage Step, inflict piercing battle damage to your opponent.

(This means if the monster is face-up (regardless if its flipped or not) during damage step, piercing battle damage is applied.)

 

Effect 2 (done):

This card is also treated as a DARK monster.

(self-explanatory)

 

Effect 3 (needs to be fixed):

Once per turn, during your Main Phase 1, you can banish 1 LIGHT and 1 DARK monster from your graveyard; until the end of this turn, this card can attack all monsters your opponent controls, once each. 

(Because this is a powerful effect, it is necessary for the cost to be that way.)

 

Effect 4 (needs to be fixed):

When this card destroys a monster as a result of battle, this card loses 200 ATK until the End Phase of this turn.

(This effect is almost pretty useless unless you're using effect 3. If anyone has ever played the game "Maplestory" and have made a 4th job Luminous character (I'm not making this card using the real luminous character), you can definitely understand why effect 3 and 4 are linked to each other.)

 

Feel free to comment down below if you know who to script this. I'm not sure if the order of the script really matters but feel free to put an attachment if possible. It's really appreciative and you have my gratitude.

Link to comment
Share on other sites

Hello, this is a Ygopro custom card scripting related question.

I'm currently running into a problem with the functionality of the effects that I'm using for this card. I'm hoping anyone can help me answer or at least help with scripting this effect. Some of the effects below are already finished but feel free to make changes along the way. I just need help on the others. 

 

Effect 1 (done):

When this card attacks a Defense Position monster, if the attack target is a non-LIGHT or a non-DARK monster during the Damage Step, inflict piercing battle damage to your opponent.

(This means if the monster is face-up (regardless if its flipped or not) during damage step, piercing battle damage is applied.)

 

Effect 2 (done):

This card is also treated as a DARK monster.

(self-explanatory)

 

Effect 3 (needs to be fixed):

Once per turn, during your Main Phase 1, you can banish 1 LIGHT and 1 DARK monster from your graveyard; until the end of this turn, this card can attack all monsters your opponent controls, once each. 

(Because this is a powerful effect, it is necessary for the cost to be that way.)

 

Effect 4 (needs to be fixed):

When this card destroys a monster as a result of battle, this card loses 200 ATK until the End Phase of this turn.

(This effect is almost pretty useless unless you're using effect 3. If anyone has ever played the game "Maplestory" and have made a 4th job Luminous character (I'm not making this card using the real luminous character), you can definitely understand why effect 3 and 4 are linked to each other.)

 

Feel free to comment down below if you know who to script this. I'm not sure if the order of the script really matters but feel free to put an attachment if possible. It's really appreciative and you have my gratitude.

Can you post what you have so far as an attachment or something? (since your posting a script and not a card image, it should be allowed).

 

For future reference, a thread like this belongs here:

http://forum.yugiohcardmaker.net/forum/56-ygopro/

Link to comment
Share on other sites

somehow i dont remember how to put attachments because i rarely post attachments here.

But here it is for now:

 

--Lumino Voidslayer, Viper
function c20626169.initial_effect©
--Attribute Dark
local e1=Effect.CreateEffect©
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect©
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetRange(LOCATION_MZONE) 
e2:SetCondition(c20626169.condtion)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect©
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetOperation(c20626169.atkop)
c:RegisterEffect(e3)
--attack all
local e4=Effect.CreateEffect©
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c20626169.cost)
e4:SetCountLimit:(1)
e4:SetOperation(c20626169.operation)
c:RegisterEffect(e4)
end
 
function c20626169.costfilter©
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost()
end
function c20626169.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84704041.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c84704041.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
 
function c20626169.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect©
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
 
function c20626169.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect©
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-200)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+RESET_BATTLE)
c:RegisterEffect(e1)
end
 
function c20626169.condtion(e)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
local bc=c:GetBattleTarget()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL)
and c:IsRelateToBattle() and bc:IsFaceup() and bc:IsAttribute(ATTRIBUTE_FIRE) or bc:IsAttribute(ATTRIBUTE_WATER) or bc:IsAttribute(ATTRIBUTE_WIND) or bc:IsAttribute(ATTRIBUTE_EARTH) or bc:IsAttribute(ATTRIBUTE_DIVINE) 
end
Link to comment
Share on other sites

Effect 3:

Your approach is right, you just forgot to change the costfilter function to your card's ID

 

This part:

 

if chk==0 then return Duel.IsExistingMatchingCard(c84704041.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c84704041.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
 
has a small error

 

Effect4:

At a glance I can't figure out the issue. It would be helpful to know what happens when you try to use this effect

 

edit: Does the version of YGO pro your using display error text on screen when you try to use effect 3? Some versions do show error text when erros happen and it makes debugging a lot easier

 

edit2: actually if you open "system.conf" in your ygo pro folder with notepad and change the line that says "errorlog = 0" to "errorlog = 1" you can turn this debugging feature on

Link to comment
Share on other sites

Update 9:08PM est: activation cost is finished along with everything else. Just need something that removes 1 Light AND Dark.

function c20626169.costfilter©
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function c20626169.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20626169.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c20626169.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
Link to comment
Share on other sites

 

Update 8:51PM est: the activating cost still needs to fix but the multiple attacks are done. I need something that removed 2 cards simultaneously.

function c20626169.costfilter©
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function c20626169.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20626169.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c20626169.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end

 

I see what the issue is now

 

function c20626169.costfilter(c,att)
return c:IsAttribute(att) and c:IsAbleToRemoveAsCost()
end
function c20626169.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20626169.cfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c20626169.cfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c20626169.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_LIGHT)
Duel.Remove(g,POS_FACEUP,REASON_COST)
g=Duel.SelectMatchingCard(tp,c20626169.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,ATTRIBUTE_DARK)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
 
This is from memory but it should hopefully work.
If not, look at the scripts these cards:
Link to comment
Share on other sites

woot perfecto!

thank you so much man. definitely appreciate your help! -thumbs up-

This card is part of my custom voidslayer archetype. I made the cost kinda huge because you have the piercing effect as well as the multiple attack effect. i think about 4 or 5 will have the piercing effect but with different anti-attributes. speaking of the piercing effect, i dont know if the piercing effect is a bit too OP because it still pierces through when your attacking the monster face-down if its the target is not one of the attribute listed on the 4 or 5 voidslayers. my intention was to only have the piercing effect work when its attacking a face-up monster since its only fair because you don't know wat monster that your opponent is hiding face-down. i can either leave it there (if its fine and balanced) or maybe change it (if its too OP). Again, thank you so much for your time.

Link to comment
Share on other sites

woot perfecto!

thank you so much man. definitely appreciate your help! -thumbs up-

This card is part of my custom voidslayer archetype. I made the cost kinda huge because you have the piercing effect as well as the multiple attack effect. i think about 4 or 5 will have the piercing effect but with different anti-attributes. speaking of the piercing effect, i dont know if the piercing effect is a bit too OP because it still pierces through when your attacking the monster face-down if its the target is not one of the attribute listed on the 4 or 5 voidslayers. my intention was to only have the piercing effect work when its attacking a face-up monster since its only fair because you don't know wat monster that your opponent is hiding face-down. i can either leave it there (if its fine and balanced) or maybe change it (if its too OP). Again, thank you so much for your time.

Your welcome

My recommendation is that since the attack target monster is face-up by the time damage is calculated anyway, the effect should apply regardless of what position it was in when the attack starts.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...