Jump to content

GECK three questiond


irswat

Recommended Posts

I have an NPC with an ID "SMSniper01", it is my base object for the 200+ snipers i plan to place throughout the wasteland.

 

I created a quest called SniperModQuest01 with an attached quest script that declares a global short variable SniperDOD (date of death)

When SMSniper01 dies it calls a deathscript:

ScriptName SniperTowerDeathScript


Begin OnActivate

    Set SniperModQuest01.SniperDateOfDeath to GameDay

End

 

I have two iterations of this NPC on top of a tower with reference editor id's "GSSniper01" & "GSSniper02" (eventually I will have 200 of these snipers)

 

Question one: how do I get the reference editor id of the NPC that called the death script?

 

Question two: how do I store SniperModQuest01.SniperDateOfDeath to a form list called SMDeadSnipers in a form with a name that corresponds to its reference editor id? e.g. How do I create a form under form list that corresponds to the refid of the NPC that called the death script ("DeadSniper01" for example), and how do I store its date of death in this form?

 

The reason I want to do this is so I can make this respawn process procedural. In the respawn script I want to check if this NPC is alive, if it isn't I want to be able to pull its date of death from this form list of dead snipers to see if 72 hours has passed.

 

I have two nearly identical scripts that will spawn these NPC's at one of two x-markers after 3 days.

 

Here is one of them (there are some syntax issues here, but I can figure them out myself I think):

ScriptName SpawnTowerSniper01

int respawn=0

Begin OnActivate

If ((SniperModQuest01.SniperDOD+GameDay<=30)&&(GameDay- SniperModQuest01.SniperDOD>=3))
Set respawn to 1
else if ((SniperModQuest01.SniperDOD+GameDay<=30)&&((30- SniperModQuest01.SniperDOD)+GameDay>=3)
Set respawn to 1

If respawn==1

GSSniperMarker01.PlaceAtMe SMSniper01 1
endif

End

 

Question three: what can I attach this respawn script to that it wont constantly be running? I'd like the respawn script to activate when the player gets near the area where the tower is, but if the player is sitting around the area for three days I don't want the snipers to respawn until the player leaves the area and comes back.

 

Thanks so much for your time. I'll be working the next four days so take your time getting back to me.

Matt

Link to comment
Share on other sites

You just posted a lot of stuff, huh?

 

In order to add the dead actor to the form list, the death script that runs on the actor will need to do it. Something along the lines of:

set rActor to GetSelf
AddFormToFormList rDeadSnipers rActor

As for storing the variable and the actor in a form list, that's impossible. However, there is something that can do that. In the newest NVSE update 4.2b there are arrays, which can store numeric values of whatever you want them to be. You could use that to store the data you need, but it's something that I'm not familiar with, them being so relatively new to Fallout.

 

Google "nvse4+ tutorial" to find a website (that I don't believe I'm allowed to link to) with more information and where you can get help using them.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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