Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 838 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Third Person Shooter, questions #227713
09/15/08 20:40
09/15/08 20:40
Joined: Sep 2008
Posts: 68
T
Tai Offline OP
Junior Member
Tai  Offline OP
Junior Member
T

Joined: Sep 2008
Posts: 68
I have been trying for a while to find an actual third person camera/movement code, IE; following the mouse with the look, and moving with WASD keys. Does anyone have any sort of suggestions on how this could be done,(With Lite-C) or an actual code?

Oh yes, one other thing, does anyone know how to convert the minimap from AUM to Lite-C, or could you get a script to do the same thing?

-Thanks, Tai

EDIT: One more quick thing, how would you add a crosshair to a script, because I have been unable to find such.

Last edited by Tai; 09/15/08 20:41. Reason: additions
Re: Third Person Shooter, questions [Re: Tai] #227723
09/15/08 21:21
09/15/08 21:21
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Here something that will give you a start.

Code:
action my_player()

{ 

       player = my; // I'm the player

       set (my, INVISIBLE); // no need to see player's model in 1st person mode

       while (1)

       {

               // move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed

               c_move (my, vector(20 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);

               if (mouse_left) // if the player presses the left mouse button

               {

                       fire_bullets(); // call this function

               }

               vec_set (camera.x, player.x); // use player's x and y for the camera as well

               camera.z += 30; // place the camera 30 quants above the player on the z axis (approximate eye level)

               camera.pan -= 5 * mouse_force.x * time_step; // rotate the camera around by moving the mouse

               camera.tilt += 3 * mouse_force.y * time_step; // on its x and y axis

               player.pan = camera.pan; // the camera and the player have the same pan angle

               wait (1);

       }

}




renny


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

Re: Third Person Shooter, questions [Re: Tai] #227729
09/15/08 21:39
09/15/08 21:39
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
In lite-c contributions there is kingdom of hearts.
What minimap are you talking about.
Look on the AUM site or wiki for crosshair


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Re: Third Person Shooter, questions [Re: Nidhogg] #227774
09/16/08 03:28
09/16/08 03:28
Joined: Sep 2008
Posts: 68
T
Tai Offline OP
Junior Member
Tai  Offline OP
Junior Member
T

Joined: Sep 2008
Posts: 68
Sadsack: Thanks! I'll take a look at the code and see what I can do.

Nidhogg: Ah, the minimap is from AUM number 27, and I'll take a look at the wiki for the crosshair and the movement.

Re: Third Person Shooter, questions [Re: Tai] #227775
09/16/08 04:01
09/16/08 04:01
Joined: Sep 2008
Posts: 68
T
Tai Offline OP
Junior Member
Tai  Offline OP
Junior Member
T

Joined: Sep 2008
Posts: 68
Alright, so after implementing the given code, it does not attach to the entity? The other portions of the movement code seem to working, however.

Re: Third Person Shooter, questions [Re: Tai] #227782
09/16/08 05:25
09/16/08 05:25
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
What do you mean by attach - doesn't attach the action or
doesn't attach the camera.. Please be more specific..

try this minimap for lite-c - untested
Code:
//minimap from aum 27
VIEW* top_view
{
	layer = 15;
	pos_x = 0; // appears in the upper left corner of the screen
	pos_y = 0; 
	size_x = 200;
	size_y = 150;
	tilt = -90;
	arc = 80; // zoom factor
}

///////////////////////////////////////////////////////////////////////////////////////////////////////

init_topcam_startup()
{
	while (player == null) {wait (1);}
	while (1)
	{
		if (key_t == 1)
		{
			while(key_t == 1) {wait(1);}
			if is(top_view,VISIBLE) 
			{
				reset(top_view,VISIBLE);
			}
			else
			{
				set(top_view,VISIBLE);
			}
		}
		top_view.x = player.x;
		top_view.y = player.y;
		top_view.z = 1000; // play with this value
		wait (1);
	}
}


If you have any other problems do the tutorials read the manual and
have a look at resources, wiki, aum etc..

Good luck..


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus

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