Gamestudio Links
Zorro Links
Newest Posts
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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,086 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: reading BMAP's [Re: Widi] #277953
07/11/09 16:24
07/11/09 16:24
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
thank you...I considered the fact that as long as I do not assign a value to a var I can go on forever(just about).
var ah, ba, ca, da, ga, ma, re = 0;
that would initialize all to 0 correct? or am I on some sort of drug?


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: reading BMAP's [Re: Nowherebrain] #277955
07/11/09 16:37
07/11/09 16:37
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
No, use
var ah = 0, ba = 0, da = 14, ga =15325678, ma = 4;

Re: reading BMAP's [Re: Widi] #277961
07/11/09 17:35
07/11/09 17:35
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
ok, thanks.

I'm still getting these errors...I have no idea why...
Empty pointer...thought it was player, but I moved the code to the players action and I get the same result...no surprise really.
The second skin also exists...so that should not be the cause.
Finally the BMAP is not locked or messed with unless c_trace hit something so....I am at a loss.
I will read some more...


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: reading BMAP's [Re: Widi] #277966
07/11/09 17:51
07/11/09 17:51
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
The big question is, does it work?
It wont work for the wiki's "Terrain MultiTex" terrain. Here

If thats the case, use this
Code:
var fmt, pxl; COLOR tmpC;

	c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|SCAN_TEXTURE);
	if(trace_hit)
	{
		my.ambient = -55;
		BMAP* shadows = ent_getskin(you,3);  //<<shadowmap skin number
		fmt = bmap_lock(shadows,0);
		pxl = pixel_for_bmap(shadows,hit.u1,hit.v1);
		bmap_unlock(shadows);
		pixel_to_vec(tmpC, NULL, fmt, pxl);
		my.ambient = my.ambient + ((tmpC.red + tmpC.green + tmpC.blue) / 3);
	}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: reading BMAP's [Re: EvilSOB] #277970
07/11/09 17:57
07/11/09 17:57
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
No, but I am using a multitexture shader, skin2 is the shadow map.
I moved it into the terrain action and replaced my with player.
I also changed hit.skin2 to my.skin2...which is giving me new problems....
I will try this. I may need to find a new method..I have pent all day trying to get this working.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: reading BMAP's [Re: Nowherebrain] #277971
07/11/09 18:02
07/11/09 18:02
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Yes, that was it....so setting a bmap pointer to the appropriate entskin....
good thinking, thank you...I'm sorry you practically wrote this for me.....give me a heads up if I can give you a hand with something sometime...like a mafia thing.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: reading BMAP's [Re: Nowherebrain] #277973
07/11/09 18:13
07/11/09 18:13
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Sounds like youre going the wrong way, this should go into the PLAYER action.
And you have to stick with HIT.skin2 as the entity structure doesnt have a
skin1 or skin2 property.

I take it your trying to get your player to change his brightness according
to the ground (shadowmap) underneath him.

Try this, just before the wait(1) at the end of the player-action main loop.
Code:
...
my.ambient = -55;
var fmt, pxl;	COLOR tmpC;
you = NULL;
c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_MAPS|IGNORE_MODELSS|IGNORE_SPRITES|SCAN_TEXTURE);
if(you)
{
	fmt = bmap_lock(hit.skin2,0);
	pxl = pixel_for_bmap(hit.skin2,hit.u2,hit.v2);
	bmap_unlock(hit.skin2);
	pixel_to_vec(tmpC, NULL, fmt, pxl);
	my.ambient = my.ambient + ((tmpC.red + tmpC.green + tmpC.blue) / 3);
}
...
...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: reading BMAP's [Re: EvilSOB] #277980
07/11/09 18:40
07/11/09 18:40
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
I wanted to keep it separate as I will likely call it for many models during their first few frames(static models)...I initially am setting it for the player..who in time will get it called only at key intervals...key_pressed/key_any or whatever best will suit it.
here is how I set it now...
Code:
function player_ambient()
{
var fmt, pxl; COLOR tmpC;

	c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|SCAN_TEXTURE);
	if(trace_hit)
	{
		my.ambient = -120;
		BMAP* shadows = ent_getskin(you,2);  //<<shadowmap skin number
		fmt = bmap_lock(shadows,0);
		pxl = pixel_for_bmap(shadows,hit.u1,hit.v1);
		bmap_unlock(shadows);
		pixel_to_vec(tmpC, NULL, fmt, pxl);
		my.ambient = my.ambient + ((tmpC.red + tmpC.green + tmpC.blue) / 3) * 0.784;
	}
	
}




Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: reading BMAP's [Re: Nowherebrain] #277983
07/11/09 18:58
07/11/09 18:58
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Aha, so its working well. Tis good.
Catch ya round...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: reading BMAP's [Re: EvilSOB] #278020
07/11/09 20:34
07/11/09 20:34
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Yes thank you.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Page 2 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