|
1 registered members (Grant),
999
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
how to tell an entity to trace around itself
#268036
05/27/09 09:50
05/27/09 09:50
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
I've been fooling around at this for to long... I require my enemy to check around him self, so that he can alert other troops. This would be simple, but I just can't get my enemies to trace around themselves... All I require is the math envolved, so that I can learn from it. Once I have "vec_set(temp,my.x) ->->-> if(result!=0){".... I can take it from there... if you need more info, please ask. This is very important, as ill be sharing this project on my website  and is also important to my ready to blow up brain  thanks.
|
|
|
Re: how to tell an entity to trace around itself
[Re: DLively]
#268040
05/27/09 09:58
05/27/09 09:58
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
You could either use the sinus function http://www.conitec.net/beta/avar-sin.htmor you can do it without any math - for this you would need some vertices around the model or a dummy model which contains the vertices and does move with the parent entity. You could get the position of them and do traces from the origin to the vertices.
no science involved
|
|
|
Re: how to tell an entity to trace around itself
[Re: DLively]
#268123
05/27/09 14:15
05/27/09 14:15
|
Joined: Nov 2008
Posts: 946
the_clown
User
|
User
Joined: Nov 2008
Posts: 946
|
|
|
|
Re: how to tell an entity to trace around itself
[Re: Rasch]
#268149
05/27/09 17:01
05/27/09 17:01
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
One Scan per second should be enough. Even one scan per entity could be eventually enough, it depends on the situation. Why should they retrigger and retrigger the alert again? Insteat of that, I would try to "pass" the alert through the enemies. One enemy alerts another and so forth. If an enemy is alerted, set a flag of this enemy and exclude him from scanning.
But - a scan goes through walls. Maybe you donŽt want this. In this case, a scanned entity should trace back to the scanning entity. When the trace can reach (hit) the scanning entity, youŽll know that they can "see" each other.
no science involved
|
|
|
Re: how to tell an entity to trace around itself
[Re: fogman]
#268156
05/27/09 17:39
05/27/09 17:39
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
I wish i could pull of the second senerio, fogman  but I dont have that knowledge yet. accually, my enemy is currently set up, so that hes in "unaware" mode, and when I shoot him, he points to where I am, where it creates the sphere, and if there is another enemy around, its asks if its in alert mode already, and if not, then he will be. Then if he is a certain distance close, he will shoot. and if you run, he will chase, but only if you get far enough away  I've figured it out btw  I used the entity idea.
action distchecker{
my.alpha = 0;
my.transparent = on;
my.passable = on;
my.distslotno = 1;
while(1){wait(1);
vec_for_vertex(my.dist_main, me, 13);
vec_for_vertex(my.dist_spot, me, my.distslotno);
c_trace(my.dist_spot,my.dist_main,ignore_me + use_box);
if(result!=0){
if(you!=null){
if(you.state==unaware||you.state==hurt){you.state = point;}
}
}
my.distslotno += 1;
if(my.distslotno >= 37){break;}
}
ent_remove(me);
}
and then when the next one makes a sphere, the others around him will activate. Ill be putting out this resource file when im finished with it. Thanks for all your help.
Last edited by DevoN; 05/27/09 17:40.
|
|
|
Re: how to tell an entity to trace around itself
[Re: DLively]
#268495
05/29/09 16:54
05/29/09 16:54
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
it could be even more cheap :P instead of tracing to vertices or doing c_scan, you could vec_dist... use that between the enemies, and if they are below a certain threshold away from each other, do a single trace, if the trace hits, they can "see" each other. vec_dist is lots faster then c_scan, only thing you're left with is a single trace, doing that once in a while shouldnt matter at all  good luck,
|
|
|
|