Is it possible to make items lying outside of containers res

Post » Fri May 04, 2012 5:07 am

One of my biggest gripes with Oblivion and the two Fallouts after it is that once you grabbed an item outside in the world it's gone for good no matter what you do. Skyrim however has them actually respawn and that made me think, would it be possible to do this in Fallout as well?

Is there any possible script you can give an item to cause it to reenable itself after activation after a certain amount of in game time passes? From the looks of it, if you knock over an item after a certain amount of time has passed it will place itself back to its original spot, but if you take it, it stays gone. I'm wondering if there's a way to change that.

Another question I have is, is it possible to make a timer that responds on in game time? All I've seen are ones that respond on real time.

Thank you in advance for any help.

EDIT: Alright so, as of this far I've somewhat have been able to replicate this concept using this script I made.

SCN PanRespawnfloat ftimerint isactivatedshort DoOncebegin onactivateif isactivated == 0set isactivated to 1endifendbegin gamemodeif isactivated == 1  if DoOnce == 0   player.additem PanCookingMetal 1   disable   set DoOnce to 1  endif	 if ( ftimer <= 5 )		   set ftimer to ftimer + getSecondsPassed	  else															     enable   set isactivated to 0   set DoOnce to 0   set ftimer to 0	 endifendifend

Is there a way to add this onto ammo as well and possibly replace the timer with one based on in game time?
User avatar
Laura Tempel
 
Posts: 3484
Joined: Wed Oct 04, 2006 4:53 pm

Post » Fri May 04, 2012 4:43 pm

why not just abuse a creature spawn tier?

edit: a different approach: create a scripted activator (could be an x-marker, but they can't be scripted), place it where you want to spawn your items and, in it's script, just let it PlaceAtMe your item whenever a timer exceeds whatever period you want.
you can also make the activator big enough so the spawned object stays within it's bounds to check if there's still an item left from your last spawn cycle, so it won't get cluttered. or you can check if player or another instance of your spawn-item is GetInSameCell or whatever.
i've used something quite similar for non-inventory-spawns in my http://modsreloaded.com/chengs-eastside-laundry mod for the washo dispenser's detergent output, if you want you can look it up and/or reuse that parts of the script
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Fri May 04, 2012 1:41 am

Yes, you can use gamehour instead of a custom timer.
Your script should work with very minimal changes, you just need to replace the doonce with a respawnhour== gamehour
and then check if gamehour is > to respawnhour+1 then re-enable the item. Of course it will not be 5 seconds real time, it will depend of the timescale settings.
If you want a respawning ammo you could also create a container using the ammo box model, so you only need a script if you want it to respawn more often than the normal 72 hours.

(sorry for my english)

so7 : just a question : why did you use PlaceAtMe BoxDetergent 1 rather than player additem boxdetergent 1 ? The pay-to get the stuff is good but do NPC really use it (drink dispenser and all) ?
User avatar
Christine Pane
 
Posts: 3306
Joined: Mon Apr 23, 2007 2:14 am

Post » Fri May 04, 2012 2:44 pm

(sorry for my english)
so7 : just a question : why did you use PlaceAtMe BoxDetergent 1 rather than player additem boxdetergent 1 ? The pay-to get the stuff is good but do NPC really use it (drink dispenser and all) ?
1) because i wanted the boxes to actually drop out of the dispenser, visibly in the gameworld i mean.
2) they do use the drink dispenser, yes, and they do use the washing machines. theoretically, they should also use the dispenser, but i haven't seen any actually doing it while testing - but anyhow, it just wouldn't have made any difference scripting it (except one if ( WashoUser.GetIsReference player == 1 ) ) (it did on the washing machines though, this was a tough one for npc's)
3) pleease, the name is 's7o' (pronounce: 'slow'), not 'so7' - gotta insist on this, had to fight hard for my name on the nexus (and lost) ;-)
4) never mind your english, no native speaker myself and wrote (not to mention read) far worse than you (= allright anyway) and still got understood :-)

and thx 4 obviously downloading my mod, guess i came out a bit late with that :-)
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am


Return to Fallout: New Vegas

cron