Just when I thought I was out...

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

Moderators: winston, another_commander

User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Ahruman wrote:
Maybe we should add a third one for “really really random” things…
You mean like variable constants :wink:
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Drats. Typo. :(

this is what it should have been:

Code: Select all

{
	"0 141" = {
		"description" = "This planet is a dull place. The headquarters of shipbuilder Taranis Corp is in high orbit above it.";
		"station" = "taranis_sysstation";
		"script_actions" = (
			"checkForShips: taranis",
				{
				conditions = ("shipsFound_number lessthan 1");
				do = ("addShipsAtPrecisely: taranis 1 pwm 147000 -30000 60000");
				},
			"checkForShips: taranis_frigate",
				{
				conditions = ("shipsFound_number lessthan 1");
				do = (
				"set: taranis_frigate_d100 [d100_number]",
					{
					conditions = ("taranis_frigate_d100 equal 1");
					do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 145000 -29000 60500");
					},
					{
					conditions = ("taranis_frigate_d100 equal 2");
					do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 250024.81 25.77 -102991.52");
					},
					{
					conditions = ("taranis_frigate_d100 equal 3");
					do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 178372.66 -9495.88 142342.08");
					},
					{
					conditions = ("taranis_frigate_d100 equal 4");
					do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 41048.76 33024.20 -3352.26");
					},
					{
					conditions = ("taranis_frigate_d100 equal 5");
					do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 178919.30 -39904.60 73889.03");
					},
				"reset: taranis_frigate_d100"
				);
				},
			"checkForShips: taranis_billboard",
				{
				conditions = ("shipsFound_number lessthan 1");
				do = ("addShipsAtPrecisely: taranis_billboard 1 pwm 134090.75 -21957.00 55025.19");
				},
		);
	};
}
the line before the end is }; - instead of }, :(
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

Argh! It *still* doesn't work. Even when I up the number of options to 100, meaning there should be a 100% chance of the frigate appearing, it doesn't appear (and I've tried exiting/re-entering the system and resaving). What the hell?

*EDIT* Stupid question perhaps, but d100_number does generate values such as 1, not 1.000000, right? Alternatively, could it somehow be resetting taranis_frigate_d100 before acting on it? Or not setting it up in time? :(
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Not such a stupid question. I've only used lessthan with numeric probabilities, mainly because that's what other people did...

to rewrite those probabilities using lessthan:

Code: Select all

 	{
		conditions = ("taranis_frigate_d100 lessthan 2");
		do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 145000 -29000 60500");
		else = (
			"subtract: taranis_frigate_d100 1",
			{
				conditions = ("taranis_frigate_d100 lessthan 2");
				do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 250024.81 25.77 -102991.52");
				else = (
					"subtract: taranis_frigate_d100 1",
					{
						conditions = ("taranis_frigate_d100 lessthan 2");
						do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 178372.66 -9495.88 142342.08");
						else = (
							"subtract: taranis_frigate_d100 1",
							{
								conditions = ("taranis_frigate_d100 lessthan 2");
								do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 41048.76 33024.20 -3352.26");
								else = (
									"subtract: taranis_frigate_d100 1",
									{
										conditions = ("taranis_frigate_d100 lessthan 2");
										do = ("addShipsAtPrecisely: taranis_frigate 1 pwm 178919.30 -39904.60 73889.03");
									}, 
								);
							},
						);
					},
				);
			},
		);
	},

And finally, if you still don't have any luck after all those brackets, does it make a difference if your variable is called mission_taranis_frigate_d100 instead?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

I tried the "mission_" thing first... and that makes it work :) Serves me right for omitting it in the first place. Thanks Kaks!
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

OK, I have two things left to do. The first of these may be fairly easy or frustratingly difficult - I don't know yet. Basically, I want players to be randomly offered Taranis-related delivery jobs in Lerelace and the surrounding systems. Nothing fancy - just "deliver item X to location Y within Z days". Because they'll be so simple, ideally I'd like these to appear on the "Carrier Market" screen. My questions:

1. Is it possible to use this screen?
2. If so, can I do it without replacing any of the in-game cargo contracts?
3. If I have to use the standard "mission screen" set-up, what happens if two missions are offered at the same time? (I already have a mission beginning at Taranis.)
4. What would be the best OXP to look at for guidance? (I'm guessing UPS.)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

3. If I have to use the standard "mission screen" set-up, what happens if two missions are offered at the same time? (I already have a mission beginning at Taranis.)
4. What would be the best OXP to look at for guidance? (I'm guessing UPS.)
UPS could be to large to start with. You could look here:

http://wiki.alioth.net/index.php/OXP_mission_offering

This wiki page only deals with plist scripting. For JS look in UPS.
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 »

Roberto wrote:
OK, I have two things left to do. The first of these may be fairly easy or frustratingly difficult - I don't know yet. Basically, I want players to be randomly offered Taranis-related delivery jobs in Lerelace and the surrounding systems. Nothing fancy - just "deliver item X to location Y within Z days". Because they'll be so simple, ideally I'd like these to appear on the "Carrier Market" screen. My questions:

1. Is it possible to use this screen?
2. If so, can I do it without replacing any of the in-game cargo contracts?
3. If I have to use the standard "mission screen" set-up, what happens if two missions are offered at the same time? (I already have a mission beginning at Taranis.)
4. What would be the best OXP to look at for guidance? (I'm guessing UPS.)
No, you can't use anything else but the mission screen.

For the how-to just follow Eric's link above. The very basic idea is that you need a condition which checks that you're not already on a mission screen. If you are, the new mission screen has to wait until the first one is finished.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

I'll have to return to this later today, but here's what I'm thinking (to begin with):

1. Store lists of items, destination planets and delivery times in descriptions.plist.
2. Have script.plist set variables based on these, thus "fixing" them for the contract.
3. Have script.plist set a fee based on some d100_number business.
4. Have something like the following in missiontext.plist:

Code: Select all

	<key>taranis_delivery_offer</key>
	<string>Commander [commander_name], would you be willing to make a delivery on behalf of Taranis Corp? If you could deliver [taranis_delivery_item] to [taranis_delivery_planet] within [taranis_delivery_time], the company would pay you [taranis_delivery_fee].</string>
Does this sound like a sensible way to proceed?
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
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 »

If you have a look at Random Hits or Navy OXP, that'll give you an idea. I have gone over the top on random briefings (I was off work for three weeks with an injury and got very board!). Using a descriptions.plist to make the mission briefing is the easyist way and the mission text you have should do it. The random hits one works like this (in mission text):-

Code: Select all

<key>level_one_mark_advert</key>
<string>mission_random_hits_seedy_spacebar_name\n--------------------------------------------------------------------------------------------------------------------------\nPOSTED BY  : mission_random_hits_assassination_board_poster_title %R mission_random_hits_assassination_board_poster_name from the mission_random_hits_assassination_board_poster_system System.\nSUBJECT      : [mission_random_hits_assassination_board_subject]\n\nmission_random_hits_assassination_board_part1 mission_random_hits_mark_first_name mission_random_hits_mark_nick_name [mission_random_hits_mark_second_name] is mission_random_hits_mark_race_part1 [mission_random_hits_mark_race_part2] [mission_random_hits_assassination_board_part2]. mission_random_hits_assassination_board_part3 mission_random_hits_mark_ship_description [mission_random_hits_mark_ship], mission_random_hits_assassination_board_part4 mission_random_hits_mark_system System. mission_random_hits_assassination_board_part5 mission_random_hits_mark_fee Credits mission_random_hits_assassination_board_part6 mission_random_hits_mark_gender mission_random_hits_assassination_board_part7\n\nREPLIES TO   : [mission_random_hits_assassination_board_address1] [mission_random_hits_assassination_board_poster_name]@[mission_random_hits_assassination_board_address2]\n--------------------------------------------------------------------------------------------------------------------------\nCurrently viewing [assassination_board_job_name] mission_random_hits_page of 3. [assassination_board_easykill]</string>
As each variable has sub-tables in decriptions trillions of different mission are possible. In game it gives stuff like:-

"Skilled murder required to perform deadly laser surgery. Commander 'Two Guns' Roberto is a horrible edible computer programmer suspected of crushing the Laveian Dictator's favorite pet trumble in a waste disposal unit. The vile criminal, flying a rusty Cobra Mk III is presently infesting the Riinus System. A reward of 2675 Credits will be paid to anyone who facilities his recieving a missile up his aft view."

Only the words IS, CREDITS and System are hard coded, the rest is pulled a word or two at a time from the descriptions file.
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.
Post Reply