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
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 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
Bug in c_trace with last A8 version #352413
01/03/11 15:09
01/03/11 15:09
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
I use a c_trace from player.x to player.x in order to check if he's into a passable entity to make the player swim. It worked perfectly on A7 and the previous A8 versions, but in the last 8.10.1 the player instead of swim simply falls to the ground like if c_trace doesn't detect anything. The water checker is a passable model with FLAG8.

This is the code I use to check:
Code:
c_trace(player.x, player.x, IGNORE_ME);
		if(swim==0 && you){
			if( (you.flags2 & PASSABLE|is(you, PASSABLE) ) && is(you, FLAG8) ) swim=1; else swim=0; 
		}



Last edited by painkiller; 01/03/11 15:10.

3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: Bug in c_trace with last A8 version [Re: painkiller] #352416
01/03/11 15:46
01/03/11 15:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I don't think that this can work, at least not with c_trace. You need to cast a ray for hitting a polygon, but at a length of 0 the ray can not hit anything.

In A6, there was a special mode to detect passable water blocks, but as to my knowledge this also required that the ray hit the surface of that block. I'm not sure though, this was quite long ago.

Since A7, we recommend using terrain for water. You can then simply check if the player is in water or not by comparing his position with the water surface. c_trace was not changed since A7.

Re: Bug in c_trace with last A8 version [Re: jcl] #352434
01/03/11 17:16
01/03/11 17:16
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Ok, I will do it what way, then, as a curiosity, why that worked for me on previous versions?


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: Bug in c_trace with last A8 version [Re: painkiller] #352458
01/03/11 19:39
01/03/11 19:39
Joined: Jan 2002
Posts: 300
Usa
Rich Offline
Senior Member
Rich  Offline
Senior Member

Joined: Jan 2002
Posts: 300
Usa
You can use terrain as a passable and invisible entity for water, and use another model, block, or asset to represent the visible water.

just use the passable_ent pointer with c_trace. If the trace origin or end is inside the passable terrain, the passable_ent pointer is set to the terrain. You could set one of the skills of the terrain, and have your script check this skill to detect is as water. laugh

(though I wish there was a way to detect when a player is inside a solid mesh / block for detecting if it accidentally became embedded in a solid after movement...)


A8 com / A7 free
Re: Bug in c_trace with last A8 version [Re: Rich] #352466
01/03/11 20:18
01/03/11 20:18
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
I've done it checking the relative position of the player to the water terrain, in order to check if the player is down and into its limits and then set a entity pointer of the water.


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB

Moderated by  jcl, Nems, Spirit, Tobias 

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