Zachary_Alan
Member
I am currently make a top down GTA 2 style game and am currently making the cars. I had made a piece of code, I called the vehicle spawn enumerator, to generate a special 5-digit PIN for the vehicle so it can be identified by other objects I will add later in the game. Since the cars are the same object, they all have the same name.
This is to avoid, for example, if a pedestrian leaves their car, and wishes to return to their vehicle, they wont just go to the nearest object with the name obj_car, they will instead go to the nearest car with the name obj_car(and the PIN the their car has). problem being, I don't know if I can change the instance name with code on the fly without using creation code. (The spawning system will spawn the same object every time, so I need the enumerator to identify each instance of the object)
If this is impossible, is it possible for the ped (or whatever other object such as the police AI) to check the PIN variable in every car, until it finds its car and can go to it?
This is to avoid, for example, if a pedestrian leaves their car, and wishes to return to their vehicle, they wont just go to the nearest object with the name obj_car, they will instead go to the nearest car with the name obj_car(and the PIN the their car has). problem being, I don't know if I can change the instance name with code on the fly without using creation code. (The spawning system will spawn the same object every time, so I need the enumerator to identify each instance of the object)
If this is impossible, is it possible for the ped (or whatever other object such as the police AI) to check the PIN variable in every car, until it finds its car and can go to it?