kert349 Posted February 5, 2011 Share Posted February 5, 2011 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 More sharing options...
rickerhk Posted February 5, 2011 Share Posted February 5, 2011 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 More sharing options...
kert349 Posted February 5, 2011 Author Share Posted February 5, 2011 (edited) 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 February 5, 2011 by kert349 Link to comment Share on other sites More sharing options...
rickerhk Posted February 5, 2011 Share Posted February 5, 2011 I'm not sure then.I was able to do a SetAV and GetAV on Sunny Smiles at the console with the 777 value. Link to comment Share on other sites More sharing options...
kert349 Posted February 5, 2011 Author Share Posted February 5, 2011 I'm not sure then.I was able to do a SetAV and GetAV on Sunny Smiles at the console with the 777 value. Yes.. console works. Link to comment Share on other sites More sharing options...
Recommended Posts