hung96
2016-02-29T08:34:11Z
I have scripted for a effect:[:tongue:]
Once per turn: You can destroy 1 monster your opponent controls; and if you do, inflict damage to your opponent equal to the destroyed monster's ATK on the field.

Here is script:


I want to ask way to make this effect become non-target effect as Artifact Moralltach, Trishula Dragon of the Ice Barrier,... I don't know way to change this script?[:wall:] Please help me. Thanks
hung96
2016-03-01T05:52:18Z
Please help me!!!
Michael Lawrence Dee
2016-03-01T13:54:00Z
Originally Posted by: hung96 

Please help me!!!



Your effect says "target" yet you want it to work like Moralltech. Maybe you should change your card text so people would help out though I have a suggestion, remove that SetProperty part so the FLAG_CARD_TARGET would be removed as well.
Now this is how I play:
hung96
2016-03-01T16:23:16Z
My English is really bad. Sorry about the confusing. I edited card text. I tried to removing the target function and SetProperty but nothing change the effect is still target effect. I want to ask What part will determine this in script? Thank you.
Michael Lawrence Dee
2016-03-01T16:24:52Z
Originally Posted by: hung96 

My English is really bad. Sorry about the confusing. I edited card text. I tried to removing the target function and SetProperty but nothing change the effect is still target effect. I want to ask What part will determine this in script? Thank you.



Please check Moralltech's script. [:thumbu:]
Now this is how I play:
hung96
2016-03-02T06:32:56Z
I checked Moralltech and replaced "local g=Duel.SelectTarget(tp,c26.filter,tp,0,LOCATION_MZONE,1,1,nil)" with
"local g=Duel.SelectMatchingCard(tp,c26.filter,tp,0,LOCATION_MZONE,1,1,nil)" .Effect have became non-target but it didn't destroy monster. Can you help me fix it? Thanks
Michael Lawrence Dee
2016-03-02T06:47:32Z
Do not put any "Select Card" functions in target. Place all SelectMatchingCard and so in the operation part.
Now this is how I play:
hung96
2016-03-02T06:57:29Z
I 've edited like this. Was it correct?

function c26.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c26.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c26.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack())
end
function c26.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c26.filter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
local atk=tc:GetAttack()
if atk<0 or tc:IsFacedown() then atk=0 end
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
Michael Lawrence Dee
2016-03-02T07:09:28Z
I got it. Copy Volcasaurus Anime script. I mean the whole thing from Target to Operation.

EDIT: Note, that the script is in expansions folder, cards-tf.zip then scripts folder.
Now this is how I play:
hung96
2016-03-02T07:50:26Z
Oh I have made it. Thank you so much. But I copied and replaced some scripts with card-tf folder to script folder accidentally. Was it okay?
Michael Lawrence Dee
2016-03-02T14:40:30Z
Originally Posted by: hung96 

Oh I have made it. Thank you so much. But I copied and replaced some scripts with card-tf folder to script folder accidentally. Was it okay?



I guess it's fine since the expansions folder is still prioritized over the scripts folder.
Now this is how I play:
hung96
2016-03-04T13:04:49Z
Sorry for bothering you again. Can you help me fix this effect become non-target ? Thanks
"Once per turn: You can change ATK of 1 face-up monster your opponent controls to 0, and if you do, negate its effects."

function c25.filter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c25.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c24.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c24.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c25.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 and tc:IsControler(1-tp) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
end
Michael Lawrence Dee
2016-03-04T14:31:18Z
Check Mesmeric Control (Anime)
Now this is how I play: