[hlcoders] Physics and Melee weapons
I'm currently writing a melee weapon system for the mod I'm working on. It's going to work rather differently to way say the HL2 crowbar works in that instead of just whacking buttons to make your character do different attacks the movements of your mouse will determine how you attack. I've setup a system whereby the mouse is tracked client side and when an attack is made the information about what kind of attack it is is sent over to the server via a client-command (i.e. if it was a slash attack for a sword it'd send over a number identifying the attack and two other numbers giving the direction the mouse was moved in). I then use pose parameters to control the attack animation (so for example you can slash a sword in any direction you want). The difficulty I'm having is in actually creating the weapon that will sit in the players hand and collide with things / effect physics objects etc. Currently I've coded a base melee weapon class (inherited from CBaseEntity not CBaseCombatWeapon) and I'm using bone followers to get a physics shadow which follows the weapon model. The weapon model follows the player's hand movement using the same method weapons inherited from CBaseCombatWeapon do (i.e. using the CBaseEntity::FollowEntity function which sets up a bone merge). Thus when the player makes an attack, the player model animation moves the weapon model and if it hits stuff the appropiate action can occur (i.e. if it hits a player damage calculations can be done, if it hits a physics object it could knock it over etc). However when I use a bone follower to create a physics shadow which follows round the weapon model I'm told the server is stuck on the sword model the player is carrying and hence the player model can't really move anywhere. If I stand next to a physics object and equip the sword I can knock over the object so it works in one respect. Does anyone know what would be cause the server to be getting stuck on the sword model and how I could fix this? Also is this the best way to do what I want (namely I'm using a bone follower which creates a physics shadow, to follow round a model bone merged to a players hand so the model can interact with physics objects etc)? I'm not particular familiar with Source's physics system yet so I could be going completely the wrong way about this. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Physics and Melee weapons
Does anyone know what would be cause the server to be getting stuck on the sword model and how I could fix this? It sounds like you've got collisions enabled between the sword's bone followers and the player. The simplest way to fix this is to call SetOwnerEntity() on each of the bone followers and set the player as the owner of them. Jay ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Bouncing/NoClipping Physics Objects?
I looked at the should freeze object code and it's boolShouldFreezeObject( IPhysicsObject *pObject ) { return true; } Return true all the time? Is it supposed to be like this? I'll try to repro it here. To be clear, I'm just pointing out that if you experience these problems, it's most likely a bug. It's not a consequence of doing too much physics. So try to find a way to reproduce it or help debug it. It probably won't go away because you turn off some of the physics in your mod (i.e. I can't think of a reason why it would) - that's probably just a waste of your time. If you have this happen on your server locally, I'd be interested to see the results of turning phys_timescale down to 0.1 and doing physics_debug_entity on some of the prop_physics entities that are going crazy. I'd like to see the console dump of that; it may help figure out what the problem is. Jay -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Davison Sent: Saturday, March 05, 2005 8:20 AM To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Bouncing/NoClipping Physics Objects? Ok Jay. The reason I thought that was the problem was because when HL2DM got first released and loads of people put up crappy servers the symptoms that Knifa described was happening. But when better servers got put up the problems disappeared. Ok I have just had a quick look at steampowered's forums and I found this intresting bit of information. #20 Physical Mayhem This seems to occur every now and again, however, with the release of dm_steamlabs, it has occured much more than before. This problem causes the physics of all objects to completely mess up, respawning weapons fall through the floor, throw grenades go through walls, objects and floors. Objects seem to have a mind of their own as they bounce about randomly. Currently the only fix is to restart the server, as the physics remain changed through map changes. http://forums.steampowered.com/forums/showthread.php?s=thread id=248425 On Sat, 05 Mar 2005 15:29:31 +, Knifa [EMAIL PROTECTED] wrote: Uh.. what? You can delate farter, and uninteresting. And move to a simulated phisic, or not phisic at all. And avoid swawning that much using a cycle for decor stuff. etc Ben Davison wrote: Deleting physics objects untill the server becomes stable? On Sat, 05 Mar 2005 03:01:19 +, Knifa [EMAIL PROTECTED] wrote: Is there anything I can do about it then? (other than restarting HL2) This usually happens because the server is processing to many physics calculations and the server can't handle it. And from what I can remember source forts is extremly intensive on the physics(well my forts are ;P) On Sat, 05 Mar 2005 02:27:56 +, Knifa [EMAIL PROTECTED] wrote: Yea, they stick in for about half a second then bounce really high, then they just go all over the place I've seen this problem when there are 2 many physics interactions going on for the server to handle. Do physics objects seem to go into the ground for a bit then pop back up? On Sat, 05 Mar 2005 01:57:43 +, Knifa [EMAIL PROTECTED] wrote: Hi all. While playing my mod, after a few minutes of play, physics objects starting bouncing around and act like they have no collisions. Is this something to do with my mod or is it a Source Engine bug? Thanks -- Knifa SourceForts http://knd.org.uk/sourceforts/ ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- - Ben Davison - http://www.shadow-phoenix.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- Knifa SourceForts http://knd.org.uk/sourceforts/ ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- - Ben Davison - http://www.shadow-phoenix.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- Knifa SourceForts http://knd.org.uk/sourceforts/ ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- - Ben Davison - http://www.shadow-phoenix.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Physics and Melee weapons
It sounds like you've got collisions enabled between the sword's bone followers and the player. The simplest way to fix this is to call SetOwnerEntity() on each of the bone followers and set the player as the owner of them. Yup that was it, it's working fine now (or at least the player can move, there's still a load of other problems to I need to sort out). Thanks for the help :) ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Server Crashs with Plugin?
Hi, i have compiled the serverplugin_empty and have runned on my server... Thats all fine but when i play with other player the server crashs on random times... 5 hours 2 hours 1 min 6 hours The time is every time random Its there an bug on the Dedicated Server ? I have tested it on an Linux 64 Slot public Server... using i486. I hope anybody can help me ! THX ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Server Crashs with Plugin?
Did you modify the empty serverplugin code or just compile and run? - Original Message - From: Ratman2000 [EMAIL PROTECTED] To: hlcoders@list.valvesoftware.com Sent: Sunday, March 06, 2005 1:04 PM Subject: [hlcoders] Server Crashs with Plugin? Hi, i have compiled the serverplugin_empty and have runned on my server... Thats all fine but when i play with other player the server crashs on random times... 5 hours 2 hours 1 min 6 hours The time is every time random Its there an bug on the Dedicated Server ? I have tested it on an Linux 64 Slot public Server... using i486. I hope anybody can help me ! THX ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] SDK ladders not working
Has anyone been able to get ladders to work using the SDK code? I have had nothing but trouble with them. The func_usableladder entity doesn't work at all and func_ladder causes server crashes on spawn (on linux anyway). I tried the ladder prefab in Hammer and it didn't work, nor does following the examples given in the SDK docs. The problem with the func_usableladder seems to be that the player isn't attaching to the ladder. The ladder is ignoring the player completely. Any ideas? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Server Crashs with Plugin?
I have yust compiled the plugin... No changes Can you send me an clean plugin example what do nothing but dont crashs the server please ? to [EMAIL PROTECTED] THX !!! ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Bouncing/NoClipping Physics Objects?
I looked at the should freeze object code and it's boolShouldFreezeObject( IPhysicsObject *pObject ) { return true; } Return true all the time? Is it supposed to be like this? Yes. I described the exact behvaior in my previous mail. But basically this function gets called after you hit the limit of collisions per timestep for a particular object. For HL2 once we hit that limit we want to freeze the object (note that this freezes the object only for the remainder of the timestep, not permanently) to avoid using too much CPU for physics. The hook is there so you can make a different tradeoff in your mod if you'd like. You can always increase the limit by setting it in the performance settings, or you could do other things in the callback (e.g. add a timer for physics and let it do more as long as you haven't exceeded your real-time budget). Jay ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] SDK ladders not working
I think func_useableladder will only work for HL2 builds (HL2_DLL #defined). Otherwise, everything else uses the func_ladder stuff. If you want to use the func_useableladder stuff you need to remove the HL2 specific defines in hl2_gamemovement and copy those functions into your sdkgamemovement class, etc. Yahn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Lewis Sent: Sunday, March 06, 2005 2:23 PM To: hlcoders@list.valvesoftware.com Subject: [hlcoders] SDK ladders not working Has anyone been able to get ladders to work using the SDK code? I have had nothing but trouble with them. The func_usableladder entity doesn't work at all and func_ladder causes server crashes on spawn (on linux anyway). I tried the ladder prefab in Hammer and it didn't work, nor does following the examples given in the SDK docs. The problem with the func_usableladder seems to be that the player isn't attaching to the ladder. The ladder is ignoring the player completely. Any ideas? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] MuzzleFlash Tracer bugs in Third Person only?!
Hi, I currently have a problem on my local (sv_lan 1) server ONLY with the muzzleflash and tracers. For whatever reason, when i switch to thirdperson and shoot, my muzzle flash gets displayed at 3 different position, the right position (my gun's world model muzzle attachement), forward from the gun about 50 units, and at my feet. On top of that, the tracers start from the second position (50 forward from my gun's muzzle attachement). I am at a loss to explain this, it is ONLY happening in third person, the muzzleflash works fine when seen on other models in multiplayer games as you can see in the video we put together for our mod at www.calibermod.com . Yet, in third person, it's not working right. I've ran through debug before and put a breakpoint in my dll where the actual muzzle gets created, and it only gets called once per frame... What is the mystery code producing the 2 additional muzzles and why are my tracers and the right muzzle flash not being attached correctly in third person on my own model? This is the code I use in void C_BaseAnimating::ProcessMuzzleFlashEvent(): if ( m_Attachments.Count() 0 ) { Vector attachOrigin; QAngle attachAngles; GetAttachment( LookupAttachment(muzzle), attachOrigin, attachAngles ); Vector forward, right, up; AngleVectors( attachAngles, forward, right, up ); attachOrigin += ( (5.0 * forward) ); // make it be a little bit ahead of the actual attachement. g_pEffects-MuzzleFlash( attachOrigin, attachAngles, 0.5, MUZZLEFLASH_TYPE_DEFAULT ); dlight_t *el = effects-CL_AllocDlight( LIGHT_INDEX_MUZZLEFLASH + index ); el-origin = attachOrigin; el-radius = random-RandomInt( 32, 64 ); el-decay = el-radius / 0.05f; el-die = gpGlobals-curtime + 0.05f; el-color.r = 255; el-color.g = 192; el-color.b = 64; el-color.exponent = 5; } Also, another question while we're at it, I have a networked entity derived from CBaseAnimating wich i attach to my player and use FollowEntity to get it to stay with him (a personal round shield.) The shield itself is a model and gets rendered fine and so on, but it won't animate. The model has a idle animation, wich i am trying to get to loop/play without much success with the following code: ResetSequence(LookupSequence(idle)); SetCycle( 0 ); In the function that creates my entity after it has been attached, the animation is supposed to make it rotate but my model never rotates :/ I just checked and the animation is set to loop itself, i should note that it doesnt work wether or not i call SetCycle( 0 );. Thanks in advance Imperio59 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.6.2 - Release Date: 04/03/2005 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders