Page 2 of 5
Re: Musings about stuff that I could do to the source code..
Posted: Thu Jun 28, 2012 8:04 pm
by Thargoid
To clarify a few of the earlier posts - TCAT doesn't let you fly any kind of Thargoid ship, and if you want player-launchable Thargons, get Armoury.oxp and some Captured Thargons therein...
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 7:02 am
by Pleb
I managed to create a playble Thargoid Warship last night, using Griff's version as a template. The View points and weapons positions probably need some adjusting but it works and can dock/launch from the station. I have still not yet been able to decypher why the Thargoid Laser will not cause any damage when using it on a player ship, there is nothing in the code to suggest why this is happening either. I have copared the firemainweapon code between PlayerEntity.m and ShipEntity.m and there is nothing in there either to suggest this. Even the firedirectshot code in ShipEntity.m looks fine so I am at a total loss to explain this.
I also tried playing around with an idea pagroove had about making aqua space - but I could not figure out how I would make space blue! So no Frontier/FFE space backgrounds any time soon...
Must be possible though as when you fly near a planet into its atmosphere space turns blue then white so must be possible but couldn't find code that made this happen.
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 7:06 am
by Switeck
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 7:30 am
by another_commander
Pleb wrote:I have still not yet been able to decypher why the Thargoid Laser will not cause any damage when using it on a player ship, there is nothing in the code to suggest why this is happening either. I have copared the firemainweapon code between PlayerEntity.m and ShipEntity.m and there is nothing in there either to suggest this. Even the firedirectshot code in ShipEntity.m looks fine so I am at a total loss to explain this.
Haven't tried it to confim it works, but moving the
case WEAPON_THARGOID_LASER:
at line 4136, -fireMainWeapon method in PlayerEntity.m about four lines up, right after the
case WEAPON_MILITARY_LASER:
should allow it to execute the
fireLaserShotInDirection:
method, which contains the code for dealing weapon damage.
I also tried playing around with an idea pagroove had about making aqua space - but I could not figure out how I would make space blue! So no Frontier/FFE space backgrounds any time soon...
Must be possible though as when you fly near a planet into its atmosphere space turns blue then white so must be possible but couldn't find code that made this happen.
The sky color is set in various places, but I think (again, haven't cross-checked, could be wrong) that the first place to look at for setting the sky color when in space (i.e. 99% of the time) should be in Universe.m, method -setUpSpace, around line 913:
Code: Select all
[self setSkyColorRed:0.0f
green:0.0f
blue:0.0f
alpha:0.0f];
Hope this helps.
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 8:28 am
by Pleb
another_commander wrote:Haven't tried it to confim it works, but moving the case WEAPON_THARGOID_LASER:
at line 4136, -fireMainWeapon method in PlayerEntity.m about four lines up, right after the case WEAPON_MILITARY_LASER:
should allow it to execute the fireLaserShotInDirection:
method, which contains the code for dealing weapon damage.
I already tried this, actually was the first thing I did! For some reason, it will fire a shot at a targeted ship, but will not register that the shot in fact hit the ship. Without a target though, the laser will increase the weapon temperature but not be drawn on the screen. Thank you though for suggesting this, I'm glad you thought the same thing I did!
another_commander wrote:The sky color is set in various places, but I think (again, haven't cross-checked, could be wrong) that the first place to look at for setting the sky color when in space (i.e. 99% of the time) should be in Universe.m, method -setUpSpace, around line 913:
Code: Select all
[self setSkyColorRed:0.0f
green:0.0f
blue:0.0f
alpha:0.0f];
Hope this helps.
I tried messing with this as well, but again the sky remains black. It must be, as you said, referenced in a few places and I would obviously need to find all references to the sky being defined as black. Seems we have the same ideas! Shame, I wanted to post a screenshot of an Imperial Courier in blue space in the screenshots thread to see if anyone got the reference.
Read the source, Luke! Haha thanks for that Switeck.
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 8:32 am
by Eric Walch
Pleb wrote:I also tried playing around with an idea pagroove had about making aqua space - but I could not figure out how I would make space blue!
.....Must be possible though as when you fly near a planet into its atmosphere space turns blue then white so must be possible but couldn't find code that made this happen.
The specific atmosphere colors are set in.. planetEntity. I think this updating makes that it keeps black.
In trunk with the new planets (OOplanetEntity.m), the sky is only blue on the sunside of the planet. When traveling to the dark side, you even get a twilight zone.
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 8:35 am
by Pleb
Eric Walch wrote:The specific atmosphere colors are set in.. planetEntity. I think this updating makes that it keeps black.
In trunk with the new planets (OOplanetEntity.m), the sky is only blue on the sunside of the planet. When traveling to the dark side, you even get a twilight zone.
Ah thanks for that Eric! To be honest I've hardly looked in the trunk as when I first started playing with the source I encountered a bug so I started using the 1.76.1 code. Perhaps I would be better exploring the trunk code instead in order to keep up with more recent developments.
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 9:43 am
by another_commander
Sky color is controlled by Universe -update: method, here (approx. line 5300 in current trunk):
Code: Select all
skyClearColor[0] = 0.0;
skyClearColor[1] = 0.0;
skyClearColor[2] = 0.0; // changed this to 0.2 for below screenie
skyClearColor[3] = 0.0;
At least we can scratch that from the list
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 9:47 am
by Pleb
Haha! Wow thanks for that, makes it seem eerilly like Frontier now. Except for the evil newtronian physics, I will certainly not be trying to implement that into Oolite lol what a headache... I'm guessing that with some tweaking this 'might' be configuable from the planetinfo.plist as that would make for interesting space settings where you could change the colour of the space background. I will have to explore this prospect later when I get home though. Thank you again for finding that out A_C, I obviously wasn't trying hard enough last night. (Although it was gone midnight!)
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 11:15 am
by Pleb
Another thing I was playing around with last night was the Twin Plasma Cannon. I'd always seen it in equipment.plist and assumed it was broken so I modified its entry and fitted it to my ship - now I see why it wasn't included in the release! Actually trying to hit a ship with it is so hard, and it drains the energy banks so that I ended up being destroyed by the police I was trying to destroy. Having the plasma cannon fitted onto just turrets is much better. An interesting idea I had with the weapons though was if you could have them referenced in a plist rather than coded into the game would possibly allow for extra weapons to be added via OXPs. However, from what I can tell this would require a serious reworking of the current code and I'm not even sure it would be possible. Still, would be good to have new weapon types...
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 12:11 pm
by another_commander
Pleb wrote:[...] this would require a serious reworking of the current code and I'm not even sure it would be possible.
The Source is Power. Once you gain access to it, there is nothing that cannot be done, given sufficient time and persistence.
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 1:37 pm
by Pleb
another_commander wrote:The Source is Power. Once you gain access to it, there is nothing that cannot be done, given sufficient time and persistence.
Haha this is true, would be good if I could figure it out. I can now create new plist files and get the code to reference them in the game, so I know I could write a plist with data entries for weapons its just how to go about it all... I'm still in the process of perfecting loading different save games at the start of the game so maybe when I've cracked that the weapons will seem a lot easier. I can get the game to load a specified start game at the beginning, essentially overriding the start game settings by loading a saved game in a specified folder. Now I need to figure out a way of presenting a list of other start games to the player. One idea I had was to replicate the Load Commander GUI, but I would prefer it if this looked a bit different. Still its coming along, when I have something presentable I will share with all!
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 5:13 pm
by Griff
Good luck with your code experiments Pleb! I must admit i do love reading through these 'Oolite DVD commentary' threads that pop up every now and again when the devs discuss some new programming stuff and you get lots of posts filled with
Code: Select all
a = 10
f = 15
crazy programming voodo
Re: Musings about stuff that I could do to the source code..
Posted: Fri Jun 29, 2012 8:09 pm
by Tricky
Griff wrote:Good luck with your code experiments Pleb! I must admit i do love reading through these 'Oolite DVD commentary' threads that pop up every now and again when the devs discuss some new programming stuff and you get lots of posts filled with
Code: Select all
a = 10
f = 15
crazy programming voodo
You ought to see some of my code. I managed to code an IRC client in
LPC
Re: Musings about stuff that I could do to the source code..
Posted: Sat Jun 30, 2012 11:21 am
by pagroove
I like what you've done with the space colors. Is that feature easy to implement for oxp-makers? Could you even make it yellow/red/green?
Then you could simulate that the planet in question lies within a nebula.
I like to see nebula's included one day in Oolite. A game that does nebula's well is Freelancer. But I recon that nebula's in that way is difficult. But just being able to set the space color along with a good background can increase immersion immensely.