Jump to content

Getting the RefID of the NPC you are talking to?


yojeff

Recommended Posts

If I put 10 actors in a cell (same base id), is there some way to get the ref of the actor I speak to, using the Result Script (End) of a Topic?

 

I am trying to make a simple photo mode. I started by telling a specific follower to stand on a marker (by using AddScriptPackage on them).

 

I'd like to make something more generic that wouldn't modifiy the follower (So not adding the package to their list of packages).

 

In the topic, I could use the Follower faction instead of the ID of the NPC.

 

But now, I don't know how to get the refID to that NPC in order to add the package to them.

 

If somebody has an idea, or the name of a mod I could check, it would be appreciated!

Link to comment
Share on other sites

Thank you for the tip.

 

I see you answered the same question here.

 

I tried the same bit:

 

In the Topic :

set aaPhotoMode.refKillTest to getActionRef
set aaPhotoMode.refKillMode to 1

In the Quest Script :

	if refKillMode == 1

		printc "Kill Block"
		if refKillTest == StarPaladinCrossREF
			printc "You tried to kill Paladin Cross"
		endif

		refKillTest.kill
		set refKillMode to 0
	
	endif

The kill doesn't work, and the "Kill Block" is printed a couple of time. I will work on it some more.

 

I also looked at the function GetCrosshairRef that I could also use.

 

Thanks again!

Link to comment
Share on other sites

When an "implied reference" doesn't seem to work, it is always worth checking that an "explicit reference" doesn't make a difference. You are using an "implied" reference in the quest script. You might test using the "explicit" form "if (aaPhotoMode.refKillMode == 1)" (etc.). "Variable scope" can get tricky to diagnose in scripts.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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