Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,038 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Code to show model outline through obstacles? Slow cam rotation? [Re: Emre] #442604
06/26/14 14:53
06/26/14 14:53
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Originally Posted By: Emre
Originally Posted By: tolu619

Then how do I undo the hit.entity.alpha once the player is no longer behind a wall?

Try this code. it works fine with entity and terrain. I have no idea about level blcoks. sorry...

Code:
ENTITY* temp_ent;
function camera_follow(ENTITY* ent)
{
	while(1) 
	{		
		vec_set(camera.x,vector(-400,0,100));  // camera position relative to the player      
		vec_rotate(camera.x,ent.pan); // rotate the camera position with the player
		vec_add(camera.x,ent.x);      // add player position
		vec_set(camera.pan,vector(ent.pan,-10,0)); // look in player direction, slighty down 
		c_trace(camera.x, ent.x, IGNORE_ME | IGNORE_PASSENTS);
		
		if(HIT_TARGET)
		{
			
			if (hit.entity!=NULL)
			{
				if(temp_ent!=NULL) // undo translucent for previous entity
				{
					reset(temp_ent,TRANSLUCENT);
					temp_ent.alpha = 100;	
				}
				
				temp_ent=hit.entity;//handle for previous entity
				set(hit.entity,TRANSLUCENT);
				hit.entity.alpha = 60;	
			}
			
			
		}
		else //if no target, undo translucent for previous entity
		{
			if(temp_ent!=NULL)
			{
				reset(temp_ent, TRANSLUCENT);
				temp_ent.alpha = 100;	
			}
			
		}
		wait(1);
	}
}



It works perfectly for level entities like you said, but it isn't working for level blocks, and that's actually where I need it to work. Thanks.

Re: Code to show model outline through obstacles? Slow cam rotation? [Re: tolu619] #442640
06/27/14 19:21
06/27/14 19:21
Joined: Jul 2007
Posts: 620
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 620
Turkey, Izmir
I always use model, never use level blocks. as i said, i have no idea about level blocks. Sorry again. ):

Page 2 of 2 1 2

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