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

i want to make lasers, but they are not buyable!

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

Moderators: winston, another_commander

Post Reply
zimmemic25
Competent
Competent
Posts: 47
Joined: Sun Jan 20, 2008 3:51 pm

i want to make lasers, but they are not buyable!

Post by zimmemic25 »

i have following files in my oxp:
Configs/equipment.plist:

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">
<array>
	<array>
		<integer>0</integer>
		<integer>99999</integer>
		<string>Ultimate Laser</string>
		<string>EQ_WEAPON_ULTIMATE_LASER</string>
		<string>THE Ultimate Laser weapon.</string>
		<dict>
			<key>available_to_all</key>
			<true/>
		</dict>
	</array>
</array>
</plist>
Schemata/shipyardSchema.plist:

Code: Select all

/*
	Schema for shipyard.plist.
*/

{
	$definitions =
	{
		$weaponType =
		{
			type = enumeration;
			values =
			(
				"EQ_WEAPON_ULTIMATE_LASER"
			);
		};
	};
}
but i cant see the lasers in the F3 buy equipment screen! :( :( :(
whats wrong?
what do i need?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6572
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Three problems:

Code: Select all

<array> 
   <array> 
      <integer>0</integer> 
      <integer>99999</integer>     <------- Problem 1 here
      <string>Ultimate Laser</string> 
      <string>EQ_WEAPON_ULTIMATE_LASER</string> 
      <string>THE Ultimate Laser weapon.</string> 
      <dict> 
         <key>available_to_all</key> 
         <true/> 
      </dict> 
   </array> 
</array> 
The line marked indicates the tech level above which this equipment will be available at. Change it to something like 1, to have it available almost everywhere or to 8, to have it available at tech level 9 or above. Remember, the tech level at which the equipment starts becoming available is the number you put in plus 1. 99999 means it will never be available.

Problem 2: The schemata folder is not to be touched. It contains files that provide information for OXP verification only. Don't do anything with this.

Problem 3: It is Config/ equipment.plist, not Configs/equipment.plist.
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:

Post by Commander McLane »

I see another problem: How should this laser work? What are its specifications? I think all this would have to be hard-coded, wouldn't it?

So you can make your laser available, especially if you follow another_commander's third hint, but I doubt it would do anything.

And by the way, another_commander: Your first problem isn't any. The first line defines the techlevel, the second one is the price, so the TL is 0 and the laser should become available everywhere, as soon the Config-folder is renamed properly. Which is of course unrealistic for an ultimate laser. The Military Laser has a TL of 10, so this one should have at least 11, if not 13. But still I am quite sure it wouldn't do anything.
zimmemic25
Competent
Competent
Posts: 47
Joined: Sun Jan 20, 2008 3:51 pm

Post by zimmemic25 »

another_commander wrote:
Three problems:

Code: Select all

<array> 
   <array> 
      <integer>0</integer>      <------- TL is here
      <integer>99999</integer>     <------- Price is here
      <string>Ultimate Laser</string> 
      <string>EQ_WEAPON_ULTIMATE_LASER</string> 
      <string>THE Ultimate Laser weapon.</string> 
      <dict> 
         <key>available_to_all</key> 
         <true/> 
      </dict> 
   </array> 
</array> 
The line marked indicates the tech level above which this equipment will be available at. Change it to something like 1, to have it available almost everywhere or to 8, to have it available at tech level 9 or above. Remember, the tech level at which the equipment starts becoming available is the number you put in plus 1. 99999 means it will never be available.

Problem 2: The schemata folder is not to be touched. It contains files that provide information for OXP verification only. Don't do anything with this.

Problem 3: It is Config/ equipment.plist, not Configs/equipment.plist.
1) wrong. its the price. the first INT is the TL. (i looked at 1.WIki, 2. sources.)
2)i'll delete it from my oxp
3)ok
2)
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2868
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

When you write a new .plist or change an old one, the first time you load up Oolite you must hold down the SHIFT to to force Oolite to rebuild the Cashe and so include your new code. If you don't your additions are not read. That may be way its not working, even with the typo of Config fixed.
Last edited by LittleBear on Tue Jan 22, 2008 9:28 am, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
zimmemic25
Competent
Competent
Posts: 47
Joined: Sun Jan 20, 2008 3:51 pm

Post by zimmemic25 »

i can buy it now, but it's shown like i have no weapon (just 2 lines in the hud) and i cant fire.

but how is it possible to add new lasers?
if you say how much energy the laser has, costs and how fast it overheats, isnt that enough?
a ship/missile is more difficult to include than a laser!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6572
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

I stand corrected about the 1st problem I mentioned. This is what happens when one tries to write from memory, esp. when memory is not what used to be... Sorry for the confusion I may have caused.
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:

Post by Commander McLane »

See what I wrote above:
Commander McLane wrote:
I see another problem: How should this laser work? What are its specifications? I think all this would have to be hard-coded, wouldn't it?

So you can make your laser available, especially if you follow another_commander's third hint, but I doubt it would do anything.
To repeat myself: I think the behaviour of lasers is hard-coded. So you can't make a new laser. Voilà.
zimmemic25
Competent
Competent
Posts: 47
Joined: Sun Jan 20, 2008 3:51 pm

Post by zimmemic25 »

but why do they hardcode this?
how should people expand the oouniverse if they can't?
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:

Post by Commander McLane »

You can expand the Ooniverse with anything else (missiles, for instance, if you're in the weapons-category). Just not lasers. At least not to my knowledge (that's what the "I think" means). So I could be wrong on that. I guess one of the coders will know. You could even ask the Master and Commander himself, who happened to give us the honour of his presence just today.
User avatar
Wiggy
Deadly
Deadly
Posts: 222
Joined: Fri Jan 21, 2005 1:12 pm
Location: London, Engerland

Post by Wiggy »

zimmemic25 wrote:
but why do they hardcode this?
Oh, I don't know... to stop people from making The Ultimate Laser Weapon, perhaps? :wink:

Check out the flame wars when someone suggested that military lasers should cool faster!
You came in that? You're braver than I thought!
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

I think the thing is that missiles are ships (I know it sounds odd) but they are entites that you can add to the ooniverse, and make new ones. Lasers are not entities, and are handled differently.

At the moment there are a few places where laser types are tested (hard coded) and having anything that isnt in the list will give weird, or no behavior. Some people may have tried fitting a thargoid laser and found that it didnt work.

If a new laser type is added, you will also have to revisit all the ships, and make them capable of mounting it -- at the moment you have to specify per ship, all the possible lasers.

All this could be changed, but it is not a simple thing that we can just add without thinking about.

There are of course other lasers in Frontier and FFE, so it is not completely without precedent :)
Post Reply