passenger transport
Moderators: winston, another_commander
passenger transport
you know the other day i was transporting passengers and i couldnt help but notice its really not worth any credits.. now i know this has been brought up befor... but i felt i have to ask. now that oolite is java is it possible to script and oxp that would make it more like cargo. like the more missions you did the more rich your customers would get. willing to pay larger prices for a safer or more scenic trip you know.. i just find it fun to taxi but i feel that 5 tons hull subtraction should atleast be worth something ya know.
once again sorry i know this has been brought up befor.. just figured i would throw it out there now that its on java.
once again sorry i know this has been brought up befor.. just figured i would throw it out there now that its on java.
Grab yourself a copy of the oolite-dev-source-1.71.2.tar.bz2
Learn how to compile oolite for your system
Then make the following changes to Universe.m in src/Core
At line 6573 there should look like
three lines down you see
after that line add
search for the line fee=cunningFee(fee) down in that routine.
add the line
above the line fee=cunningFee(fee).
With good reputation your fees should triple, with bad reputation your fees should go down to one third.
Learn how to compile oolite for your system
Then make the following changes to Universe.m in src/Core
At line 6573 there should look like
Code: Select all
- (NSArray *) passengersForSystem:(Random_Seed) s_seed atTime:(double) current_time
Code: Select all
int player_repute = [player passengerReputation];
Code: Select all
float fee_factor = 1;
unsigned f = 0;
if( player_repute < 0 ) {
for( f = 0; f < -player_repute; f++ ) fee_factor /= 1.17;
} else {
for( f = 0; f < player_repute; f++ ) fee_factor *= 1.17;
}
add the line
Code: Select all
fee = (OOCreditsQuantity) floor( fee* fee_factor);
With good reputation your fees should triple, with bad reputation your fees should go down to one third.
just one questionkrombart wrote:.
Code: Select all
unsigned f;
Are you aware of what the socalled basic types is, such as int,float,double what theire properties are and so on ?..
Further more i think it is ill advice to have people compile new local versions of Oolite, while they might not understand some fundamental things about object orientated programming.
Cheers Frame
Bounty Scanner
Number 935
Number 935
i did´nt tell you not to... , just said i think it is i´ll advice, especially when the lines you tell him to add have an error.krombart wrote:I've seen this in the source code of oolite.
And HEY! Don't tell me not to compile my own local version of oolite!
That's what OPEN SOURCE is good for.
So my search program which is ultra edit 8.1, damn good program too...
cant find
Code: Select all
unsigned f;
namely this piece of code
Code: Select all
float fee_factor = 1;
unsigned f = 0;
if( player_repute < 0 ) {
for( f = 0; f < -player_repute; f++ ) fee_factor /= 1.17;
} else {
for( f = 0; f < player_repute; f++ ) fee_factor
but allow me to correct it
it should be
Code: Select all
unsigned int f;
Bounty Scanner
Number 935
Number 935
- Cmdr James
- Commodore
- Posts: 1357
- Joined: Tue Jun 05, 2007 10:43 pm
- Location: Berlin
Code: Select all
unsigned i;
for (i = 0; i < 256; i++) [system_names[i] release];
I guess Frame could not find it because the variable is
Code: Select all
i
Code: Select all
f
I don't know what happend, as the price which is displayed in the gui screen and the price put in the savegame both simply take the value calculated above.
But with the following modification to the _original_ Universe.m it seems to work.
Put
just before the line
best regards.
(Happy to have passenger contracts for up to 5000 Cr if you did well.)
PS.: I choose f as loop counter, to avoid name clashes.
But with the following modification to the _original_ Universe.m it seems to work.
Put
Code: Select all
unsigned f = 0;
if( player_repute > 0 ) {
for( f = 0; f < player_repute; f++ ) fee = fee * 117 / 100;
} else {
for( f = 0; f < -player_repute; f++ ) fee = fee * 117 / 100;
}
Code: Select all
fee = cunningFee( fee );
(Happy to have passenger contracts for up to 5000 Cr if you did well.)
PS.: I choose f as loop counter, to avoid name clashes.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Not if we want to continue to play the same game.krombart wrote:And HEY! Don't tell me not to compile my own local version of oolite!
That's what OPEN SOURCE is good for.
If everybody would start to modify his game (the game code itself, I'm not talking about adding OXPs!), then there would quite quickly be nothing more to talk about in this forum, because there would no longer be a common base for us to build on.
So while an expert programmer might want to modify parts of the game code on his own private machine, and at any time be fully aware of the changes he has made and the resulting differences to anybody else's game, it is certainly not advisable to make this the behaviour for the usual player, who tends to forget that he is running a "custom" code, and will start to blame the programmers for behaviour that is seemingly different to what they tell him should be.
okay i´m sry then.. and yeah i searched for unsigned f;krombart wrote:I don't know what happend, as the price which is displayed in the gui screen and the price put in the savegame both simply take the value calculated above.
But with the following modification to the _original_ Universe.m it seems to work.
Put
just before the lineCode: Select all
unsigned f = 0; if( player_repute > 0 ) { for( f = 0; f < player_repute; f++ ) fee = fee * 117 / 100; } else { for( f = 0; f < -player_repute; f++ ) fee = fee * 117 / 100; }
best regards.Code: Select all
fee = cunningFee( fee );
(Happy to have passenger contracts for up to 5000 Cr if you did well.)
PS.: I choose f as loop counter, to avoid name clashes.
But i´ll stick to that it is not something you are supposed to do, just because you find it in Oolite source code, dont mean its canon.
And i bet the compiler Assumes you meant an INT... which is bad, if you wanted a float. Also i bet there are different compilers out there, that might not all assume this, but there usually are standards so it should be pretty safe.
i just ran a test in Visual Studio...
Where i did not tell it that it where an int
after that i set f = 1.01f
SO I´m getting this warning, ofcourse
Code: Select all
"somepath\nointtest\nointtest\nointtest.cpp(10) : warning C4244: '=' : conversion from 'float' to 'unsigned int', possible loss of data"
Regarding name clashes... its allways good to reuse allready declared "variables", if you are not still inside the scope of the for loop which uses the same varible..
Why, cause it saves memory. an INT takes up a measely 4 bytes, but 4 bytes there, and 4 bytes there make megabyte.. ..
And i´m with McLane 100%..
Bounty Scanner
Number 935
Number 935
Code: Select all
Not if we want to continue to play the same game.
If everybody would start to modify his game (the game code itself, I'm not talking about adding OXPs!), then there would quite quickly be nothing more to talk about in this forum, because there would no longer be a common base for us to build on.
So while an expert programmer might want to modify parts of the game code on his own private machine, and at any time be fully aware of the changes he has made and the resulting differences to anybody else's game, it is certainly not advisable to make this the behaviour for the usual player, who tends to forget that he is running a "custom" code, and will start to blame the programmers for behaviour that is seemingly different to what they tell him should be.
I agree to you, that I can't blame the original authors for bugs appearing in the game with my modifications. If I want to report bugs, I have to use the original game. ( And I did bug reporting only for the original game. )
I also disagree that there would be no common base. The common base would always be the original game. Why not let have people fun with their own flavour of the game?