Jump to content

Linking respawns to objects, can it be done?


Hengebobs

Recommended Posts

As the title says, would it be possible to link the respawn 'ability' of NPCs and creatures to an object?

 

I mean only the 'respawn' not the NPC or creature itself so the 'linked reference' 'disabled/enabled' trick wouldn't work. My idea is this, could you link, through scripted or otherwise, respawning creatures NPCs to the appropriate world object (such as cazadors to the 'hornet's nest' thingy's or radscorpions to the 'holes in the ground' or the ants to the 'ant nests', mantis' to the cloithea [however its spelled], ect) thus you would be able to farm them as long as you don't destroy said world object (obviously destruction data would have to be added to the respective objects) but should you want to make an area 'safe' you would simply need to blow up that object. My point in specifiying the 'respawn ability' and not linking the creature/NPC itself would be so that blowing it wouldn't instantly kill/disable all those creatures in the area. So rushing past a bunch of cazadors and blowing their nest wouldn't magically save your a$$. I suck at scripting personally, and haven't wanted to screw with this on my own without any idea as to what path to take for fear of breaking something. Should one of you scripty types have any ideas where i should start though i'd gladly take a whack at this, as i believe it would add a great little bit of immersion, allowing the player to 'secure' an area once and for all. At least from a given type of threat. Any thoughts or hints about how i could go about this would be greatly appreciated.

 

NOTE: If this is in the wrong forum, please move it, but NO, this is not a mod request, as i will do it if someone can point me in the right direction. This is an attempt to pick the brains of the many talented modders here who are far better at scripting than I.

 

(yes, i searched for 'respawn' and 'linked object' in the forum, but they didn't seem to be anything like what i'm asking, so if this is redundant my apologies, my google-fu is weak).

Edited by Hengebobs
Link to comment
Share on other sites

Im not a scripter, but this could be done using the getactor or something like that I belive.

I dont think it would respawn the item, but rather put it in a certain location...... im not going to write fake script, but what I figure it might sound like. - geek face -

 

`if actorname is alive

then

run placeobjecthereSCRIPT

else

end,'

 

It really needs to be something simple like that, I know this worked in arma 2 ( diffrent scripting ) but the concept is the same.

 

A good coder is hard to come by =/ , sorry if this was not a helpful post.

Link to comment
Share on other sites

There are not many creatures in FNV that *respawn*. Most areas stay empty after you clean them out. Are there specific areas where you know there are respawns, that you want to change? If I understand correctly, you want the destruction of some object, to stop respawning. So if you destroy a nest, and kill the creatures coming from the nest, then no more new creatures will come from the nest.

 

Anyplace there is a respawn, it is done by some script. For example, I was recently looking at Bonnie Springs, north of Goodsprings, where some cazadors and nests appear after a few days when some condition is met. This is done by a script which "wakes up" every few days. You would need to (a) make a destructable object, (b) make sure the player knows it is destructible somehow, and then © edit the respawn script to check if this object exists. Steps (a,b) don't require any scripting, just item creation with some graphics. Step © requires adding one line to an existing script.

Edited by davidlallen
Link to comment
Share on other sites

Thank you for the responses, i've also gotten a few through another forum and am currently trying those out. If that fails i will attempt the path you have suggested davidlallen, as the creatures i had opened up to check were in interior cells, i had simply assumed those in exteriors would be set up in a similar fashion. Your summary of what i want to do is exactly correct, i wish to set up an object, we'll call it 'nest' and make its destruction prevent repopulation of a given area by a given creature type. The two script paths i am currently attempting were provided by Volek (username on another forum, unsure if he has the same screen name here). They are as follows:

 

scn whateveryourscriptiscalled

short NestDestroyed

Begin Gamemode
   If NestDestroyed == 1 && RespawningCreature.GetDead == 1
       RespawningCreature.disable
       RespawningCreature.markfordelete ; so it doesnt get saved in your savegame
   Endif
End

 

and the other method he proposed:

 

scn whateveryourscriptiscalled

short NestDestroyed
ref CreatureBase
ref CurrentBase
ref rCurrentRef

Begin GameMode

 if NestDestroyed == 1 ; fire script only when the nest is destroyed

   set rCurrentRef to GetFirstRef 43 1 0
; 43 means Creature, repleace w/ 44 if you use Leveled Creatures. 1 is the range in cells, last parameter i dont know O.o

   Label 10
   if rCurrentRef
       set CurrentBase to rCurrentRef.GetBaseObject ; get the base object of the creature that's currently handled by the script

       if rCurrentRef.GetDead && CurrentBase == NVCrCazador ; don't know if this works tho, might need to use the FormID instead of the Editor name
           rCurrentRef.disable
           rCurrentRef.markfordelete
       endif

       set rCurrentRef to Pencil01 ; Prevent apple bug, do not remove this line!
       set rCurrentRef to GetNextRef ; goes on to the next creature in the cell
       Goto 10
   endif

End

I am currently attempting to implement the mod concept using these script templates. If i am unsuccessful, or you see a problem with the script itself, or just think that there is a better way to do it, i would greatly appreciate feedback.

 

EDIT** After looking back through your proposed method... i'm thinking it would be a heck of a lot easier. Possibly even less work intensive when adapting to different areas. As for the destructible nests, the meshes are already something i'm working on. As for letting the player know... well it seems intuitive to me, i'm adapting the existing 'hornets nest' that is already in place near most active cazador infestations, and the 'hole in the rock' seen through out 'scorpion gulch' as the first set of destructible 'nests'. Currently i am testing the scripts shown above in an interior cell i created as a control/proof of concept, i'll also try the method you have proposed in an existing exterior using existing scripts and creatures to see if it works better. Thank you again for your help. **EndEDIT

Edited by Hengebobs
Link to comment
Share on other sites

Where do you see respawning creatures in FNV?

 

The base game creatures respawn and do not have destructable nests. Do you plan to change all of these? I thought you were planning to leave the base game creatures alone but add new respawns with destructable nests. In this case the player would not have any reason to think these two types of objects work differently, and I think they would be confused. If your mod is to change everything in the base game which respawns, then the player can understand that is the point of your mod.

Link to comment
Share on other sites

My initial intent was to change the entire game. I've been looking at things in the GECK, and as you say all the ones i've seen so far are respawned via script. a lot of scripts... Likely i will be keeping this small scale until i have it sorted out, but the hope would eventually be, that all 'nests' in the game would be replaced with the destructible versions i'm working on, and that they would control 'respawns' in their respective area. In the mean time, i will likely do something to the 'nest' objects i'm working on, such as destinct recoloring, or something along those lines to make them 'obvious' to the player. That is of course if i can get this working at all. Meshes, textures, and what not are easy enough, 'game changes' and scripts are not something i have messed with much before so it remains to be seen if i can get it to work at all.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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