object script, how to get it's self ref?!

Post » Thu May 31, 2012 8:38 am

Hi all!

To solve a problem with PipBoy Light I started to test an object script attached to a hacked PipBoy .NIF
Well I have serious problem to actually get the ref of itself AND searching about it and similar functions/solutions/white papers gives nada :sad:

This is the current object test script:
scn aaaa_pipboyscaleshort bMenushort bGameref selfbegin menumode 1  if bMenu != 1  set self to getself  if self == 0   printtoconsole " menumode no ref returned"  else	self.setscale 1.0  endif  set bMenu to 1  set bGame to 0endifendbegin gamemodeif bGame != 1  set self to getself  if self == 0   printtoconsole " gamemode no ref returned"  else	self.setscale 0.1  endif  set bMenu to 0  set bGame to 1endifend

It do work as far as running and giving debug messages but I never get the self ref (always 0 result). What do I do wrong?
I can't find an objectself ref function on wiki and searching for the subject or commands give zero results...
User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am

Post » Wed May 30, 2012 9:34 pm

What are you trying to get the ref of?

If you want to get the ref of the actor that is wearing the pipboy, use GetContainer instead of GetSelf.

Items (the pipboy in this case) don't have refs when in an actor's inventory, so GetSelf will return zero.
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Post » Wed May 30, 2012 10:08 pm

I made some more studies, what I try to get hold of is the reference id of the current attached pipboy of the player as to be able to in this case change the size of it on the run so to speak.

GetSelf was bad choice since it on the wiki spells out it only works for permanent references. GetContainer as you say gives the actor that holds the object.

I presume an effect script is the way to go but it is not written much of how it is set up and pitfalls around it. Have split up some mods and game script and base effects in GECK to try get a grip of it.
User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm

Post » Wed May 30, 2012 9:21 pm

Unfortunately, the current attached pipboy does not have a reference id. Items in inventory, regardless if they are being worn or not, do not have ref Ids. So reference functions like SetScale can't be used.
User avatar
Harry-James Payne
 
Posts: 3464
Joined: Wed May 09, 2007 6:58 am


Return to Fallout: New Vegas