I would like to add a token to all living actors.

Post » Fri Apr 01, 2011 6:46 am

I would like to add tokens to all actors for use with GetContainer. I was wondering, how would I do that? In a way so that mod added actors would also get one.
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Fri Apr 01, 2011 12:04 pm

You'd need to do it as you encounter them by walking through all the actors in a cell and adding your token to each actor that doesn't already have one and is alive.

Something like this:
ref rCurrentRefBegin GameMode	set rCurrentRef to GetFirstRef 200 1 0	Label 10	if rCurrentRef		if rCurrentRef.GetItemCount Token		elseif rCurrentRef.GetDead		else			rCurrentRef.AddItem Token 1		endif		set rCurrentRef to Pencil01		set rCurrentRef to GetNextRef		Goto 10	endifEnd

You won't need this code to run every frame, so use a quest script that runs once every few seconds. The default value of 5 seconds should be fine.

Cipscis
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am


Return to Fallout 3