Hello, I am trying to find a way in which I could cause the shapeshift spell to fire on a target based off of a plot event or dialogue tree trigger.
To keep it simple, for now I'm testing my code by triggering off of an event of type EVENT_TYPE_UNIQUE_POWER which fires when an item with UNIQUE_POWER_UNLIMITED_USE is activated. This event must be handled in the module script, so it's quite neat. Now, once this event has been triggered, I am trying to shapeshift the caster into the Bear Form of the shapeshift spell tree. Here is how I am trying to accomplish this:
case EVENT_TYPE_UNIQUE_POWER: { object oCaster = GetEventObject(evEvent, 1); object oTarget = GetEventObject(evEvent, 2);
DisplayFloatyMessage(oCaster,"handling unique power",FLOATY_MESSAGE,16777215,0.5);
SetEventType(evEvent,EVENT_TYPE_SPELLSCRIPT_PENDING); SetEventInteger(evEvent,0,17010); SetEventObject(evEvent,1,oCaster); SetEventObject(evEvent,2,oTarget);
HandleEvent(evEvent, R"spell_shapeshift.ncs");
break; }
However, in testing, the FloatyMessage appears, but no shapeshift occurs. Is there a more correct way of casting a spell on a target via scripting?
Shapeshift via Scripting
Débuté par
trias10
, janv. 28 2010 11:21
#1
Posté 28 janvier 2010 - 11:21
#2
Posté 28 janvier 2010 - 02:21
I haven't yet managed with spells and talents but i can suggest you something about scripts.
In your spell_shapeshift.ncs script, have you written a code to let you know if the target is correctly acquired, some as the DisplayFloatyMessage() you put on Caster?
You can use PrintToLog() too.
In your spell_shapeshift.ncs script, have you written a code to let you know if the target is correctly acquired, some as the DisplayFloatyMessage() you put on Caster?
You can use PrintToLog() too.
#3
Posté 28 janvier 2010 - 09:47
You are calling HandleEvent from the module, expecting it to go to the creature - you will need to do SignalEvent or something similar. You would probably also be better off creating a new event rather than recycling the current one in this case.
If you want to customize or remove the animation for this ability I would suggest creating a dummy ability in the abi_base_yourmod.xls and then calling HandleEvent in the appropriate place in your spellscript.
If you want to customize or remove the animation for this ability I would suggest creating a dummy ability in the abi_base_yourmod.xls and then calling HandleEvent in the appropriate place in your spellscript.
Modifié par Craig Graff, 28 janvier 2010 - 09:52 .
#4
Posté 31 janvier 2010 - 12:20
When you say I should create a new event instead of recycling the existing one, do you mean I should just instantiate a brand new event using the Event constructor?
I'm not familiar with SignalEvent, but looking at the Wiki, it requires an object to pass the event to. What would be the object in this case? Would it be the Caster itself?
I'm not familiar with SignalEvent, but looking at the Wiki, it requires an object to pass the event to. What would be the object in this case? Would it be the Caster itself?
Modifié par trias10, 31 janvier 2010 - 12:22 .





Retour en haut






