Ineffable Wingbolt Dahak Posted October 6, 2008 Share Posted October 6, 2008 In basicnpc there are 2 variables, i and target, but neither appears to be used in the scripts? I am currently modifying a creature script and my question is whether I should leave these variables in or remove them? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted October 6, 2008 Share Posted October 6, 2008 "target" is definitely used. It's in the START_STATE and is used to check whether or not the creature has a target. You'll want to leave this in. "i", on the other hand doesn't seem to be used, you're right. Leaving it in won't hurt the script though. I'd just add new variables on top of the existing ones, leaving those two alone. Quote Link to comment Share on other sites More sharing options...
Ineffable Wingbolt Dahak Posted October 6, 2008 Author Share Posted October 6, 2008 There is the curious thing. Nothing is ever actually assigned to the target variable. Only functions are called. A creature does not need a target variable defined to acquire and do after a target. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted October 6, 2008 Share Posted October 6, 2008 Dahak is correct: neither of these variables is ever used. Both should be deleted, but there's no performance hit associated with having them, so you can just ignore them. Nico, you're being confused by the fact that each creature, internally to the game engine does have a 'target' variable, which is accessed via get_target(), set_target(), and target_ok(). These functions have nothing whatsoever to do with any variables in the script itself, even in spite of one of them being named 'target'. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted October 6, 2008 Share Posted October 6, 2008 The i variable is probably just something that he adds to all his scripts just in case he wants a loop. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted October 6, 2008 Share Posted October 6, 2008 Originally Posted By: Niemand Nico, you're being confused by the fact that each creature, internally to the game engine does have a 'target' variable, which is accessed via get_target(), set_target(), and target_ok(). These functions have nothing whatsoever to do with any variables in the script itself, even in spite of one of them being named 'target'. Niemand, you're being confused by my PDN's, though I shall tell the real Nicothodes that you got me confused for her. And yeah, I posted that this morning, after just getting up, and briefly checking basicnpc. Going back, I can see the variable isn't used. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.