topic fragments npcs propertys and me

Post » Sun Jun 24, 2012 8:00 am

I have attached a script to an NPC..

the script extends actor.

i added a simple int auto property to that script named testprop.

Now ive made a Quest with Dialogs for this NPC ..so far it works i can choose my topic and the npc responds properly.

everything works fine to this point.

Now i want to add a fragment to one of the responses that sets my testprop to 1 and here im lost.

how can i access my testprop which is defined inside the script of the dialogspeakernpc and change it to 1?
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Sun Jun 24, 2012 3:40 pm

Have you tried something like this?
  actor_ref.GetActorReference().testprop = whatever
User avatar
Trish
 
Posts: 3332
Joined: Fri Feb 23, 2007 9:00 am

Post » Sun Jun 24, 2012 2:16 am

yes i did but it doesnt recognise my reference .
i also tryed it with akSpeaker and akSpeakerRef but it tells me that my property does not exist on them or one of the parents .
User avatar
James Smart
 
Posts: 3362
Joined: Sun Nov 04, 2007 7:49 pm

Post » Sun Jun 24, 2012 3:04 pm

Last time I had that particular problem, it turned out my ObjectReference was actually referring to a button.

If you're setting it by conditions in the quest, check the conditions. Or try it with a unique/specific reference, just to see if it makes a difference.
User avatar
john palmer
 
Posts: 3410
Joined: Fri Jun 22, 2007 8:07 pm

Post » Sun Jun 24, 2012 3:32 am

@Hoggel
akSpeaker is an Actor, and your script extended that, so you have to cast.

(akSpeaker As NameOfYourAddedNPCScript).testprop = 1
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Sun Jun 24, 2012 12:28 pm

*facepalm*

Yes, of course. It's a casting problem
User avatar
GRAEME
 
Posts: 3363
Joined: Sat May 19, 2007 2:48 am


Return to V - Skyrim