Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
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
3 registered members (AndrewAMD, kzhao, 7th_zorro), 714 guests, and 7 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
Page 1 of 2 1 2
Help please. modify a wdl code...... #334655
07/24/10 13:29
07/24/10 13:29
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
I would like to change this "sniper" effect into a magnifying glass effect. I have a detective that hunts for clues and i want to be able to press a button, maybe "m", and call this glass and it enlarges the item in the lens. can someone point me in the direction? Any help will be appreciated.

here's what i have so far as code. borrowed from AUM 46(thanks George).

Code:
/////////////////////////////////////////////////////////////////////////////////

entity lens_ent
{
	type = <sphere.mdl>;
	x = 700; // 700 quants ahead of the view
	y = 0; // and in the center of the view
	z = 0; // on the y and z axis (x and y on the screen)
	layer = 40; // give it a big layer
	flags = visible; // and make it visible
}

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

view lens_view
{ 
	layer = -10; // hide this view; we don't need to see it anyway
	flags = visible; // enable the view
	arc = -20; // give it a decent zoom factor (play with this value)
} 

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

starter init_lens()
{
	lens_view.pos_x = 0; // set the same position for the second (lens) view
	lens_view.pos_y = 0;
	lens_view.size_x = screen_size.x; // and the sam size with camera's size
	lens_view.size_y = screen_size.y;
	lens_view.bmap = bmap_for_entity (lens_ent, 0); // render the view on the lens_ent's bitmap (sphere.mdl's skin)
	while (1)
	{
		lens_view.x = camera.x; // keep the lens view in sync with the camera
		lens_view.y = camera.y;
		lens_view.z = camera.z;
		lens_view.pan = camera.pan;
		lens_view.tilt = camera.tilt;
		lens_view.roll = camera.roll;
		wait (1);
	}
}




My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Help please. modify a wdl code...... [Re: Blink] #334794
07/25/10 09:17
07/25/10 09:17
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
I think the code is ready to use, no need of further modification except putting the glass outside the screen and put it on screen when m is pressed

Re: Help please. modify a wdl code...... [Re: bart_the_13th] #334844
07/25/10 16:10
07/25/10 16:10
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
the code is a working code, but when i start the level to glass starts with it and i set a on_m = init_lens; it just starts by itself. and the view on the lens isnt manified at all, its actuall smaller than the actual object. also the lens is behind the plBipeds head and it follows him around because its a camera view and i am using the 3rd person cam.

Last edited by Blink; 07/25/10 16:57. Reason: error

My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Help please. modify a wdl code...... [Re: Blink] #334846
07/25/10 16:14
07/25/10 16:14
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Remove the () from on_m = init_lens();


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Help please. modify a wdl code...... [Re: alibaba] #334860
07/25/10 16:56
07/25/10 16:56
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
thats not the problem. i typed that wrong. the() isnt there. my mistake in my post.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Help please. modify a wdl code...... [Re: Blink] #334863
07/25/10 17:08
07/25/10 17:08
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
You have to convert the view entity to a world entity. And then you have to write an action for the world entity, to render the view on the texture of the entity and place the entity on the right place.



Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Help please. modify a wdl code...... [Re: alibaba] #334868
07/25/10 17:50
07/25/10 17:50
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
ok..dont know how to do that, thats why i asked for help.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Help please. modify a wdl code...... [Re: Blink] #334967
07/26/10 03:07
07/26/10 03:07
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Change the lens_view position to player position instead of camera post.

Code:
starter init_lens()
{
	lens_view.pos_x = 0; // set the same position for the second (lens) view
	lens_view.pos_y = 0;
	lens_view.size_x = screen_size.x; // and the sam size with camera's size
	lens_view.size_y = screen_size.y;
	lens_view.bmap = bmap_for_entity (lens_ent, 0); // render the view on the lens_ent's bitmap (sphere.mdl's skin)
	while (1)
	{
		lens_view.x = player.x; // keep the lens view in sync with the player
		lens_view.y = player.y;
		lens_view.z = player.z;
		lens_view.pan = player.pan;
		lens_view.tilt = player.tilt;
		lens_view.roll = player.roll;
		wait (1);
	}
}



Re: Help please. modify a wdl code...... [Re: bart_the_13th] #335013
07/26/10 11:08
07/26/10 11:08
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline OP

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Thanks, Bart. I made the change, and now i get the empty pointer error message when it runs.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Help please. modify a wdl code...... [Re: bart_the_13th] #335121
07/26/10 20:19
07/26/10 20:19
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
To avoid the empty pointer:
Code:
starter init_lens()
{
	lens_view.pos_x = 0; // set the same position for the second (lens) view
	lens_view.pos_y = 0;
	lens_view.size_x = screen_size.x; // and the sam size with camera's size
	lens_view.size_y = screen_size.y;
	lens_view.bmap = bmap_for_entity (lens_ent, 0); // render the view on the lens_ent's bitmap (sphere.mdl's skin)
	while (1)
	{
		if(player)
		{
			lens_view.x = player.x; // keep the lens view in sync with the player
			lens_view.y = player.y;
			lens_view.z = player.z;
			lens_view.pan = player.pan;
			lens_view.tilt = player.tilt;
			lens_view.roll = player.roll;
		}
		wait (1);
	}
}



Page 1 of 2 1 2

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