Jump to content

How to get an npc to cast a spell on player in dialogue?


Recommended Posts

I have some dialogue setup and I want to make the npc talking to the player cast a target spell after the dialogue ends. I tried these things...

 

set PotentialRef to MyQuestExample.PotentialRef

PotentialRef.Cast MyExampleSpell player

 

I can't get the dam thing to set a reference from my quest? The quest doesn't use specific npc it is any npc that is covered in a script I made for the quest. The PotentialRef is the npc used by the script for the quest but I can't get the CSE to take it I always get the error in the quest section about unknown reference blah blah.

 

Earlier I had that PotentialRef casting the target spell at player just fine only outside of dialogue but I want to make it happen inside some random goodbye dialogues now.

 

Anyone know how to do this?

Link to comment

I have in the result script

 

set MyQuestExample.PotentialRef to GetSelf

Cast MyExampleSpell Player

 

 

Still doesn't do anything, I found some info on nexusforums? I think and it talked about the SE14 quest for the healer option from haskill but that references a specific npc. Also the object script for that makes no sense to me at all.

 

I don't get why if I tell the result script area that set PotentialRef to MyQuestExample.PotentialRef it can't see that as a reference? Why should I have to write a separate object script to get this to work when the quest script defines it already?

Link to comment

Yes I have been sure that using cast without a reference would not work, it feels like a missing piece of a puzzle that got stuck under some furniture somewhere and can't be found. I am surprised that link works! I have found similar links that are supposed to explain getself and cast etc but they all lead to an error page.

Link to comment

I tried this too...

 

ref PotentialRef

set PotentialRef to myQuestExample.PotentialRef

set PotentialRef to GetSelf

PotentialRef.Cast MyExampleSpell player

 

Nothing happens

 

I tried adding a script package that is for castmagic instead and still nothing happens

 

I even added a message to the end of it in case it was working but not working still nothing.

 

MyQuestExample script is using a while loop does that have anything to do with it not working?

 

I can get the PotentialRef to cast magic at the player if I do it from the quest script but the dialogue option is better I just don't get why it is not working:-(

Link to comment

Here is a good bookmark for the wiki  If the search box on the left side does not work then go right to the list of all functions and use your browsers Ctrl-F to find what you are looking for. Do not expect a lot of pictures and diagrams. Study user functions. Pay attention to how oblivion handles references.

 

In the result script:

Set MyQuestExample.PotentialRef to GetSelf

Call MycastingUserfunction

 

let the MycastingUserfunction do the casting using the MyQuestExample reference.
 

 

Link to comment

I got it to work!!!!!!!!!!!!!!!!!!!!

 

I put this shot at the end of MyQuestExample script...

 

if ( HitMe == 1 )

PotentialRef.Cast MyExampleSpell player

set HitMe to 2

endif

 

Then in the result script area for the dialogue I put this

 

set MyQuestExampleScript.HitMe to 1

 

 

That was all it took to make it happen!!!!!

 

FINALLY!!!!!!

 

Simply AMAZING I looked outside for flying pigs but it was raining oh well lol.

 

Of course this means I can have other shorts at the end of my scripts that do different things and just set them to 1 in the result script for those things to happen.

 

Thanks for your help now I can get to work on other stuff thanks again!

 

I got the idea for the short from the SE14 quest like I mentioned earlier but decided to add it into my script instead of making it a separate object or function script because when typing into the result script area...

 

set MyQuestExampleScript.PotentialRef.Cast MyExampleSpell  it of course did not work too many dots there and it doesn't make sense.  I am thinking that the cast command does not work in the result script area.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use