Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
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
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
split-screen #341982
09/22/10 13:11
09/22/10 13:11
Joined: Sep 2010
Posts: 13
russia
V
Vladant Offline OP
Newbie
Vladant  Offline OP
Newbie
V

Joined: Sep 2010
Posts: 13
russia
Hello I am from Russia. I do not speak English, and Russian-speaking forums GameStudio I found and decided to ask a question here. Like Lite-c to the regime of separate screen, a second camera, I heard that this can be done with the form. Help please.

Re: split-screen [Re: Vladant] #341983
09/22/10 13:18
09/22/10 13:18
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hello and welcome!

You have to declare two separate views:

VIEW* view_split1 = { layer = 1; }
VIEW* view_split2 = { layer = 1; }

function init_splitscreen() {
set(view_split1,SHOW);
set(view_split2,SHOW);
reset(camera,SHOW);

view_split1.size_x = screen_size.x;
view_split1.size_y = screen_size.y/2;

view_split2.size_x = screen_size.x;
view_split2.size_y = screen_size.y/2;
view_split2.pos_y = screen_size.y/2;
}


Call this function at the end of your main-function. Now move these views independently, for instance by two player actions:

action player_one() {
view_split1.genius = me;
while(1) {
my.pan += (key_a-key_d)*10*time_step;
c_move(me,vector((key_w-key_s)*20*time_step,0,0)),nullvector,IGNORE_PASSABLE | GLIDE);
vec_set(view_split1.x,my.x);
vec_set(view_split1.pan,my.pan);
wait(1);
}
}

action player_two() {
view_split2.genius = me;
while(1) {
my.pan += (key_cul-key_cur)*10*time_step;
c_move(me,vector((key_cuu-key_cud)*20*time_step,0,0)),nullvector,IGNORE_PASSABLE | GLIDE);
vec_set(view_split2.x,my.x);
vec_set(view_split2.pan,my.pan);
wait(1);
}
}

Control player one with WASD, player two with the cursor keys.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: split-screen [Re: Vladant] #341984
09/22/10 13:22
09/22/10 13:22
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
As you can't speak much english, hopefully this should help:
Code:
#include <acknex.h>
#include <default.c>

VIEW* camera2 = { //create 2nd view
    flags = SHOW;
}

void main(){
    
    video_mode = 8;
    wait(1);
    
    camera.size_x = screen_size.x / 2 - 2; //make camera only 1/2 the size of the screen
    
    camera2.size_x = screen_size.x / 2 - 2; //make camera2 only 1/2 the size of the screen
    camera2.pos_x = screen_size.x / 2 + 4; //move camera2 over the the right side
    
    level_load(NULL); //load a blank level
    
    ent_create(CUBE_MDL, vector(50, 0, 0), NULL); //create an object just for a reference point
    
    while(1){
        camera.x += (key_w-key_s) * time_step; //move camera on W and S
        camera2.x += (key_cuu-key_cud) * time_step; //move camera2 on cursorUp and cursorDown
        wait(1);
    }
}


and welcome!

Re: split-screen [Re: MrGuest] #341986
09/22/10 13:26
09/22/10 13:26
Joined: Sep 2010
Posts: 13
russia
V
Vladant Offline OP
Newbie
Vladant  Offline OP
Newbie
V

Joined: Sep 2010
Posts: 13
russia
Thank you that is necessary. Have a nice day

Re: split-screen [Re: Vladant] #342055
09/22/10 23:24
09/22/10 23:24
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Hi,
here is some code I am using to make a tank game.

Code:
#include <acknex.h>
#include <default.c>

ENTITY* blue_tank;


VIEW* camera2 =

{ 

       pos_x = 0;

       pos_y = 390;
       
       pos_z = 0;

       size_x = 1024;

       size_y = 380;

       flags = VISIBLE;

}



VIEW* camera1 =

{ 

       pos_x = 0;

       pos_y = 0;
       
       pos_z = 0;

       size_x = 1024;

       size_y = 360;

       flags = VISIBLE;

}


action blue_tank()
{
	wait(1);		 c_updatehull(me,0); 
 	while (1)
	{	
		if((my.floor_dist=c_trace(me.x, vector(me.x,me.y,me.z-100), IGNORE_ME|USE_POLYGON)))
		{	my.z -= my.floor_dist+my.min_z;		}	//crude gravity/floor-matching code

		if (key_a)
			my.pan += 3*time_step; // increase the pan angle of the car
		if (key_d)
			my.pan -= 3*time_step; // decrease the pan angle of the car
		if (key_w ) 
			c_move (my, vector(2*time_step, 0, 0), nullvector, GLIDE);
		if (key_s ) 
			c_move (my, vector(-2*time_step, 0, 0), nullvector, GLIDE);
		wait (1);
		
		vec_set(camera1.x,my.x);
vec_set(camera1.y,my.y);
vec_set(camera1.z,my.z-2);
vec_set(camera1.pan,my.pan); 
	}
}


action red_tank()
{
	wait(1);		 c_updatehull(me,0); 
 	while (1)
	{	
		if((my.floor_dist=c_trace(me.x, vector(me.x,me.y,me.z-100), IGNORE_ME|USE_POLYGON)))
		{	my.z -= my.floor_dist+my.min_z;		}	//crude gravity/floor-matching code

		if (key_j)
			my.pan += 3*time_step; // increase the pan angle of the car
		if (key_l )
			my.pan -= 3*time_step; // decrease the pan angle of the car
		if (key_i ) 
			c_move (my, vector(2*time_step, 0, 0), nullvector, GLIDE);
		if (key_k ) 
			c_move (my, vector(-2*time_step, 0, 0), nullvector, GLIDE);
		wait (1);
		
		vec_set(camera2.x,my.x);
vec_set(camera2.y,my.y);
vec_set(camera2.z,my.z-2);
vec_set(camera2.pan,my.pan); 
	}
}











function main()
{
	
  
  
  level_load ("tmap.wmb");
  wait (1);
  
  ent_create("blue_tank.mdl", vector(-460, 460,10),blue_tank);
  
  ent_create("red_tank.mdl", vector(460, -460,10),red_tank);
  
  

  
  

}


function init_startup()

{

       wait (-1);

       video_switch(8, 0, 0); // change the resolution to 1024 x 768 pixels

       camera.flags &= ~VISIBLE; // now hide the default camera

       // set the desired positions and angles for the 4 cameras

      
       // settings for camera 2

       vec_set (camera2.x, vector (0,0,0));

       camera2.pan = 0;

       camera2.tilt = 0;

       camera2.roll = 0;
       
     
       
       
       
       vec_set (camera1.x, vector (0,0,0));

       camera1.pan = 0;

       camera1.tilt = 0;

       camera1.roll = 0;
	
	
      
}




I have A7 Commercial .............. Now I just need to learn how to use it


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