Gamestudio Links
Zorro Links
Newest Posts
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
New Zorro version 3.11
by jcl. 07/21/26 13:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,282 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 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