• Announcements

    • Ashal

      SITE MOVED - IN READ ONLY MODE   12/08/2015

      Please use http://www.loverslab.com moving forward. Site has been restored to a previous version, and this one placed into a read-only mode. This is available for a limited time so users may reference/copy content that has been lost in the transition. This will no longer be accessible by December 22nd, 2015.

rmatthews

Members
  • Content count

    4
  • Joined

  • Last visited

Posts posted by rmatthews


  1. If you can stand using arrays, you can use GetRefs and cut down that script snippet down to almost nothing in terms of size because you're not using the old ref walking functions, not worry about the apple bug etc (whatever it was, I forgot), and avoid inherent flaws with the label/goto loops in the first place. There has to be something in your structure, the timing of things, that prevents your loop from returning a proper value. Getting rid of the loop entirely is imo the best option. For a loot-related mod, it's probably also worth pointing out that nvse has inventory ref functions and you can walk the contents of any container using a foreach loop too.

     

      The scripts works a good percentage of the time.   The problem arises when an NPC enters the cell and is killed in that cell.   I am wondering if this is a bug with the old method of walking the references within a cell.    

    0

  2. The  GetTYpe is only called once in the script


     


    Here is the snippet of the script


    int  i_totalCount


    int  i_index


     


    ref r_currentREF


     


    set i_totalCount to GetNumRefs


    set r_currentREF to GetFirstRef


     


    Label 1


    if i_index < i_totalCount

       set i_type to GetType r_currentREF

       if i_type == 42 ; NPC


          printC "NPC found: (%n %i)"  r_currentREF r_currentREF


       endif


     

       set r_currentREF to Pencil01 ; Apple Bug 

       set r_currentREF to GetNextRef

       set i_index to i_index + 1

       goto 1

    endif

     

     


    0

  3. I am working on a loot mod and I have an issue with GetType equal 0 appearing.      This condition only happens after a combat in the area where the NPC drop their weapon.   Until I manually loot the corpse the mod only returns all references as type 0.   Does anyone know how to get around this problem.


     


     


    0