Scripters cove

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

Moderators: another_commander, winston

User avatar
Nite Owl
---- E L I T E ----
---- E L I T E ----
Posts: 522
Joined: Sat Jan 20, 2018 4:08 pm
Location: In The Dark

Re: Scripters cove

Post 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.
Humor is the second most subjective thing on the planet

Brevity is the soul of wit and vulgarity is wit's downfall

Good Night and Good Luck - Read You Soon
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Scripters cove

Post 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!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2639
Joined: Thu Jun 20, 2013 10:22 pm

Re: Scripters cove

Post 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?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2286
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripters cove

Post 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?
"So anti-globalist, he's practically a flat-earther."
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2639
Joined: Thu Jun 20, 2013 10:22 pm

Re: Scripters cove

Post 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.
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2639
Joined: Thu Jun 20, 2013 10:22 pm

Re: Scripters cove

Post 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.
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Scripters cove

Post 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).
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4643
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post 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.
Post Reply