|
Re: How make player go to the point you clicked with mouse?
[Re: ]
#269233
06/02/09 11:01
06/02/09 11:01
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
@mercuryus the Walk to mouse is 3D. I get the player to move 1 time to the mouse, but when I click one more time to move it somewhere else, the player just turns and stay still...... I know it is something very easy to solve this, but I cant see it....... it is so frustrating.... 
Last edited by Eagelina; 06/02/09 11:01.
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: KiwiBoy]
#269239
06/02/09 11:07
06/02/09 11:07
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
tried to swap ignor passable with glide, but no change.... goes one time to the point I clicked and when I click somehwere else..... player just turns and stay still.... as I was writing to mercuryus , the answer is staring right in my face..... I know it, but I cant see it..... it is always an easy solution..... 
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: KiwiBoy]
#269242
06/02/09 11:12
06/02/09 11:12
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
@KiwiBoy :
Found the code that George wrote. It is in Aum 34. I am going to study it....
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: KiwiBoy]
#269243
06/02/09 11:13
06/02/09 11:13
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
ok going to look at that too
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: Eagelina]
#269319
06/02/09 17:17
06/02/09 17:17
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
How do I "translate" this to Lite-C ?
trace_mode = ignore_you + ignore_passable + use_box;
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: Stromausfall]
#269326
06/02/09 17:34
06/02/09 17:34
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
Thanks! I am learning fast here..... 
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: Eagelina]
#269345
06/02/09 19:02
06/02/09 19:02
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
Simply forgot to reset variabel_1? Not responsible for flaws / errors in code. Code is "sample" only.
VECTOR* pl_vDest = { x=0; y=0; z=0; } // player dest VECTOR
var pl_bDest = 0; // player dest VECTOR set (boolean)?
action player_mouseAct(){
c_setminmax(me);
VECTOR temp; vec_zero(temp);
while(1){
if(mouse_left==1){
pl_bDest = 1; // dest set
vec_set(pl_vDest, mouse_pos3d.x);
}
if (pl_bDest) {
vec_diff(temp, pl_vDest, my.x);
vec_to_angle(temp, temp);
temp.pan = ang(temp.pan - my.pan);
temp.pan = min(abs(temp.pan), 5 * time_step) * sign(temp.pan);
temp.tilt = 0;
temp.roll = 0;
c_rotate(me, temp, IGNORE_PASSABLE);
if(vec_dist(my.x, pl_vDest) > (my.max_x * 1.75)) {
c_move(me,vector(10*time_step,0,0),nullvector,IGNORE_ME|GLIDE|IGNORE_PASSABLE);
}
}
wait(1);
}
}
|
|
|
Re: How make player go to the point you clicked with mouse?
[Re: testDummy]
#269470
06/03/09 08:28
06/03/09 08:28
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
I did look and tried yours, like it, but cant make it work as I whant to. Thanks for the suggestion. And yes I have to reset the variabel_1. But when I do that the player never stops....
Last edited by Eagelina; 06/03/09 08:37.
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
|