Page 1 of 1

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 11:10 am
by April
I have a script that I call in a result script in dialogue conversation. The problem is, it doesn't correctly set my ref to who I was talking to.

Here's my code in the result script:

set vampire.Hater to getselfset vampire.HateVampiresCheck to 1


The second line works, but in that code my ref hater is not correctly identified as the person I just walked by who said something to me.

Is there another way to identify the ref target? Or did I do it wrong?

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 9:41 am
by Bones47
Might want to try:
set vampire.Hater to thisset vampire.HateVampiresCheck to 1
Might work, haven't tested it.

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 4:06 pm
by Saul C
A Getself call inside a dialog result script will return the reference to the actor that just spoke that response. IIRC, it does work for conversations (dialog outside menuMode). Your syntax is correct.

EDIT: Don't see why this would work when getSelf doesn't - It's just an alias for the later.

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 3:20 pm
by Daramis McGee
Any other ideas? The only thing else I can think of is to add a token with set container to vampire.hater or something like that then delete the token. Seems like messy work though, The dialogue code should work though, but it doesn't store the ref in my quest script.

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 5:15 pm
by Isabella X
For some reason, I changed getself to THIS and it worked great! Thanks!

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 6:47 am
by Tiffany Castillo
I have a script that I call in a result script in dialogue conversation. The problem is, it doesn't correctly set my ref to who I was talking to.

Here's my code in the result script:

set vampire.Hater to getselfset vampire.HateVampiresCheck to 1


The second line works, but in that code my ref hater is not correctly identified as the person I just walked by who said something to me.

Is there another way to identify the ref target? Or did I do it wrong?

I presume your vampire is the quest name? Most of the time to do something like this:

AddSpell IHateVampires

In the Spell's Start block for the effect, merely do the necessary GetSelf there, then on the next line, Dispel the spell (for safety sake, in the event it's cast twice). Because you're adding it to the person you're talking with, it won't tell you you added it, nor will there be any effect. I would suggest setting it as an Ability, that way other mods that may watch for diseases, etc, and remove them, won't interfere with it. Plus, abilities are the only ones that survive world changes on NPC's.

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 10:28 am
by Jenna Fields
EDIT: Don't see why this would work when getSelf doesn't - It's just an alias for the later.

The difference is very minor, but often missed. I suppose it can be best explained by usage within an item script, which as you know, does not work well with getself as the reference ID is temporary. However, when This is used, it seems to ignore this check of the temporary reference and returns the object. This can also be directly used in functions whereas Getself needs to be stored before it can be used. The reason why it works here is probably related to the more direct way that This works. It's one of the more arcane functions, so can't really think of any good examples at the moment.

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 1:12 pm
by Monika Fiolek
A Getself call inside a dialog result script will return the reference to the actor that just spoke that response. IIRC, it does work for conversations (dialog outside menuMode). Your syntax is correct.

EDIT: Don't see why this would work when getSelf doesn't - It's just an alias for the later.
See what Vagrant0 said.

And apparently I'm good at the arcane portion of scripting. :P

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 8:14 am
by Jason King
The difference is very minor, but often missed. I suppose it can be best explained by usage within an item script, which as you know, does not work well with getself as the reference ID is temporary. However, when This is used, it seems to ignore this check of the temporary reference and returns the object. This can also be directly used in functions whereas Getself needs to be stored before it can be used. The reason why it works here is probably related to the more direct way that This works. It's one of the more arcane functions, so can't really think of any good examples at the moment.
I see. Thank you for the explanation.

See what Vagrant0 said.

And apparently I'm good at the arcane portion of scripting. :P
News to me. Thanks for bringing that up.

Does GetSelf work in dialogue result scripts?

PostPosted: Sun Aug 09, 2009 1:46 pm
by Big mike
News to me too. I'll bear that in mind. I swear that I learn as much scripting from reading these forums as I do from actually scripting things! Thanks guys! :)