Page 51 of 55

Re: Scripting requests

Posted: Mon Dec 16, 2013 1:11 pm
by another_commander
Zireael wrote:2) Guuys, there's 4 more function keys after F8, they could be used for something useful in the future.
Ehm, actually 3. F12 on the Win/Linux builds (not sure about Mac) toggles full screen on/off.

Re: Scripting requests

Posted: Mon Dec 16, 2013 9:53 pm
by Commander McLane
Zireael wrote:2) Have a key for console message log just like there's ~ for comms log.
Console messages are not logged. That's what distinguishes them from comms messages. If you want a message to be logged, use a comms message.

Re: Scripting requests

Posted: Wed Dec 18, 2013 8:14 am
by Zireael
One more thing I just remembered:
I thought I saw it mentioned somewhere in the vast Progress thread that 1-8 keys have been decoupled from F1-F8. I thought that we could bind 1-8 instead to the primable equipment in order of the player acquiring them. Equipment granted automatically (such as Chupa missile ID) would be on 1, Dock Assist I bought first would be on 2 and Telescope would be at 3. I could have up to 8 such pieces of equipment and I wouldn't have to worry about cycling through them...
This would save players a lot of hassle with Shift+N cycling.

Re: Scripting requests

Posted: Wed Dec 18, 2013 8:51 am
by cim
1.79 has two fast activation keys for primable equipment, plus you can have a third item on 'n' as usual. Do many people really have that much equipment on board their ships that they need instant access to four or more primable items?

Another thing that might be useful if you do have that much - you can customise your HUD to include a "drawPrimedEquipment:" dial with "n_bars" > 1

The other thing is that not every keyboard gives particularly easy access to the Fn keys, so we'd prefer to keep the default bindings for 1-8 as they are.

Re: Scripting requests

Posted: Wed Dec 18, 2013 2:07 pm
by Zireael
another_commander wrote:
Zireael wrote:2) Guuys, there's 4 more function keys after F8, they could be used for something useful in the future.
Ehm, actually 3. F12 on the Win/Linux builds (not sure about Mac) toggles full screen on/off.
*slaps forehead* Right.

And expanding on the idea of using F9-F11, I just thought we could slap some sort of in-game Ooniverse info under F10, coded similar to the F4 menu, and just kept separately to avoid undue clutter in F4. Thoughts.

Re: Scripting requests

Posted: Wed Mar 05, 2014 9:16 pm
by Pleb
I'm sure this is possible but I can't find any mention of it anywhere. Is there a way of making a carrier/station refuse docking clearance by script? For example, make a station/carrier refuse docking clearance to player unless a specific variable was enabled?

Re: Scripting requests

Posted: Wed Mar 05, 2014 11:40 pm
by cim
The [url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_ship_script_event_handlers#Docks_Only]acceptDockingRequestFrom[/url] event is probably what you're looking for, if you want to refuse docking clearance to some ships but not others.

If you just want to enable and disable the dock, the various dock properties are probably sufficient. Note that if you really want to keep the player out - not just fine them for docking without clearance - disallowedDockingCollides is needed.

Re: Scripting requests

Posted: Fri Mar 07, 2014 10:32 pm
by Pleb
I can't seem to get the acceptDockingRequestFrom function to work. I have the following:

Code: Select all

this.acceptDockingRequestFrom = function(ship)
{
	if (ship.scanClass == "CLASS_PLAYER")
	{
		return false;
	}
}
But doesn't seem to make a difference... :(

Re: Scripting requests

Posted: Fri Mar 07, 2014 10:58 pm
by cim
Pleb wrote:I can't seem to get the acceptDockingRequestFrom function to work. I have the following:

Code: Select all

this.acceptDockingRequestFrom = function(ship)
{
	if (ship.scanClass == "CLASS_PLAYER")
	{
		return false;
	}
}
But doesn't seem to make a difference... :(
You probably want to return true if the ship is not the player, and ship.isPlayer is a more reliable test. Still, that should be denying docking to the player - unless you've placed it in the wrong script: it needs to be in the dock's ship script, not the station's (because you might have multiple docks with different rules)

Re: Scripting requests

Posted: Sat Mar 08, 2014 8:36 pm
by Pleb
Still isn't working, this is the whole script:

Code: Select all

"use strict";

this.name 			= "himsn_carrier_dock.js";
this.author         = "Pleb";
this.copyright      = "(C) 2014 Pleb.";
this.licence        = "CC-NC-by-SA 2.0";
this.version 		= "0.6";

this.shipSpawned = function ()
{
	this.ship.allowsDocking = true;
}

this.acceptDockingRequestFrom = function(ship)
{
	if (ship.isPlayer)
	{
		return false;
	}
	else
	{
		return true;
	}
}

Re: Scripting requests

Posted: Sat Mar 08, 2014 8:58 pm
by cim
Should be fixed in commit e57bac0

It should also work now if you use the docking computer.

Thanks for the report

Re: Scripting requests

Posted: Sun Mar 09, 2014 11:39 am
by Pleb
Yay! This works now, thanks cim! :mrgreen:

Re: Scripting requests

Posted: Sat Mar 15, 2014 10:13 am
by Pleb
Just another quick one regarding docks, if the disallowedDockingCollides is read-only, as specified on the wiki, how would I set this to true to ensure that it is impossible to dock?

Re: Scripting requests

Posted: Sat Mar 15, 2014 10:23 am
by cim
Documentation fixed. (It's been read/write all along...)

Thanks for testing out all these new features.

Re: Scripting requests

Posted: Sat Mar 15, 2014 10:51 am
by Pleb
I'm not sure whether it's me missing something or this particular function not working the way it's supposed to (but I'm guessing it's probably the first one), but I'm still able to dock. I can disallow docking clearance but I can still dock:

Code: Select all

"use strict";

this.name 			= "himsn_station_dock.js";
this.author         = "Pleb";
this.copyright      = "(C) 2014 Pleb.";
this.licence        = "CC-NC-by-SA 2.0";
this.version 		= "0.7";

this.shipSpawned = function ()
{
	this.ship.allowsDocking = false;
	this.ship.disallowedDockingCollides = true;
}

this.acceptDockingRequestFrom = function(ship)
{
	return false;
}
This is a more simplified version of the actual script but even this will not work... :(

And thank you for all the new features, I wouldn't be able to implement Gimi's ideas for the HIMSN OXZ without them! :D