| | each monster you control gain this effect | |
| Author | Message |
---|
HurahItsHerald
Member Title : HeraldIsHereHoney Posts : 15 Join date : 2015-08-25
| Subject: each monster you control gain this effect Wed 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 |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: each monster you control gain this effect Wed 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. |
| | | HurahItsHerald
Member Title : HeraldIsHereHoney Posts : 15 Join date : 2015-08-25
| Subject: Re: each monster you control gain this effect Thu 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 |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: each monster you control gain this effect Thu 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. |
| | | HurahItsHerald
Member Title : HeraldIsHereHoney Posts : 15 Join date : 2015-08-25
| Subject: Re: each monster you control gain this effect Fri 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 |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: each monster you control gain this effect Sat 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? |
| | | HurahItsHerald
Member Title : HeraldIsHereHoney Posts : 15 Join date : 2015-08-25
| Subject: Re: each monster you control gain this effect Sat 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 |
| | | TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: each monster you control gain this effect Sun 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. |
| | | Sponsored content
| Subject: Re: each monster you control gain this effect | |
| |
| | | | each monster you control gain this effect | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests None Most users ever online was 270 on Sun Apr 11, 2021 4:35 pm |
Latest topics | » Goodbye allMon Aug 08, 2016 7:53 pm by Zenas» [PLEASE READ] [VERY IMPORTANT] MACKPRO REVIVALMon Aug 08, 2016 7:47 pm by Zenas» D.D. Dragons vs KozmosSun Jul 10, 2016 11:02 pm by cane_63106» Where's everyone?!Sat May 28, 2016 2:58 am by cane_63106» Mech Archetype (crappy it be, maybe you guys would like it)Sun May 15, 2016 1:11 pm by barti02» My Assassin ArchetypeSun May 15, 2016 1:10 pm by barti02» SO I have a "NEW ARCHETYPE THE "WolfPack"Sun May 15, 2016 12:35 pm by barti02» Fusion monster doesn't appear in extra deck? Sat Apr 30, 2016 9:02 pm by Marc1» Mackpro update 10/6/2015Sat Apr 02, 2016 6:36 pm by Hulkty» Bionicle Cards AKA Japanese Children's Cardgames on Swedish Toy RobotsSun Mar 06, 2016 9:37 am by Utso |
|