Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Scripters cove

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

Moderators: winston, another_commander

User avatar
Rorschachhamster
---- E L I T E ----
---- E L I T E ----
Posts: 274
Joined: Sun Aug 05, 2012 11:46 pm
Contact:

Re: Scripters cove

Post by Rorschachhamster »

Worked after I made the orbit height a property of the ship (satellite). :D
Dumbed down the AI to "Just fly around it, do not care if there's somethign in the way..." :wink:
Now I just have to spawn them randomly around the planet.... and two more models. :wink:
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: Scripters cove

Post by GGShinobi »

Rorschachhamster wrote:
Dumbed down the AI to "Just fly around it, do not care if there's somethign in the way..." :wink:
:idea: I think this is actually pretty cool! :o Real trains don't stop or evade, either! :mrgreen:
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
Rorschachhamster
---- E L I T E ----
---- E L I T E ----
Posts: 274
Joined: Sun Aug 05, 2012 11:46 pm
Contact:

Re: Scripters cove

Post by Rorschachhamster »

GGShinobi wrote:
Rorschachhamster wrote:
Dumbed down the AI to "Just fly around it, do not care if there's somethign in the way..." :wink:
:idea: I think this is actually pretty cool! :o Real trains don't stop or evade, either! :mrgreen:
Oh, this is not about the trains. They should evade asteroids, stations etc. Maybe not spaceships... :D :wink:
I just make something inbetween to look with fresh eyes at the train AI and I think I stumbled about what's the problem already... :D :wink:
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

Hello everyone,

Today I tried to write an OXP...

I followed the tutorial on the wiki, and got nothing. Because the mac was awkward with file saving, I had a go with my old linux laptop, and still, nothing. Then I copied and pasted a sample requires.plist, to no effect. I then altered a copy of oldships, so that there was only the player cat ship, and renamed it, gave it roll and pitch of 2, and made it cost 4 credits for testing. Still nothing. I think I must be doing something drastically wrong, but can't tell what. Any ideas?
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 »

Can you post your latest log please?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

How do I find the log? And while we're on the subject, what is a log? Sorry, I just don't have a background in programming :?
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

Ah, found it!

20:47:13.275 [plist.parse.failed]: Failed to parse /Users/.../Documents/Oolite 1.77/AddOns/erubadhron.oxp/Config/shipdata.plist as a property list.
Close tag on line 169 does not match open tag plist
20:47:13.849 [shipData.load.shipyard.unknown]: ----- WARNING: the shipyard.plist entry "erubadhron" does not have a corresponding shipdata.plist entry, ignoring.
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 »

OK, so two problems, one with the shipdata.plist and one with the shipyard.plist, which could be a shipdata error as well.
Can you post the shipdata.plist here inside 'Code' tags (you'll find a button for these above where you type your comment).
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>erubadhron</key>
	<dict>
		<key>aft_eject_position</key>
		<string>0.0 -7.2 -6.0</string>
		<key>energy_recharge_rate</key>
		<real>3</real>
		<key>exhaust</key>
		<array>
			<string>5.0 0.0 -28.0 3 4 10.0</string>
			<string>-5.0 0.0 -28.0 3 4 10.0</string>
		</array>
		<key>forward_weapon_type</key>
		<string>WEAPON_BEAM_LASER</string>
		<key>laser_color</key>
		<string>yellowColor</string>
		<key>max_cargo</key>
		<integer>2</integer>
		<key>max_energy</key>
		<real>384</real>
		<key>max_flight_pitch</key>
		<real>2</real>
		<key>max_flight_roll</key>
		<real>2</real>
		<key>max_flight_speed</key>
		<real>365</real>
		<key>max_missiles</key>
		<integer>4</integer>
		<key>missile_launch_position</key>
		<string>0.0 -1.5 12</string>
		<key>missiles</key>
		<integer>1</integer>
		<key>model</key>
		<string>cat.dat</string>
		<key>name</key>
		<string>Cat Mark I</string>
		<key>roles</key>
		<string>player</string>
		<key>subentities</key>
		<array>
			<string>catwing	0.0 0.0 0.0	    1 0 0 0</string>
			<string>catwing	0.0 0.0 0.0	    0 0 0 1</string>
		</array>
		<key>thrust</key>
		<real>45</real>
		<key>view_position_aft</key>
		<string>0.0 9.0 -30.0</string>
		<key>view_position_forward</key>
		<string>0.0 9.0 8.0</string>
		<key>view_position_port</key>
		<string>-7.0 9.0 8.0</string>
		<key>view_position_starboard</key>
		<string>7.0 9.0 8.0</string>
		<key>weapon_position_aft</key>
		<string>0.0 0.0 -30.0</string>
		<key>weapon_position_forward</key>
		<string>0.0 4.6 30.0</string>
		<key>weapon_position_port</key>
		<string>-10.0 0.0 15.0</string>
		<key>weapon_position_starboard</key>
		<string>10.0 0.0 15.0</string>
		<key>custom_views</key>
		<array>
			<dict>
				<key>view_description</key>
				<string>External View 1</string>
				<key>view_position</key>
				<string>0.0 40.0 -200.0</string>
				<key>view_orientation</key>
				<string>1.0 0.0 0.0 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 2</string>
				<key>view_position</key>
				<string>140.71 40.0 -140.71</string>
				<key>view_orientation</key>
				<string>0.9239 0.0 0.3827 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 3</string>
				<key>view_position</key>
				<string>200.0 40.0 0.0</string>
				<key>view_orientation</key>
				<string>0.7071 0.0 0.7071 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 4</string>
				<key>view_position</key>
				<string>140.71 40.0 140.71</string>
				<key>view_orientation</key>
				<string>0.3827 0.0 0.9239 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 5</string>
				<key>view_position</key>
				<string>0.0 40.0 200.0</string>
				<key>view_orientation</key>
				<string>0.0 0.0 1.0 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 6</string>
				<key>view_position</key>
				<string>-140.71 40.0 140.71</string>
				<key>view_orientation</key>
				<string>0.3827 0.0 -0.9239 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 7</string>
				<key>view_position</key>
				<string>-200.0 40.0 0.0</string>
				<key>view_orientation</key>
				<string>0.7071 0.0 -0.7071 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
			<dict>
				<key>view_description</key>
				<string>External View 8</string>
				<key>view_position</key>
				<string>-140.71 40.0 -140.71</string>
				<key>view_orientation</key>
				<string>0.9239 0.0 -0.3827 0.0</string>
				<key>weapon_facing</key>
				<string>FORWARD</string>
			</dict>
		</array>
	</dict>
	<key>catwing1</key>
	<dict>
		<key>ai_type</key>
		<string>nullAI.plist</string>
		<key>energy_recharge_rate</key>
		<real>1.5</real>
		<key>forward_weapon_type</key>
		<string>WEAPON_MILITARY_LASER</string>
		<key>laser_color</key>
		<string>orangeColor</string>
		<key>max_energy</key>
		<real>60</real>
		<key>model</key>
		<string>catwing.dat</string>
		<key>name</key>
		<string>Cat Wing</string>
		<key>roles</key>
		<string>catwing</string>
	</dict>	
		</dict>
</dict>
</plist>
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 »

Aaaargh! Sorry, but I really can't read XML plists! It looks like you might have closed too many dictionaries (</dict>) at the end but without going through the whole thing which will take time, I can't say for sure. Maybe someone happier with XML will see this. I'll get back to you later when I've had a chance to look at it if not.
Oolite itself and most OXPs no longer use XML (although it is perfectly OK) because it is so cumbersome. If you are going to get into OXPs take a look at the preferred openStep format - maybe download a newer ship OXP as a template, or just look at the core game's plists in the resources folder.
openStep is a much more compact and human-friendly format which makes it easier to write and easier to bugfix in my opinion.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

Okay, I'll try deleting a </dict> or two, and if that doesn't work I'll try modifying a core plist as an OXP as you suggested. I thought XML looked a bit easier, plus the fact that it's the only one in the tutorial on the wiki... I'd better change then! Thanks
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

YES! Somehow, it works. For some reason, I applied the change, checked, nope. Got cabal common library for snoopers to work, and saw my ship! :D
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Scripters cove

Post by Thargoid »

Modifications within OXPs aren't picked up unless you start the game with the shift key held down. Otherwise the cached version from before the modification will continue to be used instead. But the game does detect if an OXP is added, removed or renamed. It then marks the cache as stale and rebuilds it automatically.

It sounds like your snoopers change caused a cache rebuild which also caused your other mod in this OXP to also get picked up too.
User avatar
HAL
Competent
Competent
Posts: 49
Joined: Wed Aug 29, 2012 2:05 pm

Re: Scripters cove

Post by HAL »

Maybe that was it... but I did do that always_flush_cache secret setting thing, so it should have refreshed it anyway.
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 »

Glad it's working :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
Post Reply