Jump to content

How to make a script searching around for the dead bodyes


redgnom

Recommended Posts

I trying to make a Corpse Removal mod by myself.

To reduce the mountains of corpses after IWS and etc.

But i don't have any exp in writing scripts.(

 

I find the way, how to check corpse dead-time, and mark it to delete.

but don't know how to automaticly select a "dead" Actors in the area one after another, to check them out for delete.

 

Now all what I have is:

 

if target.IsActor
   if target.GetDead
       if target.GetTimeDead > 24
               Disable
               markForDelete
       endif
   endif
endif

 

but iduno how to get this "target". T____T

 

Please, Help.

Link to comment
Share on other sites

requires NVSE.

 

what your looking for is called refwalking and needs to be used with 200 (actors for refwalking)

 

couple of sources for you:

 

NVSE

 

GetFirstRef

 

GetNextRef

 

use those to grab your references, as i said before the "type" you need is 200 see the syntax for how to use.

 

and finally,

in the following spoiler i will provide an example script for you that has these functions being used and actuall doing something with the dead bodies (highlighting them black) so all you need to do is delete what you dont need and make changes to the function part for the dead actors.

 

 

  Reveal hidden contents

 

 

and 1 more VERY important thing

refwalking for me is notoriously buggy when not used in a quest script and controlled with startquest and stopquest

 

so i suggest using this in a quest script and setting up a quest to handle it.

 

 

if you still have any questions ill try to help

Link to comment
Share on other sites

I've used refwalking extensively in Sortomatic... and yes I did run into some bugs.

I spent about a day looking at my code looking for silly mistakes, and putting debugging statements in to see what was happening.

The ref's were getting walked, but the properties from the refs were 'stuck' on the first ref found.

 

The solution is simple, but I never would have guessed it. It's an old problem dubbed the 'apple bug'.

The only reference and fix/workaround for this I found on Cipscis' Loops page.

Link to comment
Share on other sites

  On 4/12/2011 at 5:14 AM, tunaisafish said:

I've used refwalking extensively in Sortomatic... and yes I did run into some bugs.

I spent about a day looking at my code looking for silly mistakes, and putting debugging statements in to see what was happening.

The ref's were getting walked, but the properties from the refs were 'stuck' on the first ref found.

 

The solution is simple, but I never would have guessed it. It's an old problem dubbed the 'apple bug'.

The only reference and fix/workaround for this I found on Cipscis' Loops page.

 

actually there is NO need for the apple.

 

that is ONLY if you are removing the forms from the formlist.

the script provided removes nothing but a 1 off the count variable... no bugs no need for apple.

 

when i was using refwalking in FO3 to move items from a container to the world this is a bug i saw because i actually DID remove the items themselves.

if you are working from a container for some reason or decide that the method using variables like in this script isn't for you, i can provide the answer to your problems.. but to be clear no apple is needed for the method i provided here.. as long as you dont actually remove the items from the list.

 

and because after your actors are disabled and markfordelete they will not show up in the count anymore so no room for game bloat.

Edited by angelwraith
Link to comment
Share on other sites

  On 4/11/2011 at 10:30 PM, angelwraith said:

and 1 more VERY important thing

refwalking for me is notoriously buggy when not used in a quest script and controlled with startquest and stopquest

 

Sorry, I should have quoted this part before when replying. For me, refwalking has worked like a breeze since I read what Cipscis calls the 'apple bug'. I've not had to resort to creating quests to manage that part at all.

I wasn't knocking your proposed solution to the OP's problem if that's what you thought

 

BTW, listclear is not yet implemented for NV.

 

You refer to the apple bug as being involved in formlists, yep I know there are some caveats there too.

For all I know one of those is refered to as the 'apple bug' too... before my time :)

Link to comment
Share on other sites

  On 4/11/2011 at 10:30 PM, angelwraith said:

requires NVSE.

 

what your looking for is called refwalking and needs to be used with 200 (actors for refwalking)

...

and finally,

in the following spoiler i will provide an example script for you that has these functions being used and actuall doing something with the dead bodies (highlighting them black) so all you need to do is delete what you dont need and make changes to the function part for the dead actors.

...

and 1 more VERY important thing

refwalking for me is notoriously buggy when not used in a quest script and controlled with startquest and stopquest

 

so i suggest using this in a quest script and setting up a quest to handle it.

 

if you still have any questions ill try to help

 

 

Thankyou very much.

I'll going to dig in it.)

 

I'm also not good with english, so it's be a very long day...)

Link to comment
Share on other sites

  On 4/12/2011 at 1:34 PM, tunaisafish said:
  On 4/11/2011 at 10:30 PM, angelwraith said:

and 1 more VERY important thing

refwalking for me is notoriously buggy when not used in a quest script and controlled with startquest and stopquest

 

Sorry, I should have quoted this part before when replying. For me, refwalking has worked like a breeze since I read what Cipscis calls the 'apple bug'. I've not had to resort to creating quests to manage that part at all.

I wasn't knocking your proposed solution to the OP's problem if that's what you thought

 

BTW, listclear is not yet implemented for NV.

 

You refer to the apple bug as being involved in formlists, yep I know there are some caveats there too.

For all I know one of those is refered to as the 'apple bug' too... before my time :)

 

 

oh gotcha see i misunderstood then

 

see the real reason i like using quest scripts when dealing with refwalking is stopquest

for some reason whenever i tried using refwalking with object quests there was issues with actually getting it to stop once its doing its thing

stopquest doesnt care if its in a loop.. it just stops it.

 

and yeah that script has actually been significantly revamped since that last post but for what was needed the old one i had on the laptop sufficed. Im sorry if i mislead you about listclear working.. here is the current script that addressed that problem:

 

 

  Reveal hidden contents

 

 

and this should work for what you need.

 

 

  Reveal hidden contents

 

 

make a new quest.

save it.

open the quest back up and in the script dropdown select the script above

priority 55

allow repeated stages

allow repeated conversation topics.

 

to start your remover use this in a script :

startquest yourquestnamehere

 

to stop it use :

stopquest yourquestnamehere

Edited by angelwraith
Link to comment
Share on other sites

  • 8 months later...
  • Recently Browsing   0 members

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