Source Code and Ideas question

General discussion for players of Oolite.

Moderators: another_commander, winston

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

Re: Source Code and Ideas question

Post by cim »

Diziet Sma wrote:If you want 1.77.1 you'd have to pull "maintenance/1.77", which is the branch that will one day become 1.78, when the devs decide it has spent enough time in the bugfix finding/fixing zone.
maintenance/1.77 is the source as it was at release of 1.77.1

If you want the source that is eventually becoming 1.78 (with a few extra bugfixes) then that's the maintenance/1.78 branch.
Last edited by cim on Sun Jan 19, 2014 1:27 pm, edited 1 time in total.

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6310
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Source Code and Ideas question

Post by Diziet Sma »

@ another_commander.. thanks for the clarification.. I'm still getting the hang of this github stuff.
cim wrote:If you want the source that is eventually becoming 1.78 (with a few extra bugfixes) then that's the maintenance/1.78 branch.
Ok.. I must've somehow not noticed that one when I was looking the branches over.. thanks for the correction. 8)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied

hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Re: Source Code and Ideas question

Post by hangar18 »

another_commander wrote:You do not need a github account to download the source, unless you are one of the developers with commit rights. Many people without github accounts have built from source already, so we know that the instructions do work. hangar18, what is the actual message you are getting? Have you followed the instructions exactly as shown in the first post of the thread we linked you to?

Also, pull requests are not related to downloading the source for casual users, they are requests from people who have made changes to the code in their own external repositories, asking us to pull their changes in. Once you have pulled the entire repository, you can change to any of the existing branches using git checkout <branchname>.
Yes I've followed the instructions exactly. This is the obstacle I cant overcome..after making a directory d/myoolite (all good), I changed directory with cd /d/myoolite (again all good), but then typed the following with the subsequent response

$ git clone https://github.com/ooliteproject/oolite.git
cloning into 'oolite'....
Username for 'https://github.com/ooliteproject/oolite.git': <I input my GIT username>
Password for 'https://<username>@github.com': <I input my password>
remote: Repository not found
fatal: Repository 'https://github.com/ooliteproject/oolite.git' not found

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Source Code and Ideas question

Post by JensAyton »

There are capital letters in https://github.com/OoliteProject/oolite.git

hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Re: Source Code and Ideas question

Post by hangar18 »

JensAyton wrote:There are capital letters in https://github.com/OoliteProject/oolite.git
Yes there are...I'm so stupid. Thank you...its all good now :)

hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Re: Source Code and Ideas question

Post by hangar18 »

Well the good news is I've successfully managed to change the number and names of elite rankings from 9 to 15. The bad news is the initial git download was version 1.79 which has some instability issues. what I really want is the last stable release which is 1.77.1. I thought it would be a case of downloading the 1.77.1 source code directly from the web (instead of git clone using https://github.com/OoliteProject/oolite.git ) , unzipping it in a directory and running the rest of the 4 stage code process by another_commander, but alas get a fatal error. Should I modify the git clone https://github.com/OoliteProject/oolite.git in some way to pick up the 1.77.1 code?
Last edited by hangar18 on Tue Jan 21, 2014 10:44 am, edited 2 times in total.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5451
Joined: Wed Feb 28, 2007 7:54 am

Re: Source Code and Ideas question

Post by another_commander »

You already have the 1.77.1 code in your local repository. To access it, just go to the root folder of your oolite repository and do
git checkout 1.77.1

That's it. Your source tree will be instantly switched to the code for 1.77.1. You can then work on your changes there.
git checkout master will bring you back to the bleeding edge.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5451
Joined: Wed Feb 28, 2007 7:54 am

Re: Source Code and Ideas question

Post by another_commander »

As this topic is effectively about how to build the source and not related to OXPs, it has been moved to Discussion.

hangar18
Competent
Competent
Posts: 45
Joined: Sun Sep 04, 2011 9:10 am

Re: Source Code and Ideas question

Post by hangar18 »

Many thanks...on another note, I've run out of ideas for renaming the elite classes and legal standings - some of these are pretty lame. Can anyone help generate new ideas. So far I have...

"Unknown",
"Rookie",
"Greenhorn",
"Trainee Cadet",
"Cadet",
"Experienced Cadet",
"Captain",
"Trainee Commander",
"Commander",
"Assassin",
"Competent Assassin",
"Dangerous",
"☆ Deadly ☆",
"★★★ E L I T E ★★★"

and for legal status

"Clean",
"Suspect",
"Offender (Minor)",
"Offender (Serial)",
"Offender (Wanted)",
"Fugitive (Marauder)",
"Fugitive (Pirate)",
"Fugitive (☆ Terrorist ☆)",
"★★★ Enemy of the galaxy ★★★"

User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6402
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Source Code and Ideas question

Post by Disembodied »

I think it would be a shame to throw away all but three of the original rankings: "Harmless" and "Mostly Harmless", especially, have something of a pedigree! You could keep them, and just fill them out a bit, e.g.:

Harmless
Mostly Harmless
Greenhorn
Poor
Rookie
Below Average
Average
Above Average
Competent
Capable
Dangerous
Deadly
Lethal
Elite

For the legal status, I'd suggest swapping "Fugitive (Marauder)" and "Fugitive (Pirate)": a "Pirate" sounds more generic to me (they might be a software pirate ... ;)), whereas a "Marauder" is definitely someone to be avoided.

User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 884
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Source Code and Ideas question

Post by Pleb »

I think my legal status in Oolite is already ★★★ Enemy of the galaxy ★★★ :twisted:

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Re: Source Code and Ideas question

Post by Thargoid »

So what does that make me? :twisted:

User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 884
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Source Code and Ideas question

Post by Pleb »

Thargoid wrote:So what does that make me? :twisted:
Galactic Enemy No.1? :P :lol:

User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 884
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Source Code and Ideas question

Post by Pleb »

So I tried to have a go at this and I came up with:

Code: Select all

NSString *OODisplayRatingStringFromKillCount(unsigned kills)
{
	NSArray				*ratingNames = nil;
	NSArray				*ratingKills = nil;
	unsigned			i;
	
	ratingNames = [[UNIVERSE descriptions] oo_arrayForKey:@"rating_names"];
	ratingKills = [[UNIVERSE descriptions] oo_arrayForKey:@"rating_kills"];
	for (i = 0; i < [ratingKills count] - 1; ++i)
	{
		if (kills < [ratingKills oo_unsignedIntAtIndex:i])  return [ratingNames oo_stringAtIndex:i];
	}
	
	return [ratingNames oo_stringAtIndex:[ratingKills count] - 1];
}
But unfortunately this didn't work... :cry:

Nyarlatothep
Average
Average
Posts: 12
Joined: Tue Jan 21, 2014 2:58 pm

Re: Source Code and Ideas question

Post by Nyarlatothep »

Exactly how didn't it work? Did the game crash to desktop?

You've got 2 independent arrays there, and by the look of it, there's no guarantee in the code that rating_names has got as many entries as rating_kills. If you try to get a string or a number from past the end of the array, any array, programs do tend to crash a lot.

I'd have:

Code: Select all

   NSArray            *ratingNames = nil;
   NSArray            *ratingKills = nil;
   unsigned            i;
   unsigned            shortestArray;
   
   ratingNames = [[UNIVERSE descriptions] oo_arrayForKey:@"rating_names"];
   ratingKills = [[UNIVERSE descriptions] oo_arrayForKey:@"rating_kills"];
   shortestArray = [ratingKills count];
   if ([ratingNames count] < shortestArray) shortestArray = [ratingNames count];

   if (shortestArray > 0)
   {
       for (i = 0; i < shortestArray  - 1; ++i)
       {
          if (kills < [ratingKills oo_unsignedIntAtIndex:i])  return [ratingNames oo_stringAtIndex:i];
       }
   
       return [ratingNames oo_stringAtIndex:shortestArray  - 1];
    }
    return @"either names or kills have a zero length array";
Not sure if it'd compile, I might have mislaid a semicolon or two, plus I'm not too sure that the count method will return a number if you've got a null 'array'. You might have to check that both [ratingNames count] & [ratingKills count] return an actual number before knowing for sure that that piece of code won't crash & burn in absolutely all circumstances.

Post Reply