Home   Help Search Login Register  

Author Topic: NearestBuilding  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
NearestBuilding
« on: 19 Mar 2005, 23:18:36 »
has anyone noticed anything stange about the nearest building command,

I've noticed that it seems to calculate a result as part of the init phase and sticks with that for the remainder of the game, for example in a cycling script that checks the location of the nearest object to the player, at first it returns the correct result but as the player moves around the command does not update???

SILENTHUNTER
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline Roni

  • Members
  • *
  • Play the Game !
Re:NearestBuilding
« Reply #1 on: 20 Mar 2005, 07:26:28 »
I haven't noticed that - in other words, in my experience that is not what happens.

I have a looting script that is called by a player addaction.  All it does is check the distance between the player and the nearest bilding.  If this is less than 4 metres then the script assumes that he is in the building and checks for the looted objects (food and water in the case of my script, but I've made variants for guns, ammo, vehicles and even extra group members !).

One bit of the script records the last 50 buildings checked so that a player can't just stand in place looting the same building over and over again (unless he has lots of patience and lots of time !).

The script is dynamic, in other words in my experience it does update nearest building as the player moves.  If your script is called just once at the start or collects player position just once then this may be your problem.  Otherwise, I would suspect alien intervention.   :D

cheers !



roni