Scripters cove

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

Moderators: winston, another_commander

User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2409
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post by Wildeblood »

Rese249er wrote:
Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
User avatar
Rese249er
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Thu Jun 07, 2012 2:19 pm
Location: Well, I WAS in G3...

Re: Scripters cove

Post by Rese249er »

Odd. Could you point one out?
Got all turned around, lost my nav connection... Where am I now?
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Scripters cove

Post by spara »

Wildeblood wrote:
spara wrote:
Is this what you are looking for: f(x)=x*100^((x-4000)/36000), where 4000 <= x <= 40000 ?
I think it is. Thank you.
:( :evil:
:? Didn't work the way you wanted?
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Re: Scripters cove

Post by Commander McLane »

Wildeblood wrote:
An arithmetic question. I need a procedure that will take a number between 0 and 36000 (actually 4000 to 40000, but I think I can manage adding and subtracting 4000) and output a number between 0 and 3996000 (4000000-4000), such that there's no distortion at the bottom of the range, but a 100x exaggeration at the top of the range. So 4000 -> 4000, but 40000 -> 4000000, or 0 -> 0, but 36000 -> 3996000. I think this is called a geometric progression, but being the victim of a state school education, my mathematical ability is limited to basic addition and subtraction.
So you want to make the range of 0 ... 36000 into the range of 0 ... 3996000? The only thing you need to know is the factor between these two ranges, which means the factor between 36000 and 3996000.

Thus: 3996000 / 36000 = 111.

Thus all you need to do is to multiply you original number by 111, and there you are.

And of course you need to subtract 4000 before the operation, and add them again after the operation. Which gives us:

Code: Select all

var newNumber = originalNumber - 4000;
newNumber *= 111;
newNumber += 4000;
in JS, where originalNumber is of course the number between 4000 ... 40000 that is fed into the equation.

Or, the same thing in one line, which we get by substituting the steps from back to front:

Code: Select all

var newNumber = ((originalNumber - 4000) * 111) + 4000
which is a pretty straightforward translation from the English language: take your original number, subtract 4000, multiply by 111, and add 4000. :)

The values aren't distorted in any way. Only the steps of 1 between whole numbers are transformed into steps of 111. So instead of 4000, 4001, 4002 ... 40000 you get 4000, 4111, 4222 ... 4000000. If you feed real numbers into it, you'll of course get anything in-between as well.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Scripters cove

Post by spara »

Ah. I assumed it was exponential growth that was wanted not linear. Sorry for the hassle.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2409
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post by Wildeblood »

spara wrote:
Ah. I assumed it was exponential growth that was wanted not linear.
Yes.

This is what I am currently using:

Code: Select all

	if (x > 40000) x = null;
	if (x && x > 4000) x = (x * (x - 4000)/360 + 4000).toFixed(0);
The 360 divisor comes from previously having 36000 followed by a 100 multiplier.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2409
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post by Wildeblood »

Rese249er wrote:
Odd. Could you point one out?
Point what out - a HUD with two or ten scanners? No, take my word for it. You didn't answer the relevant question, did you try with 1.76.1 or with a trunk build?
User avatar
Rese249er
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Thu Jun 07, 2012 2:19 pm
Location: Well, I WAS in G3...

Re: Scripters cove

Post by Rese249er »

It's a trunk build, r5555.
Got all turned around, lost my nav connection... Where am I now?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2409
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post by Wildeblood »

Wildeblood wrote:
Rese249er wrote:
Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Well, there ya go. In 1.76 you can define ten scanners on the HUD centred on the same point, but all slightly different sizes, and it gives the appearance of each scanner contact being drawn as a line, instead of a dot, like an old-school radar display. But that trick no longer works in trunk, because it only draws one scanner. That's progress, I guess. :|
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Re: Scripters cove

Post by Commander McLane »

Wildeblood wrote:
spara wrote:
Ah. I assumed it was exponential growth that was wanted not linear.
Yes.

This is what I am currently using:

Code: Select all

	if (x > 40000) x = null;
	if (x && x > 4000) x = (x * (x - 4000)/360 + 4000).toFixed(0);
The 360 divisor comes from previously having 36000 followed by a 100 multiplier.
Ah. I thought you wanted an equal distribution.

The only problem with your formula is that it produces results > 4000000 for x > 39981. That's easy to fix by adjusting the divisor. Change it to 360.36036, and you're there.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Scripters cove

Post by cim »

Wildeblood wrote:
Rese249er wrote:
Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Fixed in r5562.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2409
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post by Wildeblood »

cim wrote:
Wildeblood wrote:
Rese249er wrote:
Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Fixed in r5562.
Well, there ya go. You know, I always thought it was a bit odd that you could include several scanners. It didn't surprise me at all when it was changed (and I knew it had been because I'd read the comment in HeadUpDisplay.m previously). Now it's back. Sometimes I wonder if you guys really have a clear idea of how you intend/anticipate people will use these features. Sometimes I think you're just making it up as you go along.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripters cove

Post by Smivs »

Wildeblood wrote:
Sometimes I wonder if you guys really have a clear idea of how you intend/anticipate people will use these features.
Hehe, who knows what a bunch of nutters like us will do when given a new toy feature!
Wildeblood wrote:
Sometimes I think you're just making it up as you go along.
I think that's called 'Being innovative' :wink:
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2409
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post by Wildeblood »

Smivs wrote:
Wildeblood wrote:
Sometimes I wonder if you guys really have a clear idea of how you intend/anticipate people will use these features.
Hehe, who knows what a bunch of nutters like us will do when given a new toy feature!
Except in this case it's not new. (And I've already said how I've used it.)
Smivs wrote:
Wildeblood wrote:
Sometimes I think you're just making it up as you go along.
I think that's called 'Being innovative' :wink:
Are you sure it's not being 'indecisive'? Now a multi-shift galactic hyperdrive, that would be unambiguously innovative. :D
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripters cove

Post by Smivs »

Wildeblood wrote:
Now a multi-shift galactic hyperdrive, that would be unambiguously innovative. :D
Sounds good...I'd get one! :D
Commander Smivs, the friendliest Gourd this side of Riedquat.
Post Reply