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
 

 each monster you control gain this effect

View previous topic View next topic Go down 
AuthorMessage
HurahItsHerald




Member Title : HeraldIsHereHoney
Posts : 15
Join date : 2015-08-25

each monster you control gain this effect Empty
PostSubject: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeWed Sep 16, 2015 1:30 pm

this is a hard one , so if ur up for the challenge read ahead

the monsters are called "survivors", and they each have the effect of "all survivor monsters in your hand or your side of the field gain the following effect."

i got it right, except the other survivors don't get the shared effect

1 monster: Smash Horn Q
All survivor monsters in your hand or your side of the field gain the following effect.
● This card gains 1000 ATK and DEF.

Heres its script:

--effect gain
    local e13=Effect.CreateEffect(c)
    e13:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
    e13:SetCode(EVENT_SPSUMMON_SUCCESS)
    e13:SetRange(LOCATION_MZONE)
    e13:SetTargetRange(LOCATION_MZONE+LOCATION_HAND,0)
    e13:SetOperation(c75016.gete)
    c:RegisterEffect(e13)

function c75016.gfilter(c)
    return c:IsFaceup() and c:IsSetCard(0x790d)
end
function c75016.gete(e,tp,eg,ep,ev,re,r,rp)
    local c=e:GetHandler()
    local g=Duel.GetMatchingGroup(c75016.gfilter,tp,LOCATION_MZONE,0,c)
    --atk up & def up
    local e1=Effect.CreateEffect(c)
    e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
    e1:SetType(EFFECT_TYPE_SINGLE)
    e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
    e1:SetRange(LOCATION_MZONE)
    e1:SetCode(EFFECT_UPDATE_ATTACK)
    e1:SetReset(RESET_EVENT+0x1ff0000)
    e1:SetValue(1000)
    c:RegisterEffect(e1)
    e2=e1:Clone()
    e2:SetCode(EFFECT_UPDATE_DEFENCE)
    c:RegisterEffect(e2)
end

it gains 1000 ATK and DEF , but my other "survivors" dont get the boost , i dont know why
what's wrong with that script ? can u spot the error ?

thanks in advance , its a booty man
Back to top Go down
TGAP-Trixie

TGAP-Trixie


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeWed Sep 16, 2015 10:57 pm

The only reason you'd need to add ATK and/or DEF to a monster in your hand is for something that says something like "discard a monster in your hand with 3000 DEF or more" or something. Well as long as there are no error messages and the game reflects that your monsters have the extra ATK and DEF I'd say it's fine but if you do get errors, remove that :S.

If you want me to spot the error(s), it's the setcode. If you're getting that effect only after something has been successfully special summoned, then it's working right. You're also using local c=e:GetHandler() in the gete function, that makes it so all those cs in your code now affect just the card where the effect is coming from (itself) and not the cards you specified in the filter. And I believe in the gete function, you'd set the targetrange there but I could be wrong. It could also be the matchinggroup line, you only put MZONE there.
Back to top Go down
HurahItsHerald




Member Title : HeraldIsHereHoney
Posts : 15
Join date : 2015-08-25

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeThu Sep 17, 2015 1:49 am

I have no idea what you just said, but could you just correct my "c75016.gete" function to where my other monsters will also get its ATK n DEF boost and not just itself?

e13:SetCode(EVENT_SPSUMMON_SUCCESS)
the code might be wrong , it should be something like "while this card is face-up on the field" , since its continuous, so ill try to remove it and see what happens


Code:
e13:SetTargetRange(LOCATION_MZONE+LOCATION_HAND,0)

might be wrong before the 0, but the survivors in my hand must also get the survivors monsters' on the fields' effects, because some survivors get their effects when they're summoned and are not just continuous effects , for example:
All survivor monsters in your hand or your side of the field gain the following effect.
●If this card is Special Summoned: Add 1 "Survivor" monster from your Deck to your hand.


if "LOCATION_HAND" is omitted in such a case, i wont be able to search with that survivor, because it doesnt have the inherent effect to search


Code:
c75016.gfilter,tp,LOCATION_MZONE,0


"LOCATION_MZONE" -- my side of the monster zone
maybe i need to add "LOCATION_HAND" here as well?
"0" -- my opponents zone not affected , ie. their survivors not affected

The "targetrange" is in the right spot because it specifies where the effect will go, which areas the continuous effect is applied, "target" is where the continuous effect came from, in what area the effect starts from
i see it like this : target (start) -> targetrange (finish line)

"0x790d" -- survivor
Back to top Go down
TGAP-Trixie

TGAP-Trixie


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeThu Sep 17, 2015 11:51 pm

HurahItsHerald wrote:
I have no idea what you just said, but could you just correct my "c75016.gete" function to where my other monsters will also get its ATK n DEF boost and not just itself?

e13:SetCode(EVENT_SPSUMMON_SUCCESS)
the code might be wrong , it should be something like "while this card is face-up on the field" , since its continuous, so ill try to remove it and see what happens


Code:
e13:SetTargetRange(LOCATION_MZONE+LOCATION_HAND,0)

might be wrong before the 0, but the survivors in my hand must also get the survivors monsters' on the fields' effects, because some survivors get their effects when they're summoned and are not just continuous effects , for example:
All survivor monsters in your hand or your side of the field gain the following effect.
●If this card is Special Summoned: Add 1 "Survivor" monster from your Deck to your hand.


if "LOCATION_HAND" is omitted in such a case, i wont be able to search with that survivor, because it doesnt have the inherent effect to search


Code:
c75016.gfilter,tp,LOCATION_MZONE,0


"LOCATION_MZONE" -- my side of the monster zone
maybe i need to add "LOCATION_HAND" here as well?
"0" -- my opponents zone not affected , ie. their survivors not affected

The "targetrange" is in the right spot because it specifies where the effect will go, which areas the continuous effect is applied, "target" is where the continuous effect came from, in what area the effect starts from
i see it like this : target (start) -> targetrange (finish line)

"0x790d" -- survivor

--effect gain
    local e13=Effect.CreateEffect(c)
   e13:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
    e13:SetRange(LOCATION_MZONE)
    e13:SetTargetRange(LOCATION_MZONE+LOCATION_HAND,0)
    e13:SetOperation(c75016.gete)
    c:RegisterEffect(e13)

function c75016.gfilter(c)
    return c:IsFaceup() or c:IsLocation(LOCATION_HAND) and c:IsSetCard(0x790d)
end
function c75016.gete(e,tp,eg,ep,ev,re,r,rp)
    local g=Duel.GetMatchingGroup(c75016.gfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,c)
    --atk up & def up
    local e1=Effect.CreateEffect(c)
  e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
    e1:SetType(EFFECT_TYPE_SINGLE)
    e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)

    e1:SetRange(LOCATION_MZONE)
    e1:SetCode(EFFECT_UPDATE_ATTACK)
    e1:SetReset(RESET_EVENT+0x1ff0000)
    e1:SetValue(1000)
    c:RegisterEffect(e1)
    e2=e1:Clone()
    e2:SetCode(EFFECT_UPDATE_DEFENCE)
    c:RegisterEffect(e2)
end

Check the text in the red font, you're gonna have to play around with that. Single range is causing it to only affect itself, but I'm not sure how to tell it to affect cards in your hand. And effect_type_single you can try continuous or field or both.

... But I don't think this will fix much. I've never scripted anything like this because I imagine it could crash the application at one point.
Back to top Go down
HurahItsHerald




Member Title : HeraldIsHereHoney
Posts : 15
Join date : 2015-08-25

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeFri Sep 18, 2015 1:23 am

i changed them around a bit , and EFFECT_TYPE_CONTINUOUS and EFFECT_TYPE_FIELD causes it to not receive the boost , probably because it clashes with the initial function's EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS

FLAG_SINGLE_RANGE is correct because the effect says "This [singular] card gains" and thanks to EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS in the initual function, it should affect my other survivors, but it doesn't, I tried removing EFFECT_TYPE_SINGLE there and adding EFFECT_TYPE_FIELD, too but no luck

I think the problem lies with the gete function
Back to top Go down
TGAP-Trixie

TGAP-Trixie


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeSat Sep 19, 2015 12:36 am

HurahItsHerald wrote:
FLAG_SINGLE_RANGE is correct because the effect says "This [singular] card gains" 

HurahItsHerald wrote:
Smash Horn Q
All survivor monsters in your hand or your side of the field gain the following effect.
● This card gains 1000 ATK and DEF.

... What?
Back to top Go down
HurahItsHerald




Member Title : HeraldIsHereHoney
Posts : 15
Join date : 2015-08-25

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeSat Sep 19, 2015 1:10 pm

FLAG_SINGLE_RANGE is correct because the effect says "This [singular] card gains"


This card gains 1000 ATK and DEF.

it doesnt seem like you're able to help me, I'll ask some one else who can, thanks for trying
Back to top Go down
TGAP-Trixie

TGAP-Trixie


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitimeSun Sep 20, 2015 6:30 am

Realistically it's not easy nor practical, so excuse me for not understanding. I was saying single range affects that single monster from which the effect is stemming from so smash horn Q is just giving that effect to itself. But no I see what you're saying. If they all gained that effect, then it would stack exponentially, which is what I THOUGHT you were going for.


I've never actually seen effect gain on a continuous effect so I'm not even sure everything else is right so far. You could try to test if it'll get the effect on a summon. But the single range in the red font there I'm pretty sure is wrong, you could try continuous. If that doesn't work, take off continuous from the initial function.
Back to top Go down
Sponsored content





each monster you control gain this effect Empty
PostSubject: Re: each monster you control gain this effect   each monster you control gain this effect Icon_minitime

Back to top Go down
 

each monster you control gain this effect

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

 Similar topics

-
» Gain ATK equal to highest monster - Resolved
» Magical Hats (Anime) Effect + Dark Sage (Anime) Effect [Help Please]
» Who'd help code for MackPro if it was maintained in some kind of source control?
» Prevent counters on a monster
» Gemini monster help

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Requests-