View previous topic :: View next topic |
Author |
Message |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Wed Jul 29, 2009 3:13 pm Post subject: my cheaplittle watersplash effect |
|
|
yep im trying to use the te_teleport effect for when you enter water..kinda so this is what i got
in client qc in playerpost think:
Code: | // check to see if player landed and play landing sound
if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0))
{
local vector org;
if (self.watertype == CONTENT_WATER)
{
sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TELEPORT);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
else if (self.jump_flag < -650)
...... |
it compiles and wnt crash the server, but it splash :\
???? _________________ bah |
|
Back to top |
|
 |
Team Xlink
Joined: 25 Jun 2009 Posts: 320
|
Posted: Wed Jul 29, 2009 11:51 pm Post subject: Re: my cheaplittle watersplash effect |
|
|
MeTcHsteekle wrote: | yep im trying to use the te_teleport effect for when you enter water..kinda so this is what i got
in client qc in playerpost think:
Code: | // check to see if player landed and play landing sound
if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0))
{
local vector org;
if (self.watertype == CONTENT_WATER)
{
sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TELEPORT);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
else if (self.jump_flag < -650)
...... |
it compiles and wnt crash the server, but it splash :\
???? |
You really mean that this code will create water splash's without crashing the server?
Awesome! _________________
Anonymous wrote: | if it works, it works. if it doesn't, HAHAHA! |
|
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Thu Jul 30, 2009 12:59 am Post subject: |
|
|
(self.flags & FL_ONGROUND)
your player is unlikely to be on the ground when entering in to water.
even if the pool is shallow. _________________ What's a signature? |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Thu Jul 30, 2009 1:18 am Post subject: |
|
|
ah i see, thanks spike :O.
Team: no not yet, i tried to communicate that i had a problem, but didn't quite put it in writing correctly _________________ bah |
|
Back to top |
|
 |
Team Xlink
Joined: 25 Jun 2009 Posts: 320
|
Posted: Thu Jul 30, 2009 2:15 am Post subject: |
|
|
Oh well.
Good luck!
You could submit this as a tutorial here as well. _________________
Anonymous wrote: | if it works, it works. if it doesn't, HAHAHA! |
|
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Thu Jul 30, 2009 2:21 am Post subject: |
|
|
alright, i separtated it from te landing sound part
so now in playerpostthink in client qc i got this under it
and it still wont work
Code: | // cheack to see if player landed in water and make splash
if ((self.jump_flag < -300) && (self.flags & FL_INWATER) && (self.health > 0))
{
vector org;
if (self.watertype == CONTENT_WATER)
{
spawn_tfog (org);
}
else if (self.watertype == CONTENT_SLIME)
{
spawn_tfog (org);
}
else if (self.watertype == CONTENT_LAVA)
{
spawn_lburn (org);
}
|
and for the lburn i made this lil shit in triggers.qc in hope to have the orange particle effect from the lighting gun.. i mean thunderbolt:
Code: | void(vector org) spawn_lburn =
{
s = spawn ();
s.origin = org;
s.nextthink = time +0.2;
s.think = play_teleport;
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}; |
i think that s.think there might not be good, perhaps a sub_remove or something would be better?
any more thoughts, im trying to learn from mistakes :S _________________ bah |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Thu Jul 30, 2009 3:35 am Post subject: |
|
|
alright update:
this works it a bit:
Code: | if (self.waterlevel == 1)
{
vector org;
| instead of what i had for the start before
but it makes the teleport zing sounds somewhere, so i assume the particle effect is with it, just not on the player
the lava one just crashes the server ..with a bad sever message, whatevah that is _________________ bah |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Thu Jul 30, 2009 9:08 pm Post subject: |
|
|
hmm i think i made a step in the right direction, buit it still isn;t working
this is what i got in playerprethink this time:
Code: | if ( !(self.flags & FL_INWATER) )
{
//player enter water effects
if (self.watertype == CONTENT_LAVA)
self.effects = self.effects + EF_BRIGHTFIELD;
else if (self.watertype == CONTENT_WATER)
self.effects = self.effects + TE_TELEPORT;
else if (self.watertype == CONTENT_SLIME)
self.effects = self.effects + TE_TELEPORT;
else
self.effects = self.effects;
// player enter water sound
if (self.watertype == CONTENT_LAVA)
sound (self, CHAN_BODY, "player/inlava.wav", 1............................. |
all i can get is bright field for some reason, and i guess somehow ill neeed to make it only show up for a second
hmm.. i think removal will have to be worked in at playerpostthink??? _________________ bah |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Thu Jul 30, 2009 9:13 pm Post subject: |
|
|
You're not checking if your effects already contain the effects bits you're adding. Bad move. _________________ Apathy Now! |
|
Back to top |
|
 |
Tomaz
Joined: 05 Nov 2004 Posts: 49
|
Posted: Fri Jul 31, 2009 12:20 pm Post subject: |
|
|
First off, TE_LIGHTNING2 is not a particle effect, unless you use an engine that has it as a particle effect, but it still just a long beam and takes more input that just 1 origin, it takes an entitynum, a start origin and an end origin, hence why it crashed for you.
Secondly, you can not add TE_TELEPORT as an effect, its not an effect, its a temporary entity. |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Fri Jul 31, 2009 12:35 pm Post subject: |
|
|
..wait, so then which part makes the particle effect?  _________________ bah |
|
Back to top |
|
 |
Tomaz
Joined: 05 Nov 2004 Posts: 49
|
Posted: Fri Jul 31, 2009 12:38 pm Post subject: |
|
|
That depends on which particle effect youre after. |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Fri Jul 31, 2009 12:39 pm Post subject: |
|
|
The orange particle effect from lightning is just done using the particle() function, in the same way as blood. _________________ Apathy Now! |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Fri Jul 31, 2009 5:46 pm Post subject: |
|
|
MauveBib wrote: | The orange particle effect from lightning is just done using the particle() function, in the same way as blood. |
iii AY MICARDO !!!
alright i got it going here with that :
Code: | //player enter water effects
if (self.watertype == CONTENT_LAVA)
particle(self.origin,'0 0 0',222,30);
particle(self.origin,'0 0 5',221,30);
particle(self.origin,'0 0 5',220,30);
if (self.watertype == CONTENT_WATER)
particle(self.origin,'0 0 0',225,30);
particle(self.origin,'0 0 5',225,30);
particle(self.origin,'0 0 5',225,30);
if (self.watertype == CONTENT_SLIME)
particle(self.origin,'0 0 0',64,30);
particle(self.origin,'0 0 5',63,30);
particle(self.origin,'0 0 5',62,30); |
but the issue stands now that even with the content things it only does orange particles am i not doing the right checks? _________________ bah |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Fri Jul 31, 2009 6:36 pm Post subject: |
|
|
you need to bracket off the if statements:
Code: |
//player enter water effects
if (self.watertype == CONTENT_LAVA)
{
particle(self.origin,'0 0 0',222,30);
particle(self.origin,'0 0 5',221,30);
particle(self.origin,'0 0 5',220,30);
}
if (self.watertype == CONTENT_WATER)
{
particle(self.origin,'0 0 0',225,30);
particle(self.origin,'0 0 5',225,30);
particle(self.origin,'0 0 5',225,30);
}
if (self.watertype == CONTENT_SLIME)
{
particle(self.origin,'0 0 0',64,30);
particle(self.origin,'0 0 5',63,30);
particle(self.origin,'0 0 5',62,30);
}
|
_________________ Apathy Now! |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|