New ships under development

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

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: New ships under developemnt

Post by another_commander »

Shipbuilder wrote:
[Sorry to be a pain and I'm sure it is easy to find but I don't know where to locate oolite.app/Resources to find the above AI.plists :? If anyone could point me in the right direction it would be much appreciated.
If you are on Windows, the AIs are located in <Folder where you installed Oolite>/oolite.app/Resources/AIs.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: New ships under developemnt

Post by Thargoid »

Shipbuilder wrote:
If you look in the AI for the police ships (usually route1patrolAI.plist - found in the AI folder under oolite.app/Resources)
Sorry to be a pain and I'm sure it is easy to find but I don't know where to locate oolite.app/Resources to find the above AI.plists :? If anyone could point me in the right direction it would be much appreciated.
In your oolite install directory - that will depend on where you put it and which OS you are on.

Edit - Ninja'd by A_C in a role reversal from normal stylie.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: New ships under developemnt

Post by Capt. Murphy »

Thargoid wrote:
Capt. Murphy wrote:
Smiv's shipset is an example of where it's done via script. The JS equivalent is ship.lightsActive (read/write boolean). There is an advantage to doing it via script in that if you have flashers attached to a ships sub entities they can be controlled independently of each other or flashers attached to the main entity using JS.
Except for the minor point that you can't actually attach flashers to sub-entities?
Oh....the wiki entry for lightsActive suggested you can hence my post. Maybe it's just for shaders on sub-ents?
Setting this property to true turns on all the entity’s flashers, and setting it to false turns them off. Setting it sets the lightsActive property for all subentities, but subentities’ setting can also be manipulated separately. In addition to affecting flashers, the value can be used by shaders.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

Thanks guys - I'll check it out later and give it a go.

Looks like being my first steps in to a hopefully very simply AI exercise (Something that I have been putting off but definitely something that I need to get in to in order to develop more specific behaviour for future OXPs I intend to work on) :wink:

EDIT
- I intend to write a specific AI for the Cylon Raider Mark 1 so this will be the first big test ! :?
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: New ships under developemnt

Post by Thargoid »

Capt. Murphy wrote:
Oh....the wiki entry for lightsActive suggested you can hence my post. Maybe it's just for shaders on sub-ents?
Unless I'm missing something or we have a special case, it would be a sub-ent of a sub-ent, which I don't think is allowed. There's possibly no reason why it couldn't be for flashers (as there would be no recursion risk), but unless it's already been made an exception could possibly be requested there?
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: New ships under developemnt

Post by Commander McLane »

Capt. Murphy wrote:
Oh....the wiki entry for lightsActive suggested you can hence my post. Maybe it's just for shaders on sub-ents?
Setting this property to true turns on all the entity’s flashers, and setting it to false turns them off. Setting it sets the lightsActive property for all subentities, but subentities’ setting can also be manipulated separately. In addition to affecting flashers, the value can be used by shaders.
I think the entry is clear and exact. Nowhere does it claim that a subentity can have a flasher (= can have another subentity). It speaks about affecting subentities of an entity, namely those subentities that are flashers. lightsActive will de-/activate subentities that are flashers and entities/subentities that use shaders. I find that quite clear to understand.
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

I'm still struggling to get police ships with flashers turned on before I have attacked them. :(

I have updated the section in the shipdata.plist for the police version as follows: -

Code: Select all

		<key>ai_type</key>
		<string>colonial_viper_mark1_policeAI.plist</string>
		<key>auto_ai</key>
		<string>no</string>		
I then created a new subfolder in the .oxp folder named AIs and placed a copy of both route1patrolAI and policeInterceptAI in to this folder.

I renamed the route1patrolAI to colonial_viper_mark1_policeAI, changed the GLOBAL switchLightsOff to switchLightsOn and replaced any references to setAITo: interceptAI to setAITo: colonial_viper_mark1_InterceptAI.

I renamed the policeInterceptAI to colonial_viper_mark1_InterceptAI and changed all references to switchLightsOff to switchLightsOn.

Once I'd done this I thought that I had it........But unfortunately not.

Any ideas ?
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: New ships under developemnt

Post by Thargoid »

Hold down shift when you restart the game (until the spinning cobbie). Until you do, the changes in the OXP won't get recognised as the cached version will be used (ie with the original trunk AIs).

You can check by looking in the latest.log (it should tell you near the start that the cache was flushed due to shift being pressed), or by targetting one of the ships and using the console command PS.target.AI and PS.target.AIState to show the current AI and AI state of your target ship.
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

Thanks for the suggestions.
Hold down shift when you restart the game (until the spinning cobbie). Until you do, the changes in the OXP won't get recognised as the cached version will be used (ie with the original trunk AIs).
I have tried this and also removed the oxp from the addons folder reloaded Oolite then closed down put the oxp back in the addons folder and restarted but still no joy.
You can check by looking in the latest.log (it should tell you near the start that the cache was flushed due to shift being pressed), or by targeting one of the ships and using the console command PS.target.AI and PS.target.AIState to show the current AI and AI state of your target ship.
I will have a look at the log file tonight (I assume that it is in the Oolite folder where Oolite is installed).

With regard to the console command how do i use this ?
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: New ships under developemnt

Post by another_commander »

Shipbuilder wrote:
With regard to the console command how do i use this ?
The Debug Console is a must if you are doing OXP development or writing code for the core game. Using it lets you generate test conditions in the game in real-time in order to test OXPs, spawn ships you have created, change the AIs of entities on the fly, inject JavaScript code directly into the game and much more. It even allows for remote debugging sessions between two computers, where one is running the console and the other is running the game.

To enable it, you need to have Basic-debug.oxp installed in your AddOns folder. If you are using Windows, then Basic-debug.oxp is offered during installation of the game and by default it is installed, so unless you have changed the setting, you should have it already present.

Then you need to download the console program itself. It is found here: http://developer.berlios.de/project/sho ... e_id=18953.

To use it, you must run the OoDebugConsole.exe program before running Oolite. When run, the console window will open and report that it is waiting for connection. Starting up Oolite with the Basic-debug.oxp installed will establish this connection. From that point onwards, you can issue commands like the ones Thargoid mentioned earlier to the game via the console and see the responses/output in its window.

A simple search for "debug console" and "debug oxp" in the wiki yields some useful more in-depth information.
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

Thanks for the info another commander - It'll give me something to get my teeth in to this week :D
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

I have managed to install the Debug Console which has opened a connection with Oolite.

As a trial run I have started a new game, armed the ident computer and locked the computer on to a standard Galcop Viper.

I have typed the following 2 commands in to the Debug Console (with the reply from the debug also noted).

Code: Select all

>:PS.target.AIState
Macro :PS.target.AIState is not defined

>:PS.target.AI
Macro :PS.target.AI is not defined

Am I doing this correctly as I was expecting the Debug to report a particular AI ? (I get the same result if I fire at the Galcop Viper).
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: New ships under developemnt

Post by SandJ »

Remove the colon from before the PS.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

SandJ wrote:
Remove the colon from before the PS.
Thanks SandJ I've got the debug console working fine now thanks :D

So getting back to the original topic i.e. trying to specify a police ship where the flashers are on before being attacked I have checked that the cache has been flushed by holding shift down in the latest log file.

I have also checked using the PS.target.AI command in the debug console which has confirmed that the OXP is using the standard planetPatrolAI.plist for the AI hence the reason that flashers are off until attacked.

At least now I understand why the ship is not behaving in the way I want I just don't understand why the OXP is not using the colonial_viper_mark1_policeAI file :?

I'll have a double check through to make sure that I don't have any silly typos but I reckoned to have done this yesterday evening.
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: New ships under developemnt

Post by Shipbuilder »

Thanks to the advice I have recieved by using the Debug Console I have established that if I spawn ships using the debug console or if I encounter them in general play, i.e. flying between planets, they are using my colonial_viper_mark1_policeAI and colonial_viper_mark1_InterceptAI AI.

The issue where the Colonial Viper doesn't use my tweaked AI seems to be only when the ships launch from a station. In this case they use the standard route1patrolAI and policeInterceptAI AI.

Does anyone have any ideas how I can get the ships launching from stations to use the tweaked AI ?
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
Post Reply