Inside3D!
     

my cheaplittle watersplash effect
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Wed Jul 29, 2009 3:13 pm    Post subject: my cheaplittle watersplash effect Reply with quote

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
View user's profile Send private message AIM Address
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Wed Jul 29, 2009 11:51 pm    Post subject: Re: my cheaplittle watersplash effect Reply with quote

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
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Jul 30, 2009 12:59 am    Post subject: Reply with quote

(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
View user's profile Send private message Visit poster's website
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Thu Jul 30, 2009 1:18 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Thu Jul 30, 2009 2:15 am    Post subject: Reply with quote

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
View user's profile Send private message
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Thu Jul 30, 2009 2:21 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Thu Jul 30, 2009 3:35 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Thu Jul 30, 2009 9:08 pm    Post subject: Reply with quote

hmm i think i made a step in the right direction, buit it still isn;t working Confused

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
View user's profile Send private message AIM Address
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Thu Jul 30, 2009 9:13 pm    Post subject: Reply with quote

You're not checking if your effects already contain the effects bits you're adding. Bad move.
_________________
Apathy Now!
Back to top
View user's profile Send private message
Tomaz



Joined: 05 Nov 2004
Posts: 49

PostPosted: Fri Jul 31, 2009 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Fri Jul 31, 2009 12:35 pm    Post subject: Reply with quote

..wait, so then which part makes the particle effect? Confused
_________________
bah
Back to top
View user's profile Send private message AIM Address
Tomaz



Joined: 05 Nov 2004
Posts: 49

PostPosted: Fri Jul 31, 2009 12:38 pm    Post subject: Reply with quote

That depends on which particle effect youre after.
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Fri Jul 31, 2009 12:39 pm    Post subject: Reply with quote

The orange particle effect from lightning is just done using the particle() function, in the same way as blood.
_________________
Apathy Now!
Back to top
View user's profile Send private message
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Fri Jul 31, 2009 5:46 pm    Post subject: Reply with quote

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 Very Happy:

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 Confused am i not doing the right checks?
_________________
bah
Back to top
View user's profile Send private message AIM Address
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Fri Jul 31, 2009 6:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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