Scripters cove

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Scripters cove

Post by hiran »

Whohoo! Another finding!

There is a way to retrieve a sorted dictionary already! Dictionary? Sorted? Well, that's what it seems to be...
https://github.com/OoliteProject/oolite ... y.m#L12854

I would so much like to see a unit test that verifies the list is sorted. To be run on all the operating systems we compile on.
Sunshine - Moonlight - Good Times - Oolite
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Scripters cove

Post by Wildeblood »

hiran wrote: Fri Oct 25, 2024 8:39 pm
Could it be that a dictionary internally ends up to be a hashmap and therefore the sequence is not predictable? Could we change this to some container that preserves a sequence? As soon as it does, sorting can be applied...
I think you're barking up a dead tree, hiran. If world scripts were sorted into a consistent, predictable order what good would result? I'd predict a lot of scripts named "AAA my script", etc.
In your heart, you know it's flat.
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Scripters cove

Post by hiran »

Wildeblood wrote: Fri Oct 25, 2024 9:08 pm
hiran wrote: Fri Oct 25, 2024 8:39 pm
Could it be that a dictionary internally ends up to be a hashmap and therefore the sequence is not predictable? Could we change this to some container that preserves a sequence? As soon as it does, sorting can be applied...
I think you're barking up a dead tree, hiran. If world scripts were sorted into a consistent, predictable order what good would result? I'd predict a lot of scripts named "AAA my script", etc.
The use case was made some posts above in this thread. I see that case legit.
What would you suggest to get around that in a meaningful way?

Be aware your example assumes everybody wants to be first. But then you forget the authors that do not care, and the authors that just want to be before a specific script but by no means the first. If all this imposes problems we can still come up with rules. Currently there is no consistent sorting so the scripts live in kind of anarchy.
Sunshine - Moonlight - Good Times - Oolite
Post Reply