Talk:Dual Pistols (CSS Style)

From Valve Developer Community
Jump to: navigation, search

The code here could be alot more efficient, I.E, RightDualiesAttack could be put directly into weapon_dualies, and all the code in PostFireStuff could be consolidated onto ItemPostFrame, seeing as thats what ItemPostFrame is for. And I could even go as far to say remove the RightDualiesAttack function and just put in a bool that toggles that into PrimaryFire.

--DeadlyContagion 16:30, 26 Oct 2007 (PDT)

Then edit the code? Just check that it works before you confirm the edit. --Lord Ned

As far as I know, fixing the whitespace after the find and replace operation is unnecessary. C++ ignores almost all whitespace. --Hamish

I've followed this tutorial up until the creation of the script file. I've yet to proceed to that stage yet because I keep getting build errors when testing all the changes made. There are a total of seven unique errors, all to do with "undeclared identifiers". I'll show an example below (I hope that's alright?).

c:\testmod\src\game\shared\hl2mp\weapon_dualies.cpp(133) : error C2065: 'ACT_HL2MP_IDLE_Dualies' : undeclared identifier

To save space I've only shown one actual error here, but the others are exactly the same except for "ACT_HL2MP_IDLE_Dualies" being replaced by "ACT_HL2MP_IDLE_CROUCH_Dualies", "ACT_HL2MP_RUN_Dualies", "ACT_HL2MP_WALK_CROUCH_Dualies", "ACT_HL2MP_GESTURE_RANGE_ATTACK_Dualies", "ACT_HL2MP_GESTURE_RELOAD_Dualies", and "ACT_HL2MP_JUMP_Dualies".

Obviously they can be all traced back to a single issue, yet I haven't the coding experience to figure out the solution for myself. Any help here would be greatly appreciated. --Vic kothe 19:26, 18 May 2010 (UTC)

The singleplayer version of the code doesn't have HL2MP in the act names, so don't just copy paste the code on the page, modify the existing code as it's written. Solokiller 20:28, 18 May 2010 (UTC)
I'm modding HL2MP, not SP. I've also tried that approach already, I'm afraid. Thanks for the suggestion though. --Vic kothe 21:54, 18 May 2010 (UTC)
Found the problem! User z33ky on the forum had the solution. Someone edited all references to PISTOL from the act table section, thinking they also had to be changed to Dualies... but they were supposed to stay untouched. Perhaps this also clears up the issue in regards to why a segment was needed for fixing up the whitespace - that wasn't the intent of the original author. Changing it back. :) --Vic kothe 22:05, 18 May 2010 (UTC)
I made sure there can't be any mistakes with the act table anymore, unless somebody changes it again. Solokiller 22:23, 18 May 2010 (UTC)


The entire RightDualiesAttack and PostFireStuff methods can be integrated into existing methods with few changes. Also, the article should be checked for spelling errors. Since i don't have the HL2MP code, i can't check if the multiplayer behavior works, but i will check if it works in singleplayer tomorrow. Solokiller 22:30, 18 May 2010 (UTC)

I'm no grammar/spelling expert, but I'll go through and see if I can clean that aspect of the article up a bit. As for the coding... that's better left to someone more competent than I. --Vic kothe 22:38, 18 May 2010 (UTC)
Just did a fair bit of cleaning up in the Getting Started and Weapon Script File sections. Although it's still not perfect, it's much more coherent now. I'd like to see a new section explaining how to obtain the CS:S models required to get all this working in the end, or at the very least a link to another article that does as much. I'd do it myself but have run out of time right now - will do it later if no one beats me to it. --Vic kothe 23:38, 18 May 2010 (UTC)
I've cleaned up most of the article, somebody else should check it out and clean it up if necessary.

Solokiller 13:25, 19 May 2010 (UTC)

Fixed the article so it all works. Question though. How do I make it so that the left mouse fires the left pistol and the right mouse fires the right pistol e.g. The TF2 Heavy's hands and gloves.