GetSelf and Target References?

Post » Tue Feb 01, 2011 2:10 am

Here is the spell that is used to define the NPCTarget

SCN ArbTrainingSpellScriptShort BaseTargetBegin scripteffectstartSet BaseTarget to GetSelfSet ArbTraining.NpcTarget to BaseTargetend



Now here is the quest script code I can't save...


SCN ArbTrainingQuestScriptShort NpcTargetShort PartShort ButtonBegin GameMode	If ( Part == 1 && NpcTarget.GetInFaction ArbFollowersFaction == 1 )		Messagebox "What would you like to do?", "Train a warrior.", "Train a mage." "Train a rogue."		Set Part to 2		Else		Message "That isn't one of your students."Endif			if ( Part == 2 )				Set Button to ( GetButtonPressed + 1 )									If ( Button == 1 )													Set Part to 3													ElseIf ( Button == 2 )																Set Part to 4													ElseIf ( Button == 3)																						Set Part to 5Endif	EndifEnd



Any ideas why this isn't working? Why does the Cs cry about NpcTarget not being an an object reference or whatever when I clearly defined it in the the spell above?

It's so annoying how it isn't letting me save.
User avatar
Mark Hepworth
 
Posts: 3490
Joined: Wed Jul 11, 2007 1:51 pm

Post » Mon Jan 31, 2011 8:03 pm

Because you did not define it as a reference.

Short NpcTarget
should be:
Ref NpcTarget
User avatar
Alada Vaginah
 
Posts: 3368
Joined: Sun Jun 25, 2006 8:31 pm

Post » Tue Feb 01, 2011 7:09 am

Because you did not define it as a reference.

Short NpcTarget
should be:
Ref NpcTarget


Ahh...I knew it was something stupid on my part. I wasn't sure if there was another way to define it.

Thank you!
User avatar
Jeffrey Lawson
 
Posts: 3485
Joined: Tue Oct 16, 2007 5:36 pm


Return to IV - Oblivion