Static object search and area loading scripts?

Post » Fri Feb 18, 2011 11:06 pm

Hi

Sorry to have to ask, but I've spent a while searching and I can't seem to find the answers!

1) Is it possible to search through all static references in a script? I was hoping to use GetFirstRef and GetNextRef, but I can't seem to see a form type ID for static objects...

2) Is it possible to get a function in global script to execute once every time an area is loaded?

Hope you can help, apologies if this is really obvious...
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Sat Feb 19, 2011 12:41 am

Statics are form type 28 (listed as "Stat")

If you are talking about a specific area of yours (like an interior), you can place an scripted object there and the script will run while the cell is loaded.
For generic areas, all I can think of is keeping track of the player changing cells and assuming some cells get loaded in the process.
User avatar
claire ley
 
Posts: 3454
Joined: Fri Aug 04, 2006 7:48 pm

Post » Sat Feb 19, 2011 5:14 am

Excellent - many thank QQuix. 28 worked perfectly.

Problem is I was working no a quest script, so I couldn't use onLoad. I ended up using GetParentCell, and comparing it to a prior value, as the example shows on the CSWiki. :)
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Sat Feb 19, 2011 1:49 am

Hmm... I'm now wondering if I couldn't just use GetCellChanged instead! Will try later.
User avatar
Lew.p
 
Posts: 3430
Joined: Thu Jun 07, 2007 5:31 pm


Return to IV - Oblivion