|
|
Re: Drag entity at run time
[Re: harry3174]
#173526
12/30/07 19:28
12/30/07 19:28
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
Yes, because vec_for_screen convert screen XY position to world XY position, so there will be no problem in bird view. In front view, worldposition->x is the screen depth, it's difficult to convert it from screenpos->x or mouse_pos.x. You may try to search the forum to find a workaround, or try my solution : Code:
entity* ent; // selected entity var speed = 500; // play with 500
function deSelect() { if (ent != NULL) { ent = NULL; } mouse_pointer = 1; }
function selectMe() { if(event_type == event_click) { mouse_pointer = 0; ent = my; while(ent == my) { my.x += mouse_force.y * speed * time_step; my.y -= mouse_force.x * speed * time_step; wait(1); } } }
action clickMe { c_setminmax(my); sp = my; my.INVISIBLE = On; my.enable_click = on; my.event = selectMe;
while(my) { if (vec_dist(my.x,earth.x)< 50) // play with 50 { earth.INVISIBLE = On; my.INVISIBLE = Off; } wait(1); } }
on_mouse_left = deSelect; // put it outside any functions
|
|
|
Re: Drag entity at run time
[Re: harry3174]
#173531
01/03/08 10:43
01/03/08 10:43
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
Hello Harry,
Please upload your level (.wmp and .wdl) and describe what you exactly to achieve more clearly, then I can help you to complete your code and send it back to you.
Unless you're familiar with c-script, modify any part of the code that you don't understand didn't help.
x,y,z are preserved engine variables, better don't use it as global and local var.
Last edited by vlau; 01/03/08 10:48.
|
|
|
Re: Drag entity at run time
[Re: vlau]
#173532
01/04/08 04:24
01/04/08 04:24
|
Joined: Oct 2007
Posts: 85
harry3174
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2007
Posts: 85
|
Thank you sir, I am new to 3dgs and using Lite-C.Just complete lite-C work-shop.Here i attech. http://files.filefront.com/snapcdrar/;9375932;/fileinfo.htmlFor now the camera is on top view. The camera is only tilting but i wanted it to pan in all directions. In function main you use line : camera.tilt = -90;that i want to change as camera.pan = 90;.When user use arrow key ,camera should pan. Thanks Alpa
|
|
|
Re: Drag entity at run time
[Re: harry3174]
#173533
01/04/08 14:33
01/04/08 14:33
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
Here is the new level + wdl : drag_new Hope that solved all your problem.
|
|
|
Re: Drag entity at run time
[Re: vlau]
#173534
01/07/08 06:36
01/07/08 06:36
|
Joined: Oct 2007
Posts: 85
harry3174
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2007
Posts: 85
|
Thank you very much for kind co-operation Sir. Earth entity moves along the walls. It can’t in touch with sp entity. I am not able to explain properly to you what i want to do. So I attach exe here with which is made in director 3d. I want to do that with game studio. In drag_new (which was you sand ) when I use arrow key its rotate properly. This pan effect I want in that level which I send previously. http://files.filefront.com/24+heartrar/;9393803;/fileinfo.htmlPlease help me. Thanks
|
|
|
Re: Drag entity at run time
[Re: harry3174]
#173535
01/07/08 08:19
01/07/08 08:19
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
The test level works fine here, you've to move your mouse slowly to drag it close to the sp_entity.
If you need someone to write a program just like your demo, you may post it on the Job Offer forum.
Good luck!
EDIT ---- Just some hints : c_trace work different than modelsunderray in Director3D, it return the closest model only.
Last edited by vlau; 01/07/08 08:36.
|
|
|
|