Remember the Oblivion Activator Spell trick?

Post » Sun Jul 17, 2011 1:34 pm

Do you remember the Oblivion Activator Spell trick? It allowed you to get the reference of many things at once and do with them as you will.

As a refresher:

1. Move a persistent, disabled activator to the player
2. The activator casts a very large scripted radius spell
3. Whatever the spell hits can be used as reference. The spell can narrow the access with things like GetIsRace, IsActor, IsContainer, etc.
4. Now that you have access to these things you can do whatever you want in the script

With this technique I was able to add torches to any actors in interior spaces. Even better, the mod worked on actors from other mods. All of this, without touching leveled lists or IDs.

Is there a similar way to gain access to npc's, containers, etc? There are no more spells. Will a silent, painless, invisible explosion work to get the reference?

I want to add an in game 50% chance for duct tape in tool boxes and tool cabinets via script without touching them in the GECK. Because afaik, last mod loaded wins but script works around it.
User avatar
Astargoth Rockin' Design
 
Posts: 3450
Joined: Mon Apr 02, 2007 2:51 pm

Post » Sun Jul 17, 2011 12:11 pm

/The last mod loaded stuff need not actually be an issue (and hasn't been since about five months after Oblivion's release); merged patches produced by TES4/NVEdit or Wrye Bash/Flash combine all changes. Plus, Fallout added the AddItemToLeveledList function you can use to stick duct tape directly into lists. Also, the activator trick was only necessary before OBSENVSE which added the GetFirstRef/GetNextRef functions that let you iterate over the contents of a cell.
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Sun Jul 17, 2011 6:00 am

I don't want to use AddItemToLeveledList because the wiki states that the change is permanent. I assume this means that removing the mod would not undo what has been added. Also, the toolbox and toolcabinet already have a low chance for duct tape. Too low for good use of making weapon repair kits. So that leaves me with NVSE. So I would run a quest script that checks if the player is in an interior cell, and I would use GetFirstRef, GetNextRef to cycle those specific container references and add the duct tape, all in one frame?
User avatar
Jack Moves
 
Posts: 3367
Joined: Wed Jun 27, 2007 7:51 am

Post » Sun Jul 17, 2011 4:19 pm

You could always just up the %age chance on the LVLI that contains the duct tape, unless another mod alters that specific item (unlikely) it'll take effect. Also, AddItemToLeveledList can't be reversed, yes, but if you add "MyNewLeveledList" to the list which itself just contains duct tape then if your mod is disabled that list will vanish.

Whilst you could use NVSE I'd really suggest not adding a constantly-running quest script for something which can be done in many other ways with less overhead. Particularly, as I've pointed out, as merged patches exist- you are trying to solve a problem that doesn't exist.
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Sun Jul 17, 2011 4:45 am

Here's an actor effect I am applying to the player periodically from a quest script, to scan for enemies:

Base Effect - type script, self, touch, target, no magnitude, painless, no hit effect, no death dispel

Actor Effect with this base effect - Type, Actor Effect, Area effect Ingnores LOS, Force Touch Explode.
Area of the Base effect - 7000, Duration - 1 second.

Script on base effect - this script runs on the scanned actors, so you can do anything you want with them. If you absolutely need the ref of a spawned actor, then you can use an activator to get it.

scn RHKWendyCBRadarEffectScriptshort iRelationref rTargetBEGIN ScriptEffectStart		set rTarget to GetSelf	;returns zero on spawned actors but doesn't matter		if (GetDisabled)		return	endif		if ((rTarget != Player) && (rTarget != RHKWendyREF))			if ((IsActor) && (GetDead == 0))		set iRelation to GetFactionRelation Player		if ((iRelation <= 1) && (GetDistance Player < 3000))		; Neutral or enemy within 140 feet			if (iRelation == 0)		;Neutral				if (GetAv Aggression > 1)	;Attacks neutrals on sight					set RHKWendyCB.iEnemyCount to RHKWendyCB.iEnemyCount + 1					if (GetAV Health > 450)						set RHKWendyCB.iBigEnemy to RHKWendyCB.iBigEnemy + 1					endif				endif			elseif (iRelation == 1)	;Enemy				set RHKWendyCB.iEnemyCount to RHKWendyCB.iEnemyCount + 1				if (GetAV Health > 450)					set RHKWendyCB.iBigEnemy to RHKWendyCB.iBigEnemy + 1				endif			endif		endif	endifEND

User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm


Return to Fallout: New Vegas