Author Topic: Multiple summons appear on one another  (Read 437 times)

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons appear on one another
« on: January 04, 2014, 10:58:09 pm »


                That's not really much of a problem, but it is something I'd gladly get rid off.

When several creatures are summoned at once (with a unique power script), they all appear in the exactly same spot. You can "push them" to make them scatter, or they will just do so themselves if you move and they follow you, but still, it looks weird.

Is there any easy way to get rid of this?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #1 on: January 04, 2014, 11:29:11 pm »


               not really with keeping the exact functionality, except the move workaround you could workaround summons completely via henchmens, but thats imo another story...

EDIT: 'Posted
one for me one for LightFoot
               
               

               


                     Modifié par ShaDoOoW, 06 janvier 2014 - 01:15 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #2 on: January 04, 2014, 11:31:53 pm »


               Change the unique power script to stagger the spot where it summons each one.  any preference to how you would want them spaced?   Random? Formation?   working in a circle for the original?
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #3 on: January 04, 2014, 11:33:58 pm »


               No matter, they can be scattered randomly.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #4 on: January 04, 2014, 11:35:19 pm »


               

ShaDoOoW wrote...

not really with keeping the exact functionality, except the move workaround you could workaround summons completely via henchmens, but thats imo another story...


perhaps I missed something?   I may need to see the Activate  script before I give the answer above. 
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #5 on: January 05, 2014, 12:31:42 am »


               


void OnActivate(object oEventItem, object oActTarget, location lActTarget, object oActivator)

{

    effect eEffect;

    object oPC = oActivator;



        eEffect = EffectSummonCreature("na_skeleton_s", VFX_IMP_UNSUMMON, 1.0);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oActivator, 300.0);



        eEffect = EffectSummonCreature("na_skeleton2_s", VFX_IMP_UNSUMMON, 1.0);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oActivator, 300.0);



        eEffect = EffectSummonCreature("na_zombie_s", VFX_IMP_UNSUMMON, 1.0);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oActivator, 300.0);



        eEffect = EffectSummonCreature("na_zombie2_s", VFX_IMP_UNSUMMON, 1.0);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oActivator, 300.0);



        eEffect = EffectSummonCreature("na_skeleton_s", VFX_IMP_UNSUMMON, 1.0);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oActivator, 300.0);



        eEffect = EffectSummonCreature("na_skeleton_s", VFX_IMP_UNSUMMON, 1.0);

        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oActivator, 300.0);

    }


               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #6 on: January 05, 2014, 12:33:21 am »


               While we're at it, it's weird, but for some reason when I had only 5 summons (that's what I intended to have) in the script, only four were summoned in-game, the last one was omitted.
To have all 5, I needed to copy the last part and paste it, so that it's in fact 6 now in the script and 5 in-game.

(Also, the above is not the whole script, as you can see, because I have a single script for all unique power purposes)
               
               

               


                     Modifié par Grani, 05 janvier 2014 - 12:36 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #7 on: January 05, 2014, 04:21:18 pm »


               I have struck out on finding a simple way of doing this.    Most of the way I have ran through my mind would introduce other abnormality that would require other events to smooth out.   In short the is no simple way to do it.  

The reason you have to summons an extra creature is that nwn by design only allows one summonsed creature.    When a second summons is created, the first summonsed creature is destroyed.   The nwn engine created creatures during the script and destroys creatures after the script is finished running.    Therefore when your second,third,fourth..... creatures are summonsed they are all sending a single to destroy the first creature,  hence you have more then one summons through a loop hole in the engine.

This is also why it is harder to find a solution to your problem of them being summonsed on top of each other.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #8 on: January 05, 2014, 05:28:17 pm »


               Could you use random vectors from the original target then get a location for each summons from the vector?
               
               

               


                     Modifié par Pstemarie, 05 janvier 2014 - 05:29 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #9 on: January 05, 2014, 05:48:12 pm »


               As far as summonsing at random vectors, no.   the summons is an effect applied to the PC,  Therefore there is no location to adjust.  


First problem.  without making the summons undestroyable ,the summoning has to be back to back,  If not you are left with only one summons.  the others are destroyed.

Second the Apply effect function is void returning,  even if it wasn't  it still would not return the creature summonsed,  creating the need  for another method of finding the creature to adjust its position.  

Problem 3.   The summons  may not be the only Hench/Comp/summons the PC has.  causing problems with just shouting  a generic command to the summons to addjust there position.  
ex. If I Gave a generic Follow me Command at the end of the script to get the Sommons to adjust there own positions.  The hench who was in combat would stop fighting and run back every time the object was used.
               
               

               


                     Modifié par Lightfoot8, 05 janvier 2014 - 05:49 .
                     
                  


            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #10 on: January 05, 2014, 09:17:55 pm »


               Ah, well, I see that even if it's possible, it's hell of a work. Not worth the trouble, I think, considering that it doesn't affect gameplay in any way. '<img'>
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #11 on: January 05, 2014, 10:25:59 pm »


               Maybe I'm wildly missing something, but the default summon creature series has the following code:

ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));

Why couldn't you create randomized spawn points using vectors using GetSpellTargetLocation as a starting point and then using that new location instead of GetSpellTargetLocation?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #12 on: January 05, 2014, 11:10:12 pm »


               

MagicalMaster wrote...

Maybe I'm wildly missing something, but the default summon creature series has the following code:

ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));

Why couldn't you create randomized spawn points using vectors using GetSpellTargetLocation as a starting point and then using that new location instead of GetSpellTargetLocation?


ok,  perhaps you are one of the only two sane  people left in the thread,   In that case it should be as simple as I originally thought.   Once I get past the asumptions i made after looking at the posted code.   


Let me work up some code.  
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple summons appear on one another
« Reply #13 on: January 06, 2014, 12:04:43 am »


                ok, try this.


const float cDist = 5.0;
const int cNumbersumm = 5;
 void OnActivate(object oEventItem, object oActTarget, location lActTarget, object oActivator)
{
effect eEffect;
vector vAdj;
object oArea = GetAreaFromLocation(lActTarget);
vector vPos = GetPositionFromLocation(lActTarget);
float fOrt = GetFacingFromLocation(lActTarget);
location lLoc;
float nDegAdj = 360.0/cNumbersumm;


eEffect = EffectSummonCreature("na_skeleton_s", VFX_IMP_UNSUMMON, 1.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lActTarget, 300.0);


lLoc = Location( oArea, vPos + AngleToVector( nDegAdj*1)*cDist,fOrt);
eEffect = EffectSummonCreature("na_skeleton2_s", VFX_IMP_UNSUMMON, 1.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lLoc, 300.0);


lLoc = Location( oArea, vPos + AngleToVector( nDegAdj*2)*cDist,fOrt);
eEffect = EffectSummonCreature("na_zombie_s", VFX_IMP_UNSUMMON, 1.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lLoc, 300.0);


lLoc = Location( oArea, vPos + AngleToVector( nDegAdj*3)*cDist,fOrt);
eEffect = EffectSummonCreature("na_zombie2_s", VFX_IMP_UNSUMMON, 1.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lLoc, 300.0);


lLoc = Location( oArea, vPos + AngleToVector( nDegAdj*4)*cDist,fOrt);
eEffect = EffectSummonCreature("na_skeleton_s", VFX_IMP_UNSUMMON, 1.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lLoc, 300.0);


lLoc = Location( oArea, vPos + AngleToVector( nDegAdj*5)*cDist,fOrt);
eEffect = EffectSummonCreature("na_skeleton_s", VFX_IMP_UNSUMMON, 1.0);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lLoc, 300.0);
}