Page 5 of 5

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

Posted: Sun Dec 08, 2013 3:35 pm
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.

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

Posted: Sun Dec 08, 2013 6:55 pm
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)

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

Posted: Tue Dec 10, 2013 1:45 am
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:

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

Posted: Tue Dec 10, 2013 7:03 am
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.

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

Posted: Wed Dec 18, 2013 5:28 pm
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