Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 05:41
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, AndrewAMD), 1,278 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
some vec_dist problems #235120
11/06/08 02:18
11/06/08 02:18
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
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.
Re: some vec_dist problems [Re: onslaught147] #235138
11/06/08 07:01
11/06/08 07:01
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
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.
Re: some vec_dist problems [Re: onslaught147] #235145
11/06/08 07:35
11/06/08 07:35
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
y use the same name. Give unique index names for each entity. easier to control.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: some vec_dist problems [Re: delinkx] #235309
11/06/08 22:33
11/06/08 22:33
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
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.
Re: some vec_dist problems [Re: onslaught147] #235312
11/06/08 22:38
11/06/08 22:38
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
use entity pointers.

ENTITY* num_1;
ENTITY* num_2;
ENTITY* num_3;
ENTITY* num_4;

then assign them inside their actions...

action entity_1()
{
num_1 = me;
}

or if you don't want actions, create them using pointers...

num_1 = ent_create("model.mdl",vector(0,0,0),NULL);

Re: some vec_dist problems [Re: DJBMASTER] #235315
11/06/08 23:35
11/06/08 23:35
Joined: Sep 2007
Posts: 49
O
onslaught147 Offline OP
Newbie
onslaught147  Offline OP
Newbie
O

Joined: Sep 2007
Posts: 49
how would i do
action entity_1()
{
num_1 = me;
}

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.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1