HOWTO: Changing laser color for Player depending on weapon
Posted: Wed Sep 10, 2014 4:53 pm
This is probably not rocket science, but for those of you who compile their own game and would like to have different laser colors depending on Laser installed, I would like to share this with you:
Download the source and open PlayerEntity.m in notepad ++
at line 5321 you will find this code block
Replace it with this:
Compile it and tadaaaa !!! you have your different colored lasers.
Change the color of the lasers to your liking.
Have fun.
Windows users who wish to compile could find this post useful: https://bb.oolite.space/viewtopic.php?f=8&t=15279
Since there is a way to set different background colors for galaxies, I can't really see why this should not be implemented in a core game, since this has nothing to do with how the laser behaves gameplay wise. It would be nice to have a way to change the laser color either in the options screen, having default (red for all) or different laser colors could be set, also for people who are color blind this would be a very good asset to have.
This workaround might not be the ideal place to put the extra code, but it works.
For those who cannot compile or do not wish to do so I have put online two Oolite versions (1.81) with different laser colors.
Being:
Pulse laser color: Red
Beam laser color: Orange
Mining laser color: Yellow
Military laser color: Blue
OOlite ver 1.81 - Bluespace (dark blue space): https://app.box.com/s/bjrsdwsxthgkwdeozkbg
Oolite ver 1.81 - Vanilla (black space): https://app.box.com/s/ptu0rudfiyj4j8aevzoc
No other things were changed.
Enjoy
Download the source and open PlayerEntity.m in notepad ++
at line 5321 you will find this code block
Code: Select all
switch (currentWeapon)
{
case WEAPON_PLASMA_CANNON:
weapon_energy_use = 6.0f;
weapon_reload_time = 0.25f;
break;
case WEAPON_PULSE_LASER:
weapon_energy_use = 0.8f;
weapon_reload_time = 0.5f;
break;
case WEAPON_BEAM_LASER:
weapon_energy_use = 1.0f;
weapon_reload_time = 0.1f;
break;
case WEAPON_MINING_LASER:
weapon_energy_use = 1.4f;
weapon_reload_time = 2.5f;
break;
case WEAPON_THARGOID_LASER:
case WEAPON_MILITARY_LASER:
weapon_energy_use = 1.2f;
weapon_reload_time = 0.1f;
break;
case WEAPON_NONE:
case WEAPON_UNDEFINED:
weapon_energy_use = 0.0f;
weapon_reload_time = 0.1f;
break;
}
Code: Select all
switch (currentWeapon)
{
case WEAPON_PLASMA_CANNON:
weapon_energy_use = 6.0f;
weapon_reload_time = 0.25f;
break;
case WEAPON_PULSE_LASER:
weapon_energy_use = 0.8f;
weapon_reload_time = 0.5f;
[self setLaserColor:[OOColor redColor]];
break;
case WEAPON_BEAM_LASER:
weapon_energy_use = 1.0f;
weapon_reload_time = 0.1f;
[self setLaserColor:[OOColor orangeColor]];
break;
case WEAPON_MINING_LASER:
weapon_energy_use = 1.4f;
weapon_reload_time = 2.5f;
[self setLaserColor:[OOColor yellowColor]];
break;
case WEAPON_THARGOID_LASER:
case WEAPON_MILITARY_LASER:
weapon_energy_use = 1.2f;
weapon_reload_time = 0.1f;
[self setLaserColor:[OOColor cyanColor]];
break;
case WEAPON_NONE:
case WEAPON_UNDEFINED:
weapon_energy_use = 0.0f;
weapon_reload_time = 0.1f;
break;
}
Change the color of the lasers to your liking.
Have fun.
Windows users who wish to compile could find this post useful: https://bb.oolite.space/viewtopic.php?f=8&t=15279
Since there is a way to set different background colors for galaxies, I can't really see why this should not be implemented in a core game, since this has nothing to do with how the laser behaves gameplay wise. It would be nice to have a way to change the laser color either in the options screen, having default (red for all) or different laser colors could be set, also for people who are color blind this would be a very good asset to have.
This workaround might not be the ideal place to put the extra code, but it works.
For those who cannot compile or do not wish to do so I have put online two Oolite versions (1.81) with different laser colors.
Being:
Pulse laser color: Red
Beam laser color: Orange
Mining laser color: Yellow
Military laser color: Blue
OOlite ver 1.81 - Bluespace (dark blue space): https://app.box.com/s/bjrsdwsxthgkwdeozkbg
Oolite ver 1.81 - Vanilla (black space): https://app.box.com/s/ptu0rudfiyj4j8aevzoc
No other things were changed.
Enjoy