Musings about stuff that I could do to the source code...

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2689
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: Musings about stuff that I could do to the source code..

Post by Redspear »

(This seemed like the right place to post...)

I'd like to tinker with the laser ranges. I've had a little look at the source and found that one of the ShipEntity files contains a few lines that appear to be what I'm after but can't find similar in the PlayerEntity files.

Am I missing something?
Is this more complicated than I realise?

Any help appreciated.

Thanks.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Musings about stuff that I could do to the source code..

Post by cim »

Redspear wrote:
I'd like to tinker with the laser ranges. I've had a little look at the source and found that one of the ShipEntity files contains a few lines that appear to be what I'm after but can't find similar in the PlayerEntity files.
PlayerEntity inherits from ShipEntity, so the ShipEntity class contains the laser parameters for both (approximately - energy usage is currently only tracked for the player weapons, so that is in PlayerEntity)
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2689
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: Musings about stuff that I could do to the source code..

Post by Redspear »

Thanks cim :)
So that's just the weapon ranges at the end of ShipEntity.m then is it?

Once I've edited the file will I need to 'recompile' my build or some such?

Apologies for my 'noobitude' but this is very much new territory for me... :oops:
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Musings about stuff that I could do to the source code..

Post by cim »

Redspear wrote:
Once I've edited the file will I need to 'recompile' my build or some such?
Yes. If you run 'make -f Makefile' again (or XCode's build process, if you're using a Mac) then it'll rebuild ShipEntity (and, though there shouldn't be any this time, any other files which might need rebuilding because of your changes) and then remake the Oolite executable.
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2689
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: Musings about stuff that I could do to the source code..

Post by Redspear »

cim wrote:
Redspear wrote:
Once I've edited the file will I need to 'recompile' my build or some such?
Yes. If you run 'make -f Makefile' again (or XCode's build process, if you're using a Mac) then it'll rebuild ShipEntity (and, though there shouldn't be any this time, any other files which might need rebuilding because of your changes) and then remake the Oolite executable.
Worked a treat. Thanks :D
Post Reply