Page 1 of 1

ActionCastSpell

Posted: Sun Dec 28, 2008 5:49 pm
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.

Re: ActionCastSpell

Posted: Sun Dec 28, 2008 6:57 pm
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!

Re: ActionCastSpell

Posted: Sun Dec 28, 2008 9:13 pm
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.

Re: ActionCastSpell

Posted: Mon Dec 29, 2008 6:08 pm
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?