Home   Help Search Login Register  

Author Topic: looking for info on nearestobject,nearestbuilding commands and how to use em  (Read 818 times)

0 Members and 1 Guest are viewing this topic.

Guru

  • Guest
ive searched here for info, but theres nothing on it anywhere.
ive tried everything to get those commands to work
but to no-avail  ???
do they actually work ?
oh and yes i know about 1.75 bug
but still would like info as i have earlier version installed

Offline Black_Feather

  • Former Staff
  • ****
  • I'll never forget you Daisey.
this will find the nearest jeep to the player

_vehicle = nearestObject [player, "jeep"]

then you can use something like _vehicle lock false, if you look in the com ref you can use any object with a + next to its name.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
(Orig. rep by Sui) :

 :o This demonstrates how to detect if a building (fuelstation) has been destroyed.

The trigger will activate when the fuel station expodes

---Mission components

GameLogic
This Gamelogic variable defines the fuel station which is going to get blown up.
It is placed right next to the fuel station and has and init line of:

fstn = nearestobject [this,"fuelstation"]

This makes "fstn" the fuel station needing to be blown up.

The trigger has the condition line:

not (alive fstn)

It uses fstn, already defined by the gamelogic above.

It sets off a hint when the fuel station is destroyed.
You would put your objective commands/win commands in the OnAct line,
so they activate when the fuel station is destroyed.

-----------


 To light up a streetlamp (in version 1.75) :

Just click the "show ID" button and find your streetlamp (you may need to zoom in quite close for the ID's to show up).
Take down it's number, and use a line like this:
 
(object 37317) switchlight "on"
 
To turn it on, "off" to turn it off and "auto" to set it to default (on during night, off during day).


PS. as far as I remember, both "nearest..." AND the object ID stuff will do in 1.85  :D


Laterz  :-*




Guru

  • Guest
so theres no way to get a nearestobject, of whatever type, happens to be near, at the time. IE:
a bush,building,smallshad, whatever?
it has to be named?
i wanted to be able to get whatever object was near.
based on knowsabout condition.(of the enemy)
and have dude dive for cover.
but not all scripted for a certain local,just generally triggered anytime anywhere.
« Last Edit: 31 Oct 2002, 10:20:32 by Willy Makeit »