Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
using c_trace ?? #249188
01/31/09 20:34
01/31/09 20:34
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
c_trace ( my.pan, enemy.x, IGNORE_ME|IGNORE_PASSABLE|ACTIVATE_SHOOT );

1. Why *does* the above compile when enemy.x isn't a vector (out of curiosiy) ?

2. What I am trying to learn is how to get my model to c_trace a static model. When I pan my model, it hits the target regardless of its pan .

action shooter()
{

while(1)
{

vessel.y += 15 * (key_d-key_a) * time_step;
vessel.x += 15 * (key_w-key_s) * time_step;
vessel.pan += 10 * (key_z-key_x) * time_step;

wait(1);

if(key_c)
c_trace ( vessel.pan, enemy.x, IGNORE_ME|IGNORE_PASSABLE|ACTIVATE_SHOOT );
wait(1);
}

}

To sum up, I can't target my enemy, I alway hit it ?

thanks

drac

Re: using c_trace ?? [Re: dracula] #249191
01/31/09 20:47
01/31/09 20:47
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline
Serious User
Blade280891  Offline
Serious User

Joined: Jan 2008
Posts: 1,580
try doing

vector(enemy.x) ?


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: using c_trace ?? [Re: Blade280891] #249227
02/01/09 09:23
02/01/09 09:23
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Actually, the above code is working. What I can't do, is to send the c_trace beam directly in front of the model. I always hit the target regardless of my pan position. I have proved this by drawing a line between the model and the target.
Any ideas please ?

Thanks

Re: using c_trace ?? [Re: dracula] #249228
02/01/09 09:43
02/01/09 09:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Because c_trace checks between two POINTS, so pan angle is immaterial.

Try using looking into using C_SCAN instead of c_trace.
I cant help much with that cause I have BAAAD vrctor skills.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: using c_trace ?? [Re: EvilSOB] #249276
02/01/09 15:21
02/01/09 15:21
Joined: Sep 2003
Posts: 928
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 928
But your code cant work at all because youre confusing an angle with a position?

"pan" is an angle, which is how you rotate something. You can not put a point at an angle. You can put a point at a position. So its c_trace(my.x.. and not c_trace(my.pan..., hope this helps.

For hitting not an enemy but an imaginary point in front of the model just use:

VECTOR imaginarypoint;
vec_for_angle(imaginarypoint,my.pan);
vec_scale(imaginarypoint,1000);
vec_add(imaginarypoint,my.x);
c_trace(my.x,imaginarypoint,.....);


Re: using c_trace ?? [Re: Spirit] #249282
02/01/09 15:35
02/01/09 15:35
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Hi Spirit

What you suggested works, thanks.

Thanks



Last edited by dracula; 02/01/09 15:52.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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