Skip to content

GetSpellTarget Location from Feat Spell

How do I cause a custom spell to provide a spell target location using GetSpellTargetLocation()?

Trying to create a Feat where a PC can "summon" a construct at a target location.

Thus far, the spell script runs properly and creates the construct at the caster's location. (have not been able to spellhook this - impact script limitation for feats?)
Spells 2DA entry
843	Summon_Construct	16971716	ife_sumconsspl	V	M	s	0x00	0x04	js_s2_sumconstrt	****	****	****	****	****	****	****	****	1	500	head	****	vco_smhanodd01	****	****	****	****	out	500	****	****	****	****	0	****	****	****	****	****	****	0	****	****	****	****	****	15	****	3	16971718	0	1	53220	0	1117	****	****	0	

FEAT 2DA entry
1117	Summon_Construct	16971716	16971717	ife_sumconstrt	****	****	****	****	****	****	****	****	****	****	0	0	0	15	****	843	1127	0.5	1	****	1	****	****	****	****	****	****	****	****	****	FEAT_SUMMON_CONSTRUCT	5	****	1	45	****	****	0	1	

CLS_FEAT_* entry
26	SummonConstruct	1117	3	1	1	
// SPELL SCRIPT
// Removes prior summoned before generating new summoned
void main()
{
   object oPC = OBJECT_SELF;

    object oPriorSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
    DestroyObject(oPriorSummoned, 1.0);

    string creatureResref = "zep_animwheel";

    ChangeToSummoned(GetSummonedCreature(creatureResref), OBJECT_SELF);

    effect eSummon = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);

    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(24));

}

Comments

  • ZephiriusZephirius Member Posts: 411
    It's easy to overlook, but did you check the unique power box on the item?
  • meaglynmeaglyn Member Posts: 149
    Try changing the TARGETSELF field (26th column) of the feat to 0. The spell target looks right so maybe that is what's forcing it to target the character.
  • SmithicusSmithicus Member Posts: 21
    I appreciate the guidance, but this is not a spell that is triggered by an item-use (tag-based), but by a feat. I am considering creating an item on the PC to accommodate the GetSpellTargetLocation with GetItemActivatedTargetLocation (if it cannot be done within a simple feat-spell/impactScript). But that is less elegant. :smile:
  • SmithicusSmithicus Member Posts: 21
    I found a solution.

    The TOOLSCATEGORY changed to 2 (Active Combat Feat) provided the selection capability I needed.

    My son reminded me that the Disarm Feat allows targeting so I modeled the Summon Feat after it.

    meaglyn: Thanks for the direction, the idea seemed reasonable. I changed the TARGETSELF field to 0 (false) in the feat.2da and tried again, but the cursor never changed into "targeting location"-mode and again spawned the construct at the feat-caster location.

    I also tried commandeering another spell (stinking cloud) and redirecting to see if I could cause the target selection, but it did not provide the target-selection ability through the feat.
Sign In or Register to comment.