Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Akow, SBGuy), 1,423 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Decal staying always in front of the player #302577
12/20/09 16:08
12/20/09 16:08
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
Ok I tried everything but I didn't manage to make a decal which stays always in front of the player so that I can make a small red dot from the laser of the weapon and round decal from the flashlight. Give me a small code snippet which examinate that pls.

Re: Decal staying always in front of the player [Re: mEnTaL] #302595
12/20/09 18:26
12/20/09 18:26
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
as i understand you want to make a laser red dot which stays always on the surface(a wall for example) that is in the front of player like a crosshair but in 3d space.

is your camera fps or tps or anything else?
are you use template script or your own one?
which version you use (A6,A7,c-script,lite-c)?

anyway, the algorithm is one used in bullet hole code. instead of a hole-like bitmap you use a red dot one and instead of creating an entity(hole) for every bullet you create one entity in game start and set its position/rotation continuously (using bullet hole algorithm).

that is what you got to do.

also there is a high-end implementation called "projection" that needs use of complex shaders and i have no advise about that


every body got some dues in life to pay
Re: Decal staying always in front of the player [Re: DR_Black] #302615
12/20/09 20:31
12/20/09 20:31
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
the camera is FPS, I don't use templates, and I use Lite-c. I know the bullet hole code, but I can't make it create the decal once and then just move it to be always in the middle of the screen - projected on the 3d space. So i need help with that : )

Re: Decal staying always in front of the player [Re: mEnTaL] #302623
12/20/09 21:15
12/20/09 21:15
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
try whit this action (lite-c)

Code:
action target_act()
{
	set(my,ZNEAR);
	while(1)
	{
		vec_set(temp,vector(screen_size.x / 2,screen_size.y / 2,2000));
		vec_for_screen(temp,camera);
		if (c_trace(camera.x,temp,IGNORE_ME | IGNORE_YOU | IGNORE_PASSABLE))
		{
			vec_set(my.x,target.x);
			vec_to_angle(my.pan,normal);
			wait(1);
		}
	}
}



it will solve the problem. just put your red dot bitmap in your level (every level) and assign this action to it.


every body got some dues in life to pay
Re: Decal staying always in front of the player [Re: DR_Black] #302628
12/20/09 22:34
12/20/09 22:34
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
It works great. thank you!

Re: Decal staying always in front of the player [Re: mEnTaL] #309527
02/09/10 21:27
02/09/10 21:27
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
Hi. I bump that my old topic because I need a decal staying always in front of the player ( laser of weapon or flashlight trail), but I must make it by DECAL (ent_decal). The way with sprite adjusting its angles to the normal of the hit surface is not very realistic : ( So if you have experience in that things can you post the code snippet here pls laugh


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