Creating a spell to detect certain objects

Post » Mon Jun 18, 2012 6:40 pm

Hi guys, new to modding here. I'm trying to create a spell that detects certain objects, not actor types.

I've forked the DetectLife spell, and also forked the DetectLifeEnemyExteriorConcSelf magic effect. However the magic effect remains, basically, "Detect Life." How do I designate the effect to apply to, say, gold coins or something else?
User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Mon Jun 18, 2012 9:39 am

Spells only affect actors AFAIK. Could be wrong...
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Tue Jun 19, 2012 12:34 am

Spells only affect actors AFAIK. Could be wrong...
yep, you're wrong. spells can now affect various things. though the detect life functions are hardcoded to only detect actors. there may be a way by heavy scripting. there are some new neat functions like http://FindClosestReferenceofAnyTypeInList and similar stuff which basically provide you with a way of scanning your environment for certain objects. then, you only have to apply the right effect (similar to the detect life stuff) to these objects.
User avatar
leigh stewart
 
Posts: 3415
Joined: Mon Oct 23, 2006 8:59 am

Post » Mon Jun 18, 2012 5:42 pm

rlilewi is correct that spells only directly affect actors, although MrMuh is also right that they can be used to look for other things if you add a script to them.

The available functions allow you to find the closest reference of a certain type (or, as in the function mentioned by MrMuh, any type in a list) or a random reference of a certain type (or any type in a list) within a certain radius.

The function names might be a little misleading in that "type" refers to a specific base object, so you can't just look for, say, Activators. It's also currently impossible to reliably cycle through nearby references, as we can only find the closest one to a point or a random one within a radius.

A very useful thing you can do with a spell is add an explosion with a "Placed Object" that has a script attached to it, which will let you do stuff with/from the location that was hit by the spell.

Cipscis
User avatar
TOYA toys
 
Posts: 3455
Joined: Sat Jan 13, 2007 4:22 am


Return to V - Skyrim