Does GetSelf work in dialogue result scripts?

Post » Sun Aug 09, 2009 11:10 am

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?
User avatar
April
 
Posts: 3479
Joined: Tue Jun 20, 2006 1:33 am

Post » Sun Aug 09, 2009 9:41 am

Might want to try:
set vampire.Hater to thisset vampire.HateVampiresCheck to 1
Might work, haven't tested it.
User avatar
Bones47
 
Posts: 3399
Joined: Fri Nov 09, 2007 11:15 pm

Post » Sun Aug 09, 2009 4:06 pm

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.
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Sun Aug 09, 2009 3:20 pm

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.
User avatar
Daramis McGee
 
Posts: 3378
Joined: Mon Sep 03, 2007 10:47 am

Post » Sun Aug 09, 2009 5:15 pm

For some reason, I changed getself to THIS and it worked great! Thanks!
User avatar
Isabella X
 
Posts: 3373
Joined: Sat Dec 02, 2006 3:44 am

Post » Sun Aug 09, 2009 6:47 am

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.
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Sun Aug 09, 2009 10:28 am

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.
User avatar
Jenna Fields
 
Posts: 3396
Joined: Mon Dec 11, 2006 11:36 am

Post » Sun Aug 09, 2009 1:12 pm

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
User avatar
Monika Fiolek
 
Posts: 3472
Joined: Tue Jun 20, 2006 6:57 pm

Post » Sun Aug 09, 2009 8:14 am

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.
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Sun Aug 09, 2009 1:46 pm

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! :)
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm


Return to IV - Oblivion