WizWom Posted September 20, 2006 Share Posted September 20, 2006 Well, I decided I'd try to get a handle on Rane() since I made a script where the NPC was switching to melee weapons at long range, and I needed to get a handle on why. So i make a script with a bunch of blocks, checking for range from 1 to 11. Range 8 is about 1-1/2 target circle widths. Range 2 is with target circles partially overlapping. Range 3 is a little bit of distance. Ok, I don't know how that works, since he was attacking me with a dagger at what the script interpreted as range 3. whatever, not a big deal. So, I made the ranges from 1 to 5 and up to 50... It took from sight contact to range 20-24 (which seemed to be about 2/3 visual range) for the script to kick over on a new enemy. Then I got script action at 15-20, 10-15, and 5-10. I'll have to test with a slow moving creature. With a Green slime, I get the first range trigger at 30-34, then 2-3 each of the groups until it gets into "contact" at a trigger of Range(,5) but not triggering Range(,1). Further tweaking makes it certain the furthest is 30 that "Range(NearestEnemyOf(Myself),)" gets triggered. Outside of that range, even if the enemy is seen by a freindly, the script won't pick it up. Now we get to the counter-intuitive bit: IF See(NearestEnemyOf(Myself)) !Range(NearestEnemyOf(Myself),5) THEN RESPONSE #100 DisplayStringHead(Myself,63078) // Where did Carston come from? END IF See(NearestEnemyOf(Myself)) Range(NearestEnemyOf(Myself),5) THEN RESPONSE #100 DisplayStringHead(NearestEnemyOf(Myself),4002) // Must you crowd so close? 'Tis bad enough I must walk with you chimps. END The first block triggers for any range greater than 5! Then the second block triggers as the target closes! It seems range triggers if the range is less than the specified number. Link to comment
This topic is now archived and is closed to further replies.