Author Topic: GH1 and pink mecha  (Read 899 times)

Offline DudeGuyMan

  • Newbie
  • *
  • Posts: 45
    • View Profile
GH1 and pink mecha
« on: September 27, 2011, 09:19:05 PM »
So I've messed around with save editing a bit, changing NPC portraits, changing my mech's model number and sprite, etc.  Just wanted to ask, is there a variable I can change that will make all the generic enemies I fight some color other than pink?

Offline Daemonward

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: GH1 and pink mecha
« Reply #1 on: September 28, 2011, 10:39:02 AM »
I know that in GH2 the NPC color schemes are based on their faction. I don't recall offhand if that is also the case for GH1. I looked at some of the files and found that the factions are defined near the end of "ADV_FederatedTerritories.txt" in the GearHead/Series directory, but I didn't see anything about colors in the faction definitions.

Offline Prokofiev

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: GH1 and pink mecha
« Reply #2 on: September 28, 2011, 02:48:53 PM »
I'd be interested in this too-- although not a huge deal, it was still somewhat silly to have pretty much all non-monsters, from bandits to the aegis military, be decked out in pink.

Simply inserting the GH2 "mecha_colors <xxxx>" doesn't work, nor does using "sdl_colors <xxxx>". It might simply not be supported for GH1.

Offline xpace

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://xpace.awardspace.com/
Re: GH1 and pink mecha
« Reply #3 on: September 28, 2011, 04:04:24 PM »
I doubt that the faction color schemes are supported in GH1. I seem to recall reading that this was a new feature in GH2.

However, perhaps there is some code somewhere to change so that all enemies appear in a color other than pink? Perhaps someone could tell us how to change them all to fire-engine red, dark orange, or something? (Though, I have a sinking feeling that such a fix might require compiling the source code...)

Or, maybe Mr. Hewitt could be convinced to add a few basic faction color schemes to GH1 in the new GH1 release... eventually? (I'm referring to the talk about making a new GH1 release - with some minor improvements - that was discussed about a year or so ago...)
« Last Edit: September 28, 2011, 04:10:56 PM by xpace »

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
Re: GH1 and pink mecha
« Reply #4 on: September 29, 2011, 07:47:41 AM »
Poor Char Aznable isn't getting much love in this thread...



As far as I remember there's no way to do it without recompiling the program. Don't be afraid of that, though! Since SDL was added to the standard FPC distribution it's been really easy to compile.

Offline DudeGuyMan

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: GH1 and pink mecha
« Reply #5 on: September 29, 2011, 11:18:44 AM »
So who wants to compile the "all enemies are battleship gray with blue details" (or whatever) version of GH1? :D

I'd totally do it but I wouldn't have the first clue as to how. The most I've done is copy/rename some GH2 .png files to make an "only the stuff DGM likes best" image folder, create a "new" sprite by copying an existing one and making tiny changes in Paint, stuff like that.

Offline Daemonward

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: GH1 and pink mecha
« Reply #6 on: September 30, 2011, 11:35:24 AM »
As far as I remember there's no way to do it without recompiling the program. Don't be afraid of that, though! Since SDL was added to the standard FPC distribution it's been really easy to compile.


Have you been able to successfully compile GH1 with SDLMODE recently? GH2 is easy to compile and GH1 with the default ASCII graphics compiles without problems, but I just tried compiling GH1 using -dSDLMODE and it failed.

I am running Ubuntu 11.10 64-bit.

Here's the output of my failed GH1 SDL compile (starting from a fresh extraction of source and image archives):
Code: [Select]
~/Downloads/GearHead$ fpc arena -dSDLMODE
Free Pascal Compiler version 2.4.4-2ubuntu1 [2011/09/27] for x86_64
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Linux for x86-64
Compiling arena.pas
arena.pas(31,2) Warning: APPTYPE is not supported by the target OS
Compiling gears.pp
Compiling texutil.pp
gears.pp(1206,2) Note: Local variable "S" not used
Compiling sdlgfx.pp
Compiling ui4gh.pp
Compiling ability.pp
Compiling ghsensor.pp
Compiling damage.pp
Compiling gearutil.pp
Compiling ghchars.pp
Compiling ghcpit.pp
ghcpit.pp(54,2) Note: Local variable "Master" not used
ghcpit.pp(54,9) Note: Local variable "S" not used
ghcpit.pp(54,11) Note: Local variable "S2" not used
Compiling ghguard.pp
Compiling ghmecha.pp
Compiling ghmodule.pp
Compiling ghholder.pp
Compiling ghmovers.pp
Compiling ghprop.pp
Compiling ghsupport.pp
Compiling ghswag.pp
Compiling ghweapon.pp
Compiling movement.pp
movement.pp(530,8) Note: Local variable "SF" not used
Compiling rpgdice.pp
sdlgfx.pp(41,47) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(42,47) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(43,44) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(44,49) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(46,48) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(47,48) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(48,48) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(49,49) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(50,51) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(51,49) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(52,49) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(53,48) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(54,50) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(55,48) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(56,49) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(57,50) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(58,50) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(59,51) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(60,49) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(61,51) Warning: Some fields coming after "b" weren't initialized
sdlgfx.pp(613,10) Error: Illegal type conversion: "<record type>" to "<record type>"
sdlgfx.pp(614,13) Error: Constant and CASE types do not match
sdlgfx.pp(615,13) Error: Constant and CASE types do not match
sdlgfx.pp(615,22) Error: Constant and CASE types do not match
sdlgfx.pp(616,15) Error: Constant and CASE types do not match
sdlgfx.pp(616,24) Error: Constant and CASE types do not match
sdlgfx.pp(617,15) Error: Constant and CASE types do not match
sdlgfx.pp(617,24) Error: Constant and CASE types do not match
sdlgfx.pp(618,16) Error: Constant and CASE types do not match
sdlgfx.pp(618,25) Error: Constant and CASE types do not match
sdlgfx.pp(619,14) Error: Constant and CASE types do not match
sdlgfx.pp(620,14) Error: Constant and CASE types do not match
sdlgfx.pp(621,14) Error: Constant and CASE types do not match
sdlgfx.pp(622,14) Error: Constant and CASE types do not match
sdlgfx.pp(623,20) Error: Constant and CASE types do not match
sdlgfx.pp(624,19) Error: Constant and CASE types do not match
sdlgfx.pp(625,14) Error: Constant and CASE types do not match
sdlgfx.pp(627,10) Error: Illegal type conversion: "<record type>" to "<record type>"
sdlgfx.pp(627,68) Error: Illegal type conversion: "<record type>" to "<record type>"
sdlgfx.pp(628,18) Error: Illegal type conversion: "<record type>" to "<record type>"
sdlgfx.pp(1311) Fatal: There were 20 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)

For reference, here's the output of my successful GH1 ASCII compile (starting from a fresh extraction of source and image archives):
Code: [Select]
~/Downloads/GearHead$ fpc arena
Free Pascal Compiler version 2.4.4-2ubuntu1 [2011/09/27] for x86_64
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Linux for x86-64
Compiling arena.pas
Compiling gears.pp
Compiling texutil.pp
gears.pp(1206,2) Note: Local variable "S" not used
Compiling congfx.pp
Compiling ui4gh.pp
Compiling ability.pp
Compiling ghsensor.pp
Compiling damage.pp
Compiling gearutil.pp
Compiling ghchars.pp
Compiling ghcpit.pp
ghcpit.pp(54,2) Note: Local variable "Master" not used
ghcpit.pp(54,9) Note: Local variable "S" not used
ghcpit.pp(54,11) Note: Local variable "S2" not used
Compiling ghguard.pp
Compiling ghmecha.pp
Compiling ghmodule.pp
Compiling ghholder.pp
Compiling ghmovers.pp
Compiling ghprop.pp
Compiling ghsupport.pp
Compiling ghswag.pp
Compiling ghweapon.pp
Compiling movement.pp
movement.pp(530,8) Note: Local variable "SF" not used
Compiling rpgdice.pp
Compiling arenahq.pp
Compiling arenaplay.pp
Compiling locale.pp
locale.pp(2235,2) Note: Local variable "Terrain" not used
locale.pp(2235,19) Note: Local variable "MM" not used
locale.pp(2236,2) Note: Local variable "MTerr" not used
Compiling aibrain.pp
Compiling action.pp
Compiling interact.pp
Compiling arenacfe.pp
Compiling effects.pp
Compiling ghparser.pp
Compiling skilluse.pp
effects.pp(2314,8) Note: Local variable "N" not used
effects.pp(2314,12) Note: Local variable "AtOp2" not used
effects.pp(2316,2) Note: Local variable "SRS" not used
Compiling coninfo.pp
Compiling conmap.pp
Compiling menugear.pp
Compiling conmenus.pp
Compiling context.pp
conmap.pp(1025,2) Note: Local variable "A" not used
coninfo.pp(49,2) Note: Local variable "LastGearShown" is assigned but never used
aibrain.pp(643,2) Note: Local variable "BestWeight" is assigned but never used
aibrain.pp(1878,2) Note: Local variable "it" not used
Compiling arenascript.pp
Compiling grabgear.pp
Compiling playwright.pp
Compiling backpack.pp
Compiling services.pp
Compiling wmonster.pp
arenascript.pp(2324,2) Note: Local variable "Scene" not used
Compiling pcaction.pp
Compiling gflooker.pp
Compiling randchar.pp
pcaction.pp(3010,2) Note: Local variable "P1" is assigned but never used
pcaction.pp(3010,5) Note: Local variable "P2" not used
pcaction.pp(3011,2) Note: Local variable "M" not used
pcaction.pp(3050,2) Note: Local variable "WalkDir" not used
pcaction.pp(3117,2) Note: Local variable "P" not used
Compiling randmaps.pp
Compiling navigate.pp
arenahq.pp(1250,2) Note: Local variable "A" not used
Compiling mapedit.pp
Linking arena
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
45820 lines compiled, 1.2 sec
22 note(s) issued
« Last Edit: September 30, 2011, 11:50:12 AM by Daemonward »

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
Re: GH1 and pink mecha
« Reply #7 on: September 30, 2011, 06:28:34 PM »
Weird. I did not know that... I'll take a look and see what's going on.

Offline xpace

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://xpace.awardspace.com/
Re: GH1 and pink mecha
« Reply #8 on: October 11, 2011, 06:50:16 AM »
I finally found it!  :o  :)

After several days of combing through the source code and several false finds, I found what controls the color of enemies.

What I found is in "sdlmap.pp", in Function TeamColorString, starting at line 530:
Code: [Select]
line 557|   end else if AreEnemies( GB , T , NAV_DefPlayerTeam ) then begin
line 558|   it := '180 10 120  125 125 125 170 205 75';

If you examine those numbers carefully, you'll find that the first three are the RGB values for the "Main Color" (Pinkish-Red), the second set of three are the RGB values for the "Complement Color" (a Light Gray), and the third set of three are the RGB values for the "Hilight Color" (Fluorescent Green). Incidentally, none of those colors are selectable by the player for their own mecha.

At first, I had thought that the "EnemyRed" color variable was what controlled it. But that does not control the color of enemy mecha.

Incidentally, I've figured out how to do a few other things with the code. Stay tuned... (I think I've found a way to make the wall height adjustable, like with Shift+W in GH2.)

Question for Joseph Hewitt

I realize it's probably been years since you last looked at the code for GH1, but... is there a chance you could point me in the general direction of where to find that part of the code responsible for creating random-colored mecha on the opening "demo" screen that scrolls around a random terrain? If I could just find that, I should be able to make certain enemies appear in a random color scheme.

I've lost count of the hours I've spent trying to pin that code down and I don't feel like I've gotten much closer.  :( All I really need is a suggestion on the file to examine closely.

For a while I thought maybe this code was in "randmaps.pp". But I have doubts about it now. The use of terms like "scene/feature gear" and "metaterrain gears" as well as variable names such as "GearPtr" throws me. The name "gear" suggests that it involves mecha, but it seams that the term can be used very broadly...
« Last Edit: October 11, 2011, 07:12:52 AM by xpace »

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
Re: GH1 and pink mecha
« Reply #9 on: October 11, 2011, 06:59:48 AM »
It's in the "PrepOpening" procedure in sdlmap.pp.

A "gear" is the basic building block of everything in the game- mecha, mecha parts, characters, weapons, plots, scenes, factions, teams, and just about everything else which can be conceptualized as a thing is modeled as a type of gear. Gears come with three values which define their type- G (the General type of the gear, or Genus, or maybe even Group), S (the Specific type of gear, or the Species, or even the Subgroup), and V (the Value of the gear, or the... grr, not many appropriate words start with V). A mecha might have G=GG_MECHA, S=GS_BATTROID, V=Size Class. A weapon would have G=GG_WEAPON, S=GS_MELEE, V=Damage Class. It's kind of a proto-object oriented design, with everything being subclasses of the Gear type.

Offline Daemonward

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: GH1 and pink mecha
« Reply #10 on: October 11, 2011, 02:08:19 PM »
xpace, have you been able to compile GH1 with SDL? If so, what operating system are you using?

Offline DudeGuyMan

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: GH1 and pink mecha
« Reply #11 on: October 11, 2011, 10:22:25 PM »
After several days of combing through the source code and several false finds, I found what controls the color of enemies.


Out of town until next week, just logging in real fast to say woo hoo!

Offline xpace

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://xpace.awardspace.com/
Re: GH1 and pink mecha
« Reply #12 on: October 14, 2011, 07:26:25 AM »
FYI: I just spent several hours writing this wiki page:
Development:Reference:sdl colors

It explains in detail how the sdl_colors.txt file defines the colors that are available as choices to the player for customizing their PC and their mecha. But more importantly, I compiled a spiffy color chart;) Considering that the game itself does not show what each color looks like, this chart should make it much easier to decided which colors to use.

It might also help in choosing a new color scheme for enemies, as I mentioned earlier (by modifying Function TeamColorString in "sdlmap.pp").

Little rant: The reason it took me so long was because I had to convert the RGB values in sdl_colors.txt to the HEX values that HTML/Wiki uses. I spent hours searching the web for either an online converter or a little program I could download. Online converters are rather common and there are free programs, too. Sadly, all of them have separate fields for the Red, Green, and Blue values, so they must be entered one-by-one. I just wanted something that would convert all three as a space-separated string or a comma-separated string. But it does not seem like that exists. :( I could have written a little AutoHotKey script in that time, but I digress...
« Last Edit: October 14, 2011, 07:30:17 AM by xpace »

Offline DudeGuyMan

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: GH1 and pink mecha
« Reply #13 on: October 16, 2011, 07:53:47 PM »
I will write an epic poem* in your honor if you upload a file I can drop in the folder and make GH1 enemies non-pink.

(* By which I mean an appreciative forum post. :-P )

Offline Michael

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: GH1 and pink mecha
« Reply #14 on: October 16, 2011, 09:43:51 PM »
if you upload a file I can drop in the folder and make GH1 enemies non-pink.

That file would have to be "GearHead/arena.exe" itself.  The pink/grey/green color scheme is compiled-in.