Dom_152 Posted November 19, 2006 Share Posted November 19, 2006 How do I get the client to display effects like a lightning effect from the server side. Also I am trying to get the disintegrate effect to work. So far I have this: vec3_t temp = {0,0,0}; ent->health = 0; G_Damage(ent, ent, ent, temp, temp, 9999, 0, MOD_TRIGGER_HURT); ent->client->ps.eFlags |= EF_DISINTEGRATION; ent->s.eFlags|= EF_DISINTEGRATION; And it kills me and I can see sparks coming off me as if I were being disintegrated but the model just stays there and then disappears after a while. How do I get these effects working? Oh yeah and dismemberment how does that work? Link to comment Share on other sites More sharing options...
razorace Posted November 19, 2006 Share Posted November 19, 2006 I think ->client->ps.electrifyTime does the "getting electricuted" effect. As for the disintegration effect, it looks like ->client->ps.lastHitLoc has to be set to the point of impact to have the disintegration effect to work. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 19, 2006 Author Share Posted November 19, 2006 Thanks! Now I have this strange error. I just built my latest version and tried to join my server. I can connect but then it drops me saying: ERROR: AS_ParseSets: Unable to find ambient soundset "city_outdoor"! ERROR: AS_ParseSets: Unable to find ambient soundset "piston"! ERROR ...2 missing sound sets! (see above) baseJKA and JA+ still work so theres something wrong with my mod but I haven't touched any of the sound stuff so I don't know whats happening here. EDIT: Fixed it. It was a bad PK3. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 19, 2006 Author Share Posted November 19, 2006 OK I've been looking through cg_player and I want to add some client side visual effects. Now I'm getting a bit confused between cent and cg. Say I wanted it so that all players who were frozen had a particular shader applied to them. I've tried this: if((cent->playerState->persistant[PERS_XSTATE] & X_FREEZE) && cg.snap->ps.clientNum != cent->currentState.number) { //legs.shaderRGBA[0] = 150; //legs.shaderRGBA[1] = 0; //legs.shaderRGBA[2] = 255; legs.renderfx |= RF_RGB_TINT; legs.customShader = cgs.media.electricBody2Shader; } But the only time the shader is applied is when I am frozen and the shader is applied to me. If I freeze someone else they stay the same. Can someone explain how this sort of client side stuff works and what exact cg is? Link to comment Share on other sites More sharing options...
razorace Posted November 20, 2006 Share Posted November 20, 2006 cg is sort of the global data struct for the client side, like the way "level" is for the game side of the code. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 20, 2006 Author Share Posted November 20, 2006 OK then if CG is a snapshot how do I know what client it's referring to here: cg.snap->ps.clientNum? Won't that always be the same number/client? Link to comment Share on other sites More sharing options...
ensiform Posted November 20, 2006 Share Posted November 20, 2006 cent->currentState.number is a centitiy's number on the client. Match that or != that with cg.snap->ps.clientNum (or predictedPlayerState depending on the situation) Link to comment Share on other sites More sharing options...
razorace Posted November 20, 2006 Share Posted November 20, 2006 Clarification. The cent->currentState.number is the entity number of the entity you're currently looking at. This entity isn't always "the" client. It can be a dead body, a temp entity, etc. However, the cg.snap->ps is always the playerstate of "the" client. Link to comment Share on other sites More sharing options...
Tinny Posted November 20, 2006 Share Posted November 20, 2006 What is "the" client, is it the dude that your client side is currently rendering? Link to comment Share on other sites More sharing options...
razorace Posted November 21, 2006 Share Posted November 21, 2006 No, it's the player that's playing on that particular computer. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 21, 2006 Author Share Posted November 21, 2006 OK so something like this: if((cent->playerState->persistant[PERS_XSTATE] & X_FREEZE)) { //Render entity with particular shader } Would that work as I want it to? But then I've noticed that legs which is a refEntity is always used for changing what a player looks like. How do i know which centity this relates to :S Link to comment Share on other sites More sharing options...
ensiform Posted November 21, 2006 Share Posted November 21, 2006 No, it's the player that's playing on that particular computer. or the player you are following. Link to comment Share on other sites More sharing options...
ensiform Posted November 21, 2006 Share Posted November 21, 2006 OK so something like this: if((cent->playerState->persistant[PERS_XSTATE] & X_FREEZE)) { //Render entity with particular shader } Would that work as I want it to? But then I've noticed that legs which is a refEntity is always used for changing what a player looks like. How do i know which centity this relates to :S CG_Player( centity_t *cent ) if cg.snap->ps.clientNum != cent->currentState.number then if (cent->playerState->persistant[PERS_XSTATE] & X_FREEZE) { // render your shader w/legs refEnt } Link to comment Share on other sites More sharing options...
Dom_152 Posted November 21, 2006 Author Share Posted November 21, 2006 Thank you I'll try it out. I tried what you said and it doesn't seem to work. I understand how client side works now so thanks. Link to comment Share on other sites More sharing options...
ensiform Posted November 21, 2006 Share Posted November 21, 2006 You could also look at how FP_PROTECT does it by drawing it around you the player when in 3rd person. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 21, 2006 Author Share Posted November 21, 2006 Good idea. Thanks. OK well I can get it to draw a shell around the player with the right shader and all but I can't get it to do it at the right time. Doing it as you suggested doesn't do anything at all. If you remove the cg bit it works but only on myself not on anyone else. Link to comment Share on other sites More sharing options...
razorace Posted November 21, 2006 Share Posted November 21, 2006 Oh, that's due to the player's playerstate only being sent to that player. All the other clients just see the data that is stored in the player's entityState_t. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 22, 2006 Author Share Posted November 22, 2006 OK, so how do I get information into the entityState_t structure? Would this be the time to use userInt because you can't add things to that structure as far as I know. Link to comment Share on other sites More sharing options...
razorace Posted November 22, 2006 Share Posted November 22, 2006 Maybe. The downside of using one of the userInts is that it will make it so that the game can't run without the client side. Any attempt to log into your mod game would result in their game crashing. Link to comment Share on other sites More sharing options...
Dom_152 Posted November 22, 2006 Author Share Posted November 22, 2006 Ouch. So how do mods like the Lugormod have visual effects (For example when using an admin gun) without me needing the client side? Link to comment Share on other sites More sharing options...
razorace Posted November 22, 2006 Share Posted November 22, 2006 There are some generic "play effect" commands that can be sent from the server side. However, those are just generic non-player related effects like gun fire effects, sparks, etc. So I'm not sure you'd be able to play the disintigration effect that way since it uses more data to create the effect. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.