i have multiple copies of a entity and i need them to calculate the distance between each other but when i do vec_dist(me.x,entity.x) it returns zero because its calculated the dist from itself to itself. so how do i make the vec_dist look to other types of the same entity with the exact ssame name but only use its own position for the me.x portion of the equation?
The only thing in life you can depend on is death and taxes.
another question i have, it falls into the same category as the one above. i have several enemies and guns all called the same things. they are just copies of the original enemy and gun, but when i do vec_for_vertex(gun.x,enemy,#num) it makes the first made gun attach to the first made enemy. how do i make one gun attach to one entity for all my many copies no matter when they were made?
The only thing in life you can depend on is death and taxes.
i cant give them seperate names because its the same. i dont think u understand what i am askin. if i had one enemy and one gun it works perfectly fine. but if i copy it, the code still only works for the first enemy and gun and ignores the second pair. the second pair still moves and preforms there code but the vec_for_vertex is only set for the first pair. if i made different names i would have to copy the script in game which will be a problem whenever i want to change code because i will have to do that multiple times. so thanks for the responce but it doesnt really help. or i may miss interpret wat ur tryin to say and if tats the case u or someone else please elaborate
The only thing in life you can depend on is death and taxes.
if they all use the same script, tat will just make all of them be num_1 and the engine only using the first entity of the same name is my problem in the first place, am i screwed and just have to do the same code multiple times just to name each entity differently.
The only thing in life you can depend on is death and taxes.