i have an issue with x y and z dimensions of JK.
in a cog, the line VectorSet x,y,z refers to the GLOBAL co-ordinates
I need a line of code to find the x,y,z in relation to THE PLAYER.
ie, Y would be the direct distance away from the player, - and + X would be to its sides etc.
the reason i need this is due to JK clipping. I can create perfect translucent layering in smoke, but only if its timed perfectly, and placed perfectly. I need faster fading smoke templates to be created FURTHER away from the player, and slower fading smoke templates to be created closer. THere's about 4 different smoke fade speeds.*
heres the cog for creating smoke templates
# SMOKEGENERATOR.COG
# JKSG1 by Ruthven
# STAGE 3
# This cog is attached to a blank decor item. +createsmoke.
# It is created from one of the final staff exp
# smoke 3do anmation frames.
# This will create a few fading smoke 3do's.
# NOTE: We require special vector alterations to create perfect non clipping
# effects on the smoke 3do layers. GET HELP.
# There will be 4-5 different smoke templates, of varying fade speed.
symbols
message created
thing player
Flex maxdistance=6 local
thing dummy local
template smoke3dos=+testsmoke1 local
//template smoke3dos2
//int count=0 local
vector position local
vector rising local
vector spinning local
end
code
created:
##-------- INSERT SPECIAL CODE HERE-------##
// if the player is within a certain distance
If(Vectordist(Getthingpos(Getsenderref()), Getthingpos(Player)) < maxdistance){
position = VectorSet((Rand()-.5)*0.01, (Rand()-.5)*0.01, 0.0 + Rand()*0.005);
rising = VectorSet((0.25*(Rand()-0.5)), (0.25*(Rand()-0.5)), (0.15 + (Rand()/20)));
spinning = VectorSet(0.0, 0.0, (Rand()-.5)*400);
dummy = CreateThingAtPos(smoke3dos, GetThingSector(Getsenderref()), Vectoradd(Getthingpos(Getsenderref()), position), '0 0 0');
Setthinglook(dummy, Vectorsub(Getthingpos(dummy), Getthingpos(Player)));
SetThingVel(dummy, rising);
SetThingRotVel(dummy, spinning);
}
return;
end
any ideas?
* and for those wondering what the hell i'm on about, JK allows for non clipping of translucent layers if the one behind it was created or updated after the one in front.
in a cog, the line VectorSet x,y,z refers to the GLOBAL co-ordinates
I need a line of code to find the x,y,z in relation to THE PLAYER.
ie, Y would be the direct distance away from the player, - and + X would be to its sides etc.
the reason i need this is due to JK clipping. I can create perfect translucent layering in smoke, but only if its timed perfectly, and placed perfectly. I need faster fading smoke templates to be created FURTHER away from the player, and slower fading smoke templates to be created closer. THere's about 4 different smoke fade speeds.*
heres the cog for creating smoke templates
# SMOKEGENERATOR.COG
# JKSG1 by Ruthven
# STAGE 3
# This cog is attached to a blank decor item. +createsmoke.
# It is created from one of the final staff exp
# smoke 3do anmation frames.
# This will create a few fading smoke 3do's.
# NOTE: We require special vector alterations to create perfect non clipping
# effects on the smoke 3do layers. GET HELP.
# There will be 4-5 different smoke templates, of varying fade speed.
symbols
message created
thing player
Flex maxdistance=6 local
thing dummy local
template smoke3dos=+testsmoke1 local
//template smoke3dos2
//int count=0 local
vector position local
vector rising local
vector spinning local
end
code
created:
##-------- INSERT SPECIAL CODE HERE-------##
// if the player is within a certain distance
If(Vectordist(Getthingpos(Getsenderref()), Getthingpos(Player)) < maxdistance){
position = VectorSet((Rand()-.5)*0.01, (Rand()-.5)*0.01, 0.0 + Rand()*0.005);
rising = VectorSet((0.25*(Rand()-0.5)), (0.25*(Rand()-0.5)), (0.15 + (Rand()/20)));
spinning = VectorSet(0.0, 0.0, (Rand()-.5)*400);
dummy = CreateThingAtPos(smoke3dos, GetThingSector(Getsenderref()), Vectoradd(Getthingpos(Getsenderref()), position), '0 0 0');
Setthinglook(dummy, Vectorsub(Getthingpos(dummy), Getthingpos(Player)));
SetThingVel(dummy, rising);
SetThingRotVel(dummy, spinning);
}
return;
end
any ideas?
* and for those wondering what the hell i'm on about, JK allows for non clipping of translucent layers if the one behind it was created or updated after the one in front.
Code:
if(getThingFlags(source) & 0x8){ do her} elseif(getThingFlags(source) & 0x4){ do other babe} else{ do a dude}