Page 115 of 115

Re: Scripters cove

Posted: Sun Dec 24, 2023 12:05 pm
by Nite Owl
Got it to work by using the following code.

Code: Select all

this.shipWillDockWithStation = function (station)
{
	if (system.techLevel == 0 && (station.hasRole ("coriolis") || station.hasRole ("dodecahedron") || station.hasRole ("icosahedron") || station.hasRole ("sfep_station"))) player.addMessageToArrivalReport(expandDescription("[dockmessage_0]"));
	
	else
	
	if (system.techLevel == 1 && (station.hasRole ("coriolis") || station.hasRole ("dodecahedron") || station.hasRole ("icosahedron") || station.hasRole ("sfep_station"))) player.addMessageToArrivalReport(expandDescription("[dockmessage_1]"));
	
// continues through all tech levels and then moves on to individual stations

	if (station.hasRole ("rockhermit") || station.hasRole ("rockhermit-chaotic") || station.hasRole ("rockhermit-pirate")) player.addMessageToArrivalReport(expandDescription("[dockmessage_rock]"));
			
	else
	
	if (station.hasRole ("constore")) player.addMessageToArrivalReport(expandDescription("[dockmessage_store]"));

//the individual stations also continue

}
There was some worry about the use of this.shipWillDockWithStation versus this.shipDockedWithStation but there is method to my madness. It stated somewhere in the Wiki (that can no longer be found) that the first one will put my additional Arrival Messages BEFORE Oolite's usual Arrival Messages which is the desired behavior.

The code posted by phkb was very close to one of my previous attempts but mine lacked a few brackets which he kindly provided. It always seems to come down to the brackets, or the lack thereof. The testing and revamping phase can now begin. Thanks Again to phkb for pointing me in the right direction.

Re: Scripters cove

Posted: Sun Dec 24, 2023 12:17 pm
by Cholmondely
Nite Owl wrote: Sun Dec 24, 2023 12:05 pm
There was some worry about the use of this.shipWillDockWithStation versus this.shipDockedWithStation but there is method to my madness. It stated somewhere in the Wiki (that can no longer be found) that the first one will put my additional Arrival Messages BEFORE Oolite's usual Arrival Messages which is the desired behavior.
You can always get back to earlier versions of any wiki page by just clicking the history tab at the top - and then clicking the date of the version you are after.

That of course presumes that you know which page it was!

Re: Scripters cove

Posted: Sun Feb 11, 2024 11:38 am
by Redspear
I'm trying to convert pylons into more general equipment slots.
Pylons seem to expect either missile or mine designations however and so suit expendable (can be fired) items.

The provides option from equipment.plist would let me assign whatever other equipment I wished to the a theoretical 'missile' but I wouldn't wish it to otherwuise behave as a missile.

In the absence of shipWillLaunchMissile or similar, does anyone know a way I could fill the pylon slot without having the possibility of it being launched/expended?

Re: Scripters cove

Posted: Sun Feb 11, 2024 6:59 pm
by Wildeblood
Redspear wrote: Sun Feb 11, 2024 11:38 am
I'm trying to convert pylons into more general equipment slots.
Pylons seem to expect either missile or mine designations however and so suit expendable (can be fired) items.

The provides option from equipment.plist would let me assign whatever other equipment I wished to the a theoretical 'missile' but I wouldn't wish it to otherwuise behave as a missile.

In the absence of shipWillLaunchMissile or similar, does anyone know a way I could fill the pylon slot without having the possibility of it being launched/expended?
shipFiredMissile()
awardEquipmentToCurrentPylon()

These are what one uses for an infinite missiles cheat, apparently. If you also added the original missile deleting its own existence as soon as awardEquipmentToCurrentPylon succeeded, firing the missile would appear to have no effect, I guess. Is that what you're trying to achieve, or have I misread you?

Re: Scripters cove

Posted: Sun Feb 11, 2024 7:43 pm
by Redspear
Wildeblood wrote: Sun Feb 11, 2024 6:59 pm
s that what you're trying to achieve, or have I misread you?
Imagine if I wanted fuel scoops, for example, to take up a pylon slot when installed.

I can use requires_empty_pylon but the game seems to expect an equipment item ending in either _missile or _mine (rejecting it if it doesn't).

Now I could create a pseudo 'missile' or 'mine' that incorporates provides = ("EQ_FUEL_SCOOPS"); but I really don't want that item to be fired, even if I could replace it as you illustrate above, the act of firing it would spoil the illusion somewhat. So if it must be a missile/mine then I dont want it to behave as one

I essentially want to create a 'jammed missile', blocking its occupied pylon but also providing the desired equipment. Why pylon slots? Because they're predetermined for all existing ships. Apologies for any confusion.

Re: Scripters cove

Posted: Sat Mar 16, 2024 12:17 am
by Redspear
Is there a version of (or can I repurpose)... shipEnteredPlanetaryVicinity... to trigger when the player is near to the sun (and only the sun) instead of a planet?

...Worked it out:

this.shipEnteredPlanetaryVicinity = function(entity) {
if (entity.isSun)... etc.

Re: Scripters cove

Posted: Mon Apr 15, 2024 11:50 am
by Cholmondely
Station Allegiance. Ship Allegiance.

How would one create a station or a ship allied with the local government as distinct from GalCop?


Are there any examples of this?


I see nothing relevant in Station: allegiance or elsewhere (but would not know where to look).

Re: Scripters cove

Posted: Mon Apr 15, 2024 5:51 pm
by phkb
Cholmondely wrote: Mon Apr 15, 2024 11:50 am
Station Allegiance. Ship Allegiance.

How would one create a station or a ship allied with the local government as distinct from GalCop?
First off, allegiance only applies to stations, not ships.

I can't think of any examples, but you can put anything you like as the "allegiance", and the game will work. The AI, however, would treat it as "private", and thus probably ignore the station completely.