how would YOU catch summon creatures other than the way I tr

Post » Mon Dec 05, 2011 10:33 pm

The following will not work because there is an issue with the Getsoundplaying command where the sound is still reported as detected long after it is not heard by the player. This only resets after you leave the cell. Meaning the getsoundplaying returns 0 only when you leave and return to the cell. This is only an issue with SOME sounds not all sounds or rather only if you check using the fuzzy logic. I think it has to do with the fuzzy logic not being cleared as any sound that is detected without the distance check seems not to have this issue.

Anyway this is a known issue with the getsoundplaying command (I have already reported this to the OBSE team) but my question is how would YOU catch summon creatures other than the way I tried to do it?


Quest script run every frame:

;;;;;;;;;;;;;;;;;;;;       catch summon creaturesif ( player.getsoundplaying "SPLConjurationCast" 12000 ) > 0 && summonswitch == 0set SummonSwitch to 1endifif Summonswitch > 0 && player.issneaking == 1message"still heard";--- used for testing onlyendifif ( player.getsoundplaying "SPLConjurationCast" 12000 ) == 0 && summonswitch == 1set SummonSwitch to 0set NextNPC to GetFirstRef 69  while ( NextNPC )    if NextNPC.GetIsReference Player != 1 && NextNPC.getdead == 0 && NextNPC.getdisabled == 0      if NextNpc.getitemcount aadpOSMeleeEffectToken == 0        NextNpc.additem aadpOSMeleeEffectToken 1         messagebox"summon worked"      endif   endif   set NextNPC to getNextRef loopendif

User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Tue Dec 06, 2011 3:12 am

Maybe I can keep a running count of the sounds in the cell. Then if the count goes up I trigger the script.... mmmmm...yes... that might work...

Edit: nope, something is very screwy with this command or the way I am using it, I give up on this soft tactic, I will try a more brute force idea...
User avatar
katsomaya Sanchez
 
Posts: 3368
Joined: Tue Jun 13, 2006 5:03 am

Post » Tue Dec 06, 2011 1:34 am

I am really out of my element on array scripts, this is the 3rd time I have tried to make my own array type script. My 2nd attempt (for another project) did work...but this 3rd time where I thought this should be easy now is CTD. Anyone see any reason for this script to CTD?
Part of my struggle is I still do not understand what the heck is going on with the commands "ForEach Entry <- Adjusted Spells" and "Let SpellRef := Entry["value"]" as that part of the script was written for me and I have no freaking idea what they are doing with the array.

My best guess is that

"ForEach Entry <- Adjusted Spells" means " with each of the spells in the array"

"Let SpellRef := Entry["value"]" means " set SpellRef to ????? something something ????"



ScriptName aadpStartUpQuestarray_var AdjustedSpellsarray_var Entryshort castswitchshort countref SpellRefref spellref2ref NextNPClong effectcodefloat damagebegin gamemodeif player.isincombat == 0 && Castswitch == 1set castswitch to 0endifif player.isincombat == 1 && CastSwitch == 0set NextNPC to GetFirstRef 69 1set castswitch to 1  while ( NextNPC )      if NextNPC.GetIsReference Player != 1 && NextNPC.getdead == 0      let AdjustedSpells := NextNPC.GetCombatSpells         if eval (ar_Size AdjustedSpells) > 0             	ForEach Entry <- AdjustedSpells                  Let SpellRef := Entry["value"]                           if CompareName "summon" SpellRef == 1 && CompareName "{}" SpellRef == 0                               set SpellRef2 to aadpSumDetector                               CopyAllEffectItems spellref2 spellRef                               AppendToName " {}" spellRef                           endif                loop         endif      endif   set NextNPC to GetnextRef   loopendifend

User avatar
Kevin Jay
 
Posts: 3431
Joined: Sun Apr 29, 2007 4:29 am

Post » Mon Dec 05, 2011 9:11 pm

YESSSSSSSSSSSSSSSSSSSSSSSSSSSS!!!!! YESSS YES YES YESSSSSS!!!!!! HA !

I BEAT THE CS AGAIN!!!!!

:woot:

These are the days I feel like a clever little modder!
This works extremely well! AND is is lightweight, only a few lines of code...hot dam....


set actorcount to OSNPCUser.GetNumDetectedActors
if actorcount != Actorcountold
messagebox"new guy"
set Actorcountold to actorcount
endif


I will add some more checks to it so that it only triggers when a it is likely that a summon spell was cast but even in this basic form it will do the job I need better than any other method to date (at least in my search of the forums on this subject, seems per my search that this is not something anyone else has worked on.)

I guess any moderator that see this thread can lock it now.
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Post » Tue Dec 06, 2011 1:39 pm

OP requested close.
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am


Return to IV - Oblivion