Author Topic: Multiple Summoned Creatures?  (Read 600 times)

Legacy_Forever Sunrise

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Multiple Summoned Creatures?
« on: March 15, 2015, 08:52:52 pm »


               

Over the years, I've seen several servers implementing systems which allow players to have more than one summoned monster active at a time. However, these have all been unique to the modules in question; I've never encountered any community content that enables them. I'd like to know if anybody out there has ever done a system that allows a caster to cast and control more than one summoned monster at a time, and if they wouldn't mind working with me to adapt that system to a module that I'm currently working on.


 


In addition to this, I'm also looking for any systems that allow a caster to choose between a variety of summoned monsters instead of the same one each time. I've seen this as well, either as an option in rest menus or set by the unique powers of certain inventory items. Can I get the details on how this was done?


 


Please note: this is all for NwN1.



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #1 on: March 16, 2015, 06:05:04 pm »


               

Here's a link that allows Animate Dead to create multiple Skeletons and could be a good starting place: http://neverwinterva...-dead-spell-fix


 


Generally, multiple summons are handled either by adding them as a henchman instead, or creating the creatures and applying a domination effect to them.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #2 on: March 16, 2015, 06:26:57 pm »


               


I'd like to know if anybody out there has ever done a system that allows a caster to cast and control more than one summoned monster at a time, and if they wouldn't mind working with me to adapt that system to a module that I'm currently working on.




 


What Kalbaern said.  You technically cannot have more than one summon but you can "fake it."


 



In addition to this, I'm also looking for any systems that allow a caster to choose between a variety of summoned monsters instead of the same one each time. I've seen this as well, either as an option in rest menus or set by the unique powers of certain inventory items. Can I get the details on how this was done?


 


Simple way would be to make an item the PC can't get rid of (cursed) and store information on that.  Let's say you want to let the user choose what type of elemental to summon.  Have 0 represent Air, 1 Earth, 2 Fire, 3 Water.  Can have the item have a unique power to start a conversation and then in the conversation give dialogue options for each type.  When the user selects a type, set a local integer based on their choice (for example, could have the int be called "summontype" and if they select Earth from dialogue then you set the value to 1).


 


Finally, when the user casts the summon spell check the int on the item and summon the appropriate type.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #3 on: March 16, 2015, 06:51:16 pm »


               


What Kalbaern said.  You technically cannot have more than one summon but you can "fake it."


 




 


You can if the multiple summons are created in the same script.


 


I usually go for summon armies.  Create one summon as the leader and then create a large number of summoned followers attached to the leader.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #4 on: March 16, 2015, 06:55:06 pm »


               

my community patch has a module switch enabling this, see here


also as a player all you need to do to enable this in any module using default spells is to spawn PC Widget tool and enable this option in conversation



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #5 on: March 16, 2015, 06:57:48 pm »


               

You can do it differently. You can have more than one summon. The engine destroys the previous one when the new one is applied. But if you make the existing ones temporarily undestroyable they will stick around past that time.  It seems to work pretty well for me. 


 


Edit: What Shadooow said...



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #6 on: March 16, 2015, 07:02:26 pm »


               


You can do it differently. You can have more than one summon. The engine destroys the previous one when the new one is applied. But if you make the existing ones temporarily undestroyable they will stick around past that time.  It seems to work pretty well for me. 


 


Edit: What Shadooow said...




yes, the only drawback of this method is that there is visible"unsummon" vfx when you summon new one, however if im not mistaken the summon of summon method will destroy all summons if the leader dies


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #7 on: March 16, 2015, 07:07:05 pm »


               


You can if the multiple summons are created in the same script.




 


Interesting.  Clearly it'd be nice to be able to summon them sequentially versus one mass summon, though.


 




But if you make the existing ones temporarily undestroyable they will stick around past that time.  It seems to work pretty well for me. 




 


Any weird side effects with the AI?


 




however if im not mistaken the summon of summon method will destroy all summons if the leader dies




 


That *should* be correct, yes.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #8 on: March 16, 2015, 08:00:37 pm »


               


Any weird side effects with the AI?




 


I haven't noticed anything.  The creature still has master set correctly and the same AI scripts. This is the same method Shadooow is talking about using in CPP, btw. 


               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #9 on: March 16, 2015, 08:32:36 pm »


               


I haven't noticed anything.  The creature still has master set correctly and the same AI scripts. This is the same method Shadooow is talking about using in CPP, btw. 




Do you have a code snippet to share? I'd like to do some experimenting as I have a few applications it could prove useful in.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #10 on: March 16, 2015, 09:02:13 pm »


               


Interesting.  Clearly it'd be nice to be able to summon them sequentially versus one mass summon, though.




 


undestroyable method allows that

 




Do you have a code snippet to share? I'd like to do some experimenting as I have a few applications it could prove useful in.




nw_ch_summon9:


 



 


    //1.71: multisummoning feature

    if(GetModuleSwitchValue("71_UNLIMITED_SUMMONING"))

    {

        int maxSummon = GetModuleSwitchValue("71_UNLIMITED_SUMMONING");

        int numSummon,nTh = 1;

        location lTarget = GetLocation(OBJECT_SELF);

        object oSummon, oPC = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,lTarget,nTh);

        while(GetIsObjectValid(oPC))

        {

            numSummon = 1;

            while(GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED,oPC,numSummon)))

            {

               numSummon++;

            }

            if(maxSummon == 1 || maxSummon >= numSummon)

            {

                oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED,oPC,1);

                AssignCommand(oSummon,SetIsDestroyable(FALSE,FALSE,FALSE));

                AssignCommand(oSummon,DelayCommand(0.01,SetIsDestroyable(TRUE,FALSE,FALSE)));

            }

            oPC = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,lTarget,++nTh);

        }

    }



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #11 on: March 16, 2015, 09:09:21 pm »


               

What shadooow said... again '<img'>


 


I do it the spell code right before applying the new summon effect to the caster. So the loop is a little different but the real code is the same. 



               
               

               
            

Legacy_Forever Sunrise

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #12 on: March 16, 2015, 11:45:58 pm »


               

I take it the SetIsDestroyable command doesn't make the creature invulnerable in the process? Sorry, I'm rather new at Nwscript.



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #13 on: March 17, 2015, 01:28:13 am »


               


I take it the SetIsDestroyable command doesn't make the creature invulnerable in the process? Sorry, I'm rather new at Nwscript.




The command that makes them un-destroyable is reset a hundredth of a second later to make them destroyable.


               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Multiple Summoned Creatures?
« Reply #14 on: March 17, 2015, 07:18:00 pm »


               

Just wanted to say thanks for the code Shadooow. I doubt I'll allow my players to have multiple summons, at least not soon and with out some balancing testing, but I'm playing around with some NPCs and this has fit the bill nicely. I now have as one of my lower level "Boss" NPCs, a Xvart Rat Master who can summon small swarms of annoying little beady eyed rodents.