Page 1 of 1

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

Posted: Tue Jan 22, 2008 8:28 am
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?

Posted: Tue Jan 22, 2008 8:42 am
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.

Posted: Tue Jan 22, 2008 9:12 am
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.

Posted: Tue Jan 22, 2008 9:22 am
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)

Posted: Tue Jan 22, 2008 9:27 am
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.

Posted: Tue Jan 22, 2008 9:27 am
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!

Posted: Tue Jan 22, 2008 9:37 am
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.

Posted: Tue Jan 22, 2008 9:38 am
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Ă .

Posted: Tue Jan 22, 2008 1:23 pm
by zimmemic25
but why do they hardcode this?
how should people expand the oouniverse if they can't?

Posted: Tue Jan 22, 2008 1:49 pm
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.

Posted: Tue Jan 22, 2008 4:59 pm
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!

Posted: Tue Jan 22, 2008 7:12 pm
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 :)