array vs simple
#1

so i got like 50-100 objects and i was wondering whats the best way to add them to gamemode.

should i simply add them createdynamicobject for each one or should i use an array?

like
PHP код:
{x1,z1,y1},
{
x2,z2,y2
and create a function that loops trough the array and creates the objects?
Reply
#2

why'd you create a variable? are you going to use them later on? move/destroy them? or are they just gonna be there?
Reply
#3

If you're tracking them for later usage, then you could use an array. This would also be an idea if you are doing a 'reload map' function.
Reply
#4

i wanted to use the same coordinates to create a checkpoint at every object.
in this case,an array would be better right?
Reply
#5

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
i wanted to use the same coordinates to create a checkpoint at every object.
in this case,an array would be better right?
What's the point in linking both anyways? that's not going to affect anything, if you're going to use the objects later then okay you can define variables to link them to it, otherwise nah just create it normally no point in creating useless variables.
Reply
#6

it would`ve been easier for me to loop trough the array to create the objects and also use the array afterward for a random cp..
Reply
#7

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
it would`ve been easier for me to loop trough the array to create the objects and also use the array afterward for a random cp..
Why use an array for objects you'll never use later on hah?
Reply
#8

You dont get it.

I am going to use the array to generate a random cp(same coordinates as the objects). In this case,if the array is there why shouldnt i use it to generate the objects too?
Reply
#9

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
You dont get it.

I am going to use the array to generate a random cp(same coordinates as the objects). In this case,if the array is there why shouldnt i use it to generate the objects too?
because i highly doubt this'll be accurate seeing as the spot of cps wouldn't be same as the exact building's coords, my point stands, you don't need to link them to anything unless if you use (move/destroy..etc) them.
Reply
#10

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
because i highly doubt this'll be accurate seeing as the spot of cps wouldn't be same as the exact building's coords, my point stands, you don't need to link them to anything unless if you use (move/destroy..etc) them.
i said,the coords of the cp will be the exact same as the objects cp`s..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)