Jump to content

[WIP] Explosives Immunity Bug Fix - Input Needed


deathblz

Recommended Posts

Having to add the 1st script to all creatures makes it a very unattractive option. You can save some variables and processing in the second, and you could run it only on cell changes to save processing:

  if parentcell == PlayerRef.GetParentCell
    Return
  endif

  let parentcell := PlayerRef.GetParentCell

  ForEach Creatures1 <- GetRefs 43, -1
    let RefID := *Creatures1
    if RefID.GetDead == 0    ;you could add more checks here perhaps
        RefID.SetDestroyed 0
    endif
  loop

  ForEach Creatures2 <- GetRefs 44, -1
    let RefID := *Creatures2
    RefID.SetDestroyed 0
  loop
Would the second part be necessary too? Are leveled creature references even possible to set destroyed, and even if they are, does it mean what they spawn is also destroyed? Also, wouldn't this engine bug mean that some creatures the player kills by any means are unlootable after death? I don't recall seeing any such corpses, but then I don't recall experiencing this bug at all.

Another problem could be that a creature reference could have been destroyed by a script for some other reason, but other than preventing the player to interact with it I don't know what further complications it could cause.

Link to comment
Share on other sites

Having to add the 1st script to all creatures makes it a very unattractive option. You can save some variables and processing in the second, and you could run it only on cell changes to save processing:

  if parentcell == PlayerRef.GetParentCell
    Return
  endif

  let parentcell := PlayerRef.GetParentCell

  ForEach Creatures1 <- GetRefs 43, -1
    let RefID := *Creatures1
    if RefID.GetDead == 0    ;you could add more checks here perhaps
        RefID.SetDestroyed 0
    endif
  loop

  ForEach Creatures2 <- GetRefs 44, -1
    let RefID := *Creatures2
    RefID.SetDestroyed 0
  loop
Would the second part be necessary too? Are leveled creature references even possible to set destroyed, and even if they are, does it mean what they spawn is also destroyed? Also, wouldn't this engine bug mean that some creatures the player kills by any means are unlootable after death? I don't recall seeing any such corpses, but then I don't recall experiencing this bug at all.

Another problem could be that a creature reference could have been destroyed by a script for some other reason, but other than preventing the player to interact with it I don't know what further complications it could cause.

 

I've not seen it past death but it sure as heck sets living creatures to TGM LOL It takes alot of hits or a few vasts hits or melee hits or shooting it to damage the darn thing...

Link to comment
Share on other sites

Having to add the 1st script to all creatures makes it a very unattractive option. You can save some variables and processing in the second, and you could run it only on cell changes to save processing:

  if parentcell == PlayerRef.GetParentCell
    Return
  endif

  let parentcell := PlayerRef.GetParentCell

  ForEach Creatures1 <- GetRefs 43, -1
    let RefID := *Creatures1
    if RefID.GetDead == 0    ;you could add more checks here perhaps
        RefID.SetDestroyed 0
    endif
  loop

  ForEach Creatures2 <- GetRefs 44, -1
    let RefID := *Creatures2
    RefID.SetDestroyed 0
  loop
Would the second part be necessary too? Are leveled creature references even possible to set destroyed, and even if they are, does it mean what they spawn is also destroyed? Also, wouldn't this engine bug mean that some creatures the player kills by any means are unlootable after death? I don't recall seeing any such corpses, but then I don't recall experiencing this bug at all.

Another problem could be that a creature reference could have been destroyed by a script for some other reason, but other than preventing the player to interact with it I don't know what further complications it could cause.

 

 

 

I agree about the first one. It was pretty much the nuclear option for me. Technically works, but it would probably be incompatible with creature mods. As for the second, I don't know how I missed GetParentCell and GetParentWorldspace. They might be just what I was looking for.

 

Though the Destroyed flag is supposed to prevent interaction, you can still loot destroyed creatures. When you target them, the search prompt doesn't appear (just the name), but you can still loot. I checked all of the creature scripts, and don't remember seeing any that set one to disabled. Some specific creatures and NPCs are set to unconscious or disabled after certain events (for example, the NCR deserters in Primm are disabled if you convince them to run), but not destroyed.

 

I originally put the leveled creatures part in the code just to cover all the bases, but I think that part could be removed. I would have to think about which checks to use. I'm not sure what's causing the bug in the first place, so I don't want to add a check that makes the script miss creatures.

 

And just to clarify, all the Destroyed flag does is prevent the player from interacting with something. Even if a creature was supposed to be destroyed and my script changed that, I think at worst you'd just get an empty corpse. I'll have a look through some quest scripts to see if this could ever be a problem, but I doubt it will be. FNV tends to use the Essential, Quest, Ghost and Unconscious flags when it wants a creature to be in the world, but immune or non-interactive. Maybe I can think of a way to check for something along those lines.

 

Thanks for the tip. If those functions work like they hope I do, I might be able to make this much cleaner.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...