ActionCastSpell

For toolset tutorials as well as question and answers.
Locked
User avatar
Riotnrrd
DMA's Technical Liaison
Posts: 1682
Joined: Sat Jan 03, 2004 2:04 pm

ActionCastSpell

Post by Riotnrrd »

Hi folks;

Trying to set up a trigger that when entered, casts a spell at the PC entering the object. Problem is, I cant get the darned spell to cast at the entering PC.

Code as follows

Code: Select all

void main()
{
	object oTarget = GetEnteringObject();
	FloatingTextStringOnCreature("target is " + GetName(oTarget), oTarget);
	ActionCastSpellAtObject(SPELL_WEB, oTarget, METAMAGIC_ANY, TRUE);
	
}
	
What am I doing wrong? I pulled examples straight from the NWN lexicon, cant get it to work.
Zelknolf
Chosen of Forumamus, God of Forums
Posts: 6139
Joined: Tue Jul 05, 2005 7:04 pm

Re: ActionCastSpell

Post by Zelknolf »

ActionCastSpellAtObject(SPELL_WEB, oTargt, METAMAGIC_ANY, TRUE, 3, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);


Instant spell helps with objects. If that still fails, try the same thing but with an AssignCommand(oTarget, ActionCastSpellAtObject()) sort of setup... cruel to make the characters technically web themselves, but meh! Makes for an interesting trap!
User avatar
Riotnrrd
DMA's Technical Liaison
Posts: 1682
Joined: Sat Jan 03, 2004 2:04 pm

Re: ActionCastSpell

Post by Riotnrrd »

Its going to be an ambush in some spider caves, if the party doesnt spot them.

Web cast in area, followed by 1d3 spiders dropping from the ceiling (conveniently, immune to web effects ;) )

Do I actually have to load a module with the server exe, then join with a PC to make this happen? or can I just load up a new module in the player client, and choose this module, and walk up to the trigger?

Other stuff on the trigger works (spiders drop, etc), just cant get the darned spell to cast.
Zelknolf
Chosen of Forumamus, God of Forums
Posts: 6139
Joined: Tue Jul 05, 2005 7:04 pm

Re: ActionCastSpell

Post by Zelknolf »

Did both this
ActionCastSpellAtObject(SPELL_WEB, oTargt, METAMAGIC_ANY, TRUE, 3, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);

and this
AssignCommand(GetEnteringObject(), ActionCastSpellAtObject(SPELL_WEB, oTargt, METAMAGIC_ANY, TRUE, 3, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));

not work?
Locked