Code: Impulse 12 = Super Physcannon

M

mr_unanimous

Guest
Hi,

I thought people might like to play with the super physcannon in their mod (without running the map: citadel and then changing to your map, etc).
I added some code to activate the super physcannon by impulse command :).

File: HL2_Player.cpp
Add this to the function: void CHL2_Player::CheatImpulseCommands( int iImpulse )
(inside the switch statement ;))
Code:
case 12: 
  { 
  	EquipSuit(); 
 
  	if ( !GlobalEntity_IsInTable( "super_phys_gun" ) ) 
  	{ 
    GlobalEntity_Add( MAKE_STRING("super_phys_gun"), gpGlobals->mapname, GLOBAL_ON); 
  	} 
  	else 
  	{ 
    GlobalEntity_SetState( MAKE_STRING("super_phys_gun"), GLOBAL_ON); 
  	} 
 
  	GiveNamedItem("weapon_physcannon"); 
 
  	break; 
  }

Now start up a game and type: impulse 12 (in console).
Just make sure sv_cheats is 1 ;).

Enjoy :).
 
azz0r said:
Doesnt work.

What doesn't work?
I tested it and it worked for me. Are you sure you have sv_cheats 1?
And make sure you add the code before case 50:
 
how about

Code:
void CC_CH_GiveSuperPhysCannon ( void )
{
	EquipSuit(); 
 
  	if ( !GlobalEntity_IsInTable( "super_phys_gun" ) ) 
  	{ 
    GlobalEntity_Add( MAKE_STRING("super_phys_gun"), gpGlobals->mapname, GLOBAL_ON); 
  	} 
  	else 
  	{ 
    GlobalEntity_SetState( MAKE_STRING("super_phys_gun"), GLOBAL_ON); 
  	} 
 
  	GiveNamedItem("weapon_physcannon"); 

}

static ConCommand give_supergun("give_supergun", CC_CH_GiveSuperPhysCannon, "Give Super Gravity Gun", FCVAR_CHEAT);

in HL2_Player.CPP at line 1260.

Cant try it myself as mine won't compile, but it should work.

(to use Enable Cheats and type give_supergun in console).
 
Wilco said:
how about

Code:
..code..

in HL2_Player.CPP at line 1260.

Cant try it myself as mine won't compile, but it should work.

(to use Enable Cheats and type give_supergun in console).

Hmmmm, that's nice :).
But it doesn't seem to know: EquipSuit(); and GiveNamedItem();
I have to test it some more. Tnx anyways.
 
Just to confirm, where are you putting it
 
hang on, are u using a Start from Scratch Mod or a HL2 modified mod?
 
You would just compile the project(DLL) and replace the dll, correct?

(Second, where did you find all the functions? Just looking through the code?)
 
nbk said:
You would just compile the project(DLL) and replace the dll, correct?

(Second, where did you find all the functions? Just looking through the code?)

Correct :). And the dll gets replaced automatically with vs .net :).

And I found all the functions browsing through the code.
My way of thinking:
- Hmmm, I want the super physcannon.
- browse through weapon_physcannon.
- Hmmm, a function WaitForUpgradeThink().
- And there is the code for the global variable :).
 
All i did to change the phys gun

1: open weapon_physcannon.cpp
2:Find the function PlayerHasMegaPhysCannon();
3:replace "return ( GlobalEntity_GetState("super_phys_gun") == GLOBAL_ON );" with "return ( true );"
4.Build the dlls

Mind you this only lets you have the super phys cannon, not the regular one.
 
Just as a side note, don't try and grab the buggy with either the SuperPhyGun or a modified PhysGun. Your computer will most likely choke on trying to calculate the physics. This probably goes for any vehicle but I haven't tested it. Food for thought.
 
Thanks Mr Unan!

This was a nice, short, easy way to test out compiling, attaching to the debugger, etc. Well done!

And kudos on your patience towards several of the more frustrating posts in this thread.

aac
 
camper, I thought new users(not me, of course) aren't supposed to have good grammer and spelling. I thought it was a fact, not a stereotype...
 
unanimous, I have tried to find the code for riding striders, with no luck. You want to try and look for it(I currently am - and, it is in the code, right?)

**Disregard my last, stupid, ignorant post(and for changing the topic)
 
Riding striders?
Anyways, Mr_Unanimous, could you send me the compiled DLLs? I can upload them if you don't have a host, so other people could download it. Thanks!
 
There are a few Console commands for adjusting the max mass etc of the phys gun, physcannon_* commands i think. But its not quite the same.
 
BetaMaster said:
Riding striders?
Anyways, Mr_Unanimous, could you send me the compiled DLLs? I can upload them if you don't have a host, so other people could download it. Thanks!
Forgot to supply email address!
[email protected]
or AIM me at PSimonAGarfunkel
 
BetaMaster said:
Riding striders?
Anyways, Mr_Unanimous, could you send me the compiled DLLs? I can upload them if you don't have a host, so other people could download it. Thanks!

Check: http://www.xs4all.nl/~vanstoel/files/hl2-enhanced-beta1.zip

I' ve made a few more adjustments in this file, but nothing to radical ;).

Features:
- Impulse 12 = Upgrade/Get Super PhysCannon
- Impulse 13 = Downgrade to normal PhysCannon
- MP7 is more accurate
- RPG is HL1 style (shoot with or without laserpointer)
- Combine(s) drop the weapons when shot by MegaPhysCannon (they don't disappear)
- Shotgun can hold 8 shells (HL1 style)

If you really, only want the physcannon upgrade, I'll create a new project and compile it for you. But I don't have much time and it will probably be Tuesday before I have time to do it.
 
Explain

Hey I see alot of functions and globals but noone is explaining what they are for. I can gather alot of info already from looking at the code, but most the functions dont mean anything to me. Maybe because I've never coded for HL1. So please could someone comment functions mentioned before and point out what they do and where in the flow they are called? Thank you plz! :bounce: :thumbs:
 
I am just curious- why does everyone ask about riding Striders? Did I miss something while under my comfy rock? When was it ever hinted that they were ride-able? (This was not to sound flamey or snotty, I am just curious because I have never heard anything remotely about this, except by all the modders on these forums.)
 
Faulk_Wulf said:
I am just curious- why does everyone ask about riding Striders? Did I miss something while under my comfy rock? When was it ever hinted that they were ride-able? (This was not to sound flamey or snotty, I am just curious because I have never heard anything remotely about this, except by all the modders on these forums.)

It was mentioned in a interview with Gabe (I think). The interviewer asked if the strider could be made driveable. And he responded that a guy at there office coded the strider as driveable vehicle for fun :). Now everyone wants to have a driveable strider :p.
 
They could make some serious cash if they released that as a MiniMod and charged $5 for it...
 

Similar threads

G
Replies
26
Views
2K
Back
Top