Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Dico), 16,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse Mode for an Adventure Game #303977
01/04/10 07:05
01/04/10 07:05
Joined: Dec 2009
Posts: 9
Dorkimim Offline OP
Newbie
Dorkimim  Offline OP
Newbie

Joined: Dec 2009
Posts: 9
Hello everybody. I am making 3d Adventure Game and want to use mouse mode like in Syberia. I'm relatively new to the 3d gamestudio.
I've tried the script for RTS from AUM, it works well... but only if you're lookin from top under 90 degrees...
Somehow i just need to attach mouse to the floor, but unfortunately i don't know how.
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

var camera_height;
var cheburek = 0;
var mouse[3];

BMAP cursor_pcx = "cursor.pcx";
///////////////////////////////


function main()
{
	level_load ("mouse.wmb");
	wait (2);
	mouse_mode = 1;
	mouse_map = cursor_pcx;
	
	vec_set(camera.x,vector(0,0,1000)); // set a static position for the camera
	vec_set(camera.pan,vector(0,-90,0)); // set the correct orientation for the camera
	
	while(1)
	{
      mouse_pos.x = mouse_cursor.x;//*sin(90-my.tilt);
      mouse_pos.y = mouse_cursor.y;


	wait(1);
   }
}

action my_car()
{
	
   //rel_for_screen(mouse_pos.x, camera);
	while (1)
	{	
	    	
	    IF (mouse_left)   //EVENT_TYPE == EVENT_CLICK)  
       {  
           cheburek = 0;  
  
           WHILE (cheburek == 0) // wait for the target to be set (lmb click)  
           {  
                 IF (MOUSE_LEFT == 1)  
                 {  
                       
                       
                       cheburek = 1; // target has been set  
                       camera_height = vec_dist(camera.x, my.x);
                       
                       temp.X = MOUSE_POS.x;  
                       temp.Y = MOUSE_POS.Y;  
                       temp.Z = camera.z - my.z;  
                       
                       vec_for_screen (temp, camera); // temp holds pointer's coords now  
        
                       vec_sub (temp, vector(my.x, my.y, my.z));  
                       vec_to_angle (mouse, temp); // rotate unit towards mouse  
                       vec_set(my.pan, vector(mouse.x, mouse.y - mouse.y, mouse.z - mouse.z));
                       MY.SKILL15 = 500     ; // maximum path length = fuel :)  
                     
                       WHILE (abs(MY.X - mouse_pos.x) + abs(MY.Y - mouse.y) > 5 && MY.SKILL15>0) // stops near the mouse pointer   
                       {   
                             
                             c_move(my, vector(15*time_step, 0, 0), vector(0,0,0), GLIDE);
                             MY.SKILL15 -= 500*time_step; // burn fuel  
                             
                             WAIT (1);  
                       }  
                          
                }  
                WAIT (1);  
          }  
     }  
	   
		// move the car using relative_speed
		if (key_a)
		{my.pan += 3*time_step;} // increase the pan angle of the car
		if (key_s)
			{
			my.pan -= 3*time_step;
			} // decrease the pan angle of the car
		if (key_space ) // press and hold the "Space" key to move the car
		{
			c_move (my, vector(15*time_step, 0, 0), vector(0,0,0), GLIDE);
		}
		wait (1);
	}
}




I hope that here are a lot of experoenced and intelegent people, who had faced such troubles in the past.

Re: Mouse Mode for an Adventure Game [Re: Dorkimim] #304232
01/05/10 23:15
01/05/10 23:15
Joined: Dec 2009
Posts: 9
Dorkimim Offline OP
Newbie
Dorkimim  Offline OP
Newbie

Joined: Dec 2009
Posts: 9
i'm sure someone know that. Help please


Moderated by  HeelX, rvL_eXile 

Gamestudio download | 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