|
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
OP
Serious User
|
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:
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: jcl]
#352434
01/03/11 17:16
01/03/11 17:16
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
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
Senior Member
|
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.  (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
OP
Serious User
|
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
|
|
|
|