Jump to content

set/get AV problem


kert349

Recommended Posts

Hi

i was trying to init NPCs AV with value but for some reason when i click the NPC in game console and type getAV variable01 it shows thats its 0.00

 

i wonder why??

 

this is the code im using:

 

 


begin gamemode

ref self
set self to getself

self.setAV variable01 777


; when i put showmessage it confirmed that this code was executed

end

Link to comment
Share on other sites

If it's a spawned NPC, GetSelf always returns 0. Use GetContainer instead. If the script is on the NPC, you don't need to get it's ref. Just do the SetAv.

 

I usually check an AV first, then only set if it's not the value I want. And in quest scripts. Doing a SetAV on an Actor every frame can cause it to malfunction.

 

if ActorRef.GetAv Variable01 != 777
  ActorRef.SetAv Variable01 777
endif 

Link to comment
Share on other sites

If it's a spawned NPC, GetSelf always returns 0. Use GetContainer instead. If the script is on the NPC, you don't need to get it's ref. Just do the SetAv.

 

I usually check an AV first, then only set if it's not the value I want. And in quest scripts. Doing a SetAV on an Actor every frame can cause it to malfunction.

 

if ActorRef.GetAv Variable01 != 777
  ActorRef.SetAv Variable01 777
endif 

 

Hi its not spawned, so i dont know what's wrong.

 

(this is the NPCs own script.)

 

and i tried with just setAV but it didnt seem to help.

Edited by kert349
Link to comment
Share on other sites

  • Recently Browsing   0 members

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