Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Kopachris on March 30, 2008, 03:35:15 pm

Title: New cheat code?
Post by: Kopachris on March 30, 2008, 03:35:15 pm
I just downloaded the source code, and was looking through it in XCode for cheats, and I found this:
Code: [Select]
// change player ship to next flyable type
case KEY_DEBUGGED + KEY_RIGHT:
debug_cycle_player_ship(1);
break;

// change player ship to previous flyable ship
case KEY_DEBUGGED + KEY_LEFT:
debug_cycle_player_ship(-1);
break;

// cycle target to ship
case KEY_DEBUGGED + KEY_SHIFTED + KEY_RIGHT:
debug_cycle_targeted_ship(1);
break;

// cycle target to previous ship
case KEY_DEBUGGED + KEY_SHIFTED + KEY_LEFT:
debug_cycle_targeted_ship(-1);
break;

// change species of the targeted ship
case KEY_DEBUGGED + KEY_S: {
if ( Player_ai->target_objnum < 0 )
break;

object *objp;
ship_info *sip;

objp = &Objects[Player_ai->target_objnum];
if ( objp->type != OBJ_SHIP )
return;

sip = &Ship_info[Ships[objp->instance].ship_info_index];
sip->species++;

if (sip->species >= (int)Species_info.size())
sip->species = 0;

HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Species of target changed to: %s", 24), Species_info[sip->species].species_name);
break;
}

Does this mean we'll soon be able to change our ship just like we can change our weapons?  Maybe so we can fly cruisers (would require a table edit...)?  All of this is in keycontrol.cpp.
Title: Re: New cheat code?
Post by: Polpolion on March 30, 2008, 04:51:38 pm
Cheating. Kills. Babies.


Don't do it.
Title: Re: New cheat code?
Post by: Hades on March 30, 2008, 04:55:07 pm
Cheating. Kills. Babies.


Don't do it.
He can do it if he wants.
Title: Re: New cheat code?
Post by: TopAce on March 30, 2008, 05:03:40 pm
...Maybe so we can fly cruisers (would require a table edit...)?...

You already can with FSO. Theoretically.
Title: several gernades
Post by: Polpolion on March 30, 2008, 05:22:38 pm
Cheating. Kills. Babies.


Don't do it.
He can do it if he wants.

I could go on a killing rampage with several gernades and a christmas tree, if I wanted to as well. But I don't. Even if I want to.


And AFAIK the only thing limiting you from flying capships is the fact that they're not allowed in mission select. Just make a mission where you can press a button and change your ship to whatever. That's not hard.

EDIT: Out of curiosity, are the ship flags "Player ship" and "cruiser" mutually exclusive?
Title: Re: New cheat code?
Post by: Kopachris on March 30, 2008, 05:33:34 pm
I'm not totally sure, but I think that even with the cheat above, you can only switch to ships that have the "player ship" flag.  To fly a cruiser, you'd need to make all the ships playable, and either make a mission that uses it, or use the cheat.  The former would be useful for a Star Trek mod.  Have little shuttle-pod fighters, but you get to pilot the Enterprise.

And cheating does not kill babies, or puppies, or kittens, or anything else except time.  Cheat codes were originally meant as a debugging tool for developers.  It's usually kept as something for the player to discover.  In Freespace, it's useful for both testing new builds of the SCP, and for testing mods.  Cheats are fun to use after you've already beaten the game without cheats, which I already have.
Title: Re: New cheat code?
Post by: Talon 1024 on March 30, 2008, 05:50:48 pm
Cheating. Kills. Babies.


Don't do it.

No it doesn't.  You can legitimately cheat if you want to test the functionality of something you just made, or if you *REALLY* suck at the game.  But otherwise, you shouldn't do it.  It's your choice anyway...
Title: Re: New cheat code?
Post by: Polpolion on March 30, 2008, 06:10:00 pm
You can legitamatly FRED a quality test mission quicker than coders can get this functioning properly. It'd be useful if you're developing the engine from the ground up for the first time, but none of us are doing that.
Title: Re: New cheat code?
Post by: Kopachris on March 30, 2008, 11:10:33 pm
Shouldn't it be fairly simple to code if the weapons and ships are selected in the same way?  Just switch the same way as the weapons are switched and redraw.

The funny part about this is that a while back, when I was still a real n00b, I put a post on the old SCP forums asking if they could do this.  They said no, but they seem to be working on it anyway.
Title: Re: New cheat code?
Post by: haloboy100 on March 31, 2008, 01:06:22 am
Why exactly do you want this cheat? To fly capships?

What's the fun in that?
Title: Re: New cheat code?
Post by: WMCoolmon on March 31, 2008, 02:02:19 am
AFAIK, I've fixed everything you ought to need to fly capships, and it's been that way for years, but no one has ever bothered to make a mission where you do it. :doubt:
Title: Re: New cheat code?
Post by: IPAndrews on March 31, 2008, 02:05:33 am
AFAIK, I've fixed everything you ought to need to fly capships, and it's been that way for years, but no one has ever bothered to make a mission where you do it. :doubt:

Really? Fixed in 3.6.9? You ought to advertise this stuff man  :)
Title: Re: New cheat code?
Post by: Kopachris on March 31, 2008, 07:27:36 am
Yes!  Freighter training mission, here I come!  (Speaking of which, any way for a player in a Freighter to dock with cargo?)
Title: Re: New cheat code?
Post by: haloboy100 on March 31, 2008, 09:06:12 am
Nothing you can't do with ai-control-ship (or whatever the exact expression is) SEXP, and make the player ship dock with the cargo.
Title: Re: New cheat code?
Post by: Turey on April 01, 2008, 12:57:30 am
AFAIK, I've fixed everything you ought to need to fly capships, and it's been that way for years, but no one has ever bothered to make a mission where you do it. :doubt:

Including the HUD overflow when too many subsystems are damaged?
Title: Re: New cheat code?
Post by: WMCoolmon on April 01, 2008, 01:00:07 am
That's exactly what I'm thinking of...and I know that capital ships were working in the tech room, and I haven't intentionally touched them since then. IIRC, somebody - me or Goober - modified the turret code so that multiple turrets on the player ship should fire.