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

Path of Hesperus

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

Moderators: winston, another_commander

Post Reply
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Path of Hesperus

Post by Arexack_Heretic »

A (set of) missionscript I've been messing with lately.
For those who like to pick code apart.
This is still embryonic as in barely any testing done, but it's a big baby already. ;)

The idea is to follow in the pawprints of Captain hesperus and sell trumbles to valued clients.

A major obstacle still is understanding java-script as I want to be able to affect/read the number of trumbles on-board the playership.
-As of this writing, the trumbleChecker.js script is still not functioning.

At first I had written the main body of the script completely in JS, however writing a missionscript seems to be much easier in plist format. (for now.)
So yesterday I wrote the entire thing again, but in plist.
Eventually I decided to split it up into several partial scripts, and a worldscripts-file.

Currently I use an additional test-script that forces some variables, that rely on the JS-part to be set.

-trumblecheck_farmer.js
: trumblecheck trumbleCount +
: sets customCargo, rewards for burning trumbs.
-trumblepusher.plist
: asks player to make a lifechoice when loaded with trumbes.
-life_of_a_trumble_salesperson.plist
: if the player has succumbed to the darkside ,
: asks to push a trumble at stations. /rinse, repeat.
-trumble_force
: Brute force setting of mission_variables because I'm a fuckup with JS.

Next posts: buggered code.
Last edited by Arexack_Heretic on Thu Oct 25, 2007 2:51 pm, edited 2 times in total.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Javascript: trumblecheck_farmer.js

Post by Arexack_Heretic »

Code: Select all

this.name         = "Arexacks-JS-trumblecheck";
this.author         = "Arnoud van Marion";
this.copyright      = "This work is hereby placed in the public domain.";
this.description   = "checks number of trumbles, displays a consoleMessage and more.";
this.version      = "1.69.1";


// timer not yet working...

// Start timer after launch
//this.hasLaunched = function() {start(timerAH)};
// Stop timer when docking
//this.isDocking = function() {stop(timerAH)};
// every 30 seconds do check
//this.timerAH = new Timer(this, function() {this.trumblecheck}, 30, 30)

//using tickle in place of timer untill it works (expected: v1.70)

	//trumblecheck function
	//setup variable to remember trumbles_at_last_count
	//check playerproperty trumbleCount against the remembered variable
	//if not identical, (a)lower: print message, save new value. (b)higher: print message, save new value to variable
this.trumbleCheck = function()
{  
   if (missionVariables.AH_trumbleNumber == "undefined") 
	{
		missionVariables.AH_trumbleNumber = 0; //set variable AH_trumbleNumber to 0 if undefined, 
	}
	else if (missionVariables.AH_trumbleNumber != "undefined")
	{
		var old_trumbleNumber = missionVariables.AH_trumbleNumber;
		var new_trumbleNumber = player.call("trumbleCount"); // let i.s.o. var in 1.70?
		//Request for JS trumbleCount method (or access to every entity property)
		missionVariables.AH_trumbleNumber_old = missionVariables.AH_trumbleNumber;
		Log("I has " + new_trumbleNumber + " trumbles");
		if (new_trumbleNumber <= old_trumbleNumber)
		{
			player.consoleMessage("Trumbles decreasing:" + new_trumbleNumber + "remaining.");
			missionVariables.AH_trumbleNumber = new_trumbleNumber; //update missionvariable
			this.harvestTrumbles(new_trumbleNumber,old_trumbleNumber);
		}
		else if (new_trumbleNumber >= old_trumbleNumber)
		{
			player.consoleMessage("Trumbles multiplying: increased to" + new_trumbleNumber + ".");
			missionVariables.AH_trumbleNumber = new_trumbleNumber; //update missionvariable
		}
		else
		{
			player.consoleMessage("You have very cute trumbles, " + new_trumbleNumber + " of them!");
		}
	}
	else 
	{
		missionVariables.AH_trumbleNumber = "undefined"; // if trumblevariable not yet set, this should do it.
	}
}

this.trumbleFarmer = function() //This method(function?) sets the missionVariable.trumbleCargo used by the other methods(functions?).
{ 
	Log("pusher: that tickles");
	var new_trumbleNumber = missionVariables.AH_TrumbleNumber;
	if (new_trumbleNumber >= 19)	
	{
		missionVariables.trumbleCargo = FULLOFTRUMBLES; 
		player.useSpecialCargo("a hold full of trumbles"); //when 5/6th of max trumbles, cargoroom is filled in one go. better would be to reduce cargospace by increments. I wonder how different cargosizes work.
	}
	else if (new_trumbleNumber <= 20 && missionVariable.trumbleCargo == FULLOFTRUMBLES)	
	{
		player.removeAllCargo; //make room
		missionVariables.trumbleCargo = HAS_TRUMBELS; //to prevent dumping real cargo.
	}
	else
	{
		missionVariables.trumbleCargo = NO_TRUMBELS; // trumbles have run out.
	}
}	

this.harvestTrumbles = function()
{
	var new_trumbleNumber = missionVariables.AH_TrumbleNumber;
	var old_trumbleNumber = missionVariables.AH_TrumbleNumber_old;
	var amount = old_trumbleNumber-new_trumbleNumber;
	if (missionVariables.trumbleCargo != FULLOFTRUMBLES)
	{
		player.awardCargo(Furs, (amount));
	}
}

this.startLookingForTrumbles = function()
{
    this.tickle = this.trumbleCheck;
    this.tickle = this.trumbleFarmer;
    // OR timerAH.start()
}


this.stopLookingForTrumbles = function()
{
    delete this.tickle;
    // OR timerAH.stop()
}


this.didLaunch = function()
{
    if (player.hasEquipment("EQ_TRUMBLE"))
    {
        this.startLookingForTrumbles()
    }
    else
    {
        this.stopLookingForTrumbles()
    }
}

this.willDock = function()
{	
	this.stopLookingForTrumbles();
}

this.didScoop = this.didLaunch; // Not called in 1.69, so this version wouldn’t notice trumbles from cannisters until the next launch.


this.reset = this.stopLookingForTrumbles // Redundant if timers are being used, but not harmful.
Last edited by Arexack_Heretic on Fri Oct 26, 2007 12:32 pm, edited 2 times in total.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

plist: trumblepusher_script.plist + enduringcargo.js

Post by Arexack_Heretic »

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>wanna_be_a_trumblesalesman</key> <!-- this script sets missionVariables trumblePusher and uses mission_AH_trumbleCargo, it also sets the mission_trumbletrader_counter to zero.-->
	<array>
		<string>debugOn</string>
		<string>debugMessage: 'wanna_be_a_trumblesalesman' checking.</string>
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_AH_trumbleCargo equal FULLOFTRUMBLES</string>
				<string>mission_trumblepusher undefined</string>
			</array>
			<key>do</key>
			<array>
				<string>set: mission_trumblepusher FULL_LOAD</string>
				<string>debugMessage: Player has a full load of trumbles.</string>
				<string>setMissionDescription: trumble_fullload</string>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_trumblepusher equal FULL_LOAD</string>
				<string>mission_offering undefined</string>
			</array>
			<key>do</key>
			<array>
				<string>debugMessage: setting up mission offer delay</string>
				<string>set: local_offerChoice [pseudoFixedD100_number]</string>
				<dict>
					<key>conditions</key>
					<array>
						<string>local_offerChoice morethan 79</string>
					</array>
					<key>do</key>
					<array>
						<string>debugMessage: mission delay finished</string>
						<string>set: mission_offering trumblepusher</string>
						<string>set: mission_trumblepusher OFFER_SOLUTION</string>
					</array>
					<key>else</key>
					<array>
						<string>debugMessage: not now, wait longer</string>
					</array>
				</dict>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_trumblepusher equal OFFER_SOLUTION</string>
				<string>gui_screen_string equal GUI_SCREEN_MANIFEST</string>
				<string>missionChoice_string undefined</string>
			</array>
			<key>do</key>
			<array>
				<string>debugMessage: mission offer made</string>
				<string>setMissionImage: itsfulloftrumbles.png</string>
				<string>setGuiToMissionScreen</string> 
				<string>addMissionText: trumble_pusher_maintext1</string>
				<string>set: mission_trumblepusher LIFECHOICE_OFFERED</string>
				<string>setMissionChoices: trumble_pusher_yesno</string>
			</array>
		</dict>	
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_AH_trumbleCargo oneof FULLOFTRUMBLES,HAS_TRUMBELS</string>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_trumblepusher equal LIFECHOICE_OFFERED</string>
				<string>missionChoice_string equal PUSHER</string>
			</array>
			<key>do</key>
			<array>
				<string>debugMessage: pusherChoice was become PUSHER</string>
				<string>setMissionImage: itsfulloftrumbles.png</string>
				<string>setGuiToMissionScreen</string>
				<string>addMissionText: trumble_pusher_maintext2</string>
				<string>set: mission_trumbletrader_counter 0</string>
				<string>resetMissionDescription</string>
				<string>setMissionDescription: pusher_desc</string>
				<string>resetMissionChoice</string>
				<string>set: mission_trumblepusher PUSHER</string>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_AH_trumbleCargo oneof FULLOFTRUMBLES,HAS_TRUMBELS</string>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_trumblepusher equal LIFECHOICE_OFFERED</string>
				<string>missionChoice_string equal NEVER</string>
			</array>
			<key>do</key>
			<array>
				<string>debugMessage: pusherChoice was NEVER</string>
				<string>resetMissionChoice</string>
				<string>clearMissionScreen</string>
				<string>set: mission_trumblepusher NEVER</string>
				<string>reset: mission_offering</string>
			</array>
		</dict>
		<!-- Eric Walsh's missionscreen conflict avoidance: --> 
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_offering trumblepusher</string>
				<string>mission_trumblepusher oneof NEVER,PUSHER</string>
			</array>
			<key>do</key>
			<array>
				<string>reset: mission_offering</string>
			</array>
			<key>else</key>
			<array>
				<dict>
					<key>conditions</key>
					<array>
						<string>mission_offering trumblepusher</string>
						<string>status_string equal STATUS_LAUNCHING</string>
					</array>
					<key>do</key>
					<array>
						<string>reset: mission_offering</string>
					</array>
				</dict>
			</array>
		</dict>	
		<!-- If you got rid of trumbles, next time you get infected you will be asked again. -->
		<!-- this script sets the missionVariables mission_trumbletrader and uses mission_AH_trumbleCargo -->
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_AH_trumbleCargo equal NO_TRUMBELS</string>
			</array>
			<key>do</key>
			<array>
				<string>reset: mission_trumblepusher</string>
				<string>resetMissionDescription</string>
			</array>
		</dict>
		<!-- work around UseSpecialCargo not saved in savefile -->
	<!--	<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_DOCKED</string> <!-- maybe even leave this out? Conceivably Player could launch before *tickle* -->
				<string>mission_AH_trumbleCargo equal FULLOFTRUMBLES</string>
			</array>
			<key>do</key>
			<array>
				<string>useSpecialCargo: [AH_specialCargo_trumbles]</string>
			</array>
		</dict>
		<string>debugOff</string>	
	</array>
</dict> -->
<!-- The choice has now been made to become a trumble pusher or not. -->
</plist>
-----

Code: Select all

this.name         = "Arexacks-EnduringSpecialCargo";
this.author         = "Arnoud van Marion";
this.copyright      = "This work is hereby placed in the public domain.";
this.description   = "makes sure the specialcargo is retained";
this.version      = "1.69.1";

this.EnduringSpecialCargo = function()
{
	var a = missionVariable.trumbleCargo;
	if (a = "FULLOFTRUMBLES")
	{
		player.useSpecialCargo("AH_specialCargo_trumbles");
		LogWithClass("this.name", "Using special cargo.");
	}
}

this.reset = this.EnduringSpecialCargo();

this.willDock = this.EnduringSpecialCargo(); 
//I gather that removeAllCargo is called by this method, so invocing it when docking should remove any scooped loot.
Last edited by Arexack_Heretic on Fri Oct 26, 2007 12:30 pm, edited 10 times in total.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

plist: life_of_a_trumble_salesperson.plist

Post by Arexack_Heretic »

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">
<!-- Second script handles selling them: -->
<dict>
	<key>life_of_a_trumblesalesman</key> <!-- This script uses the missionVariables mission_AH_trumbleCargo, mission_trumblepusher sets/uses the local variable local_trumbletrader and mission_trumbletrader_counter -->
	<array> 
		<string>debugOn</string>
		<string>debugMessage: 'sell me a purring lufa?...with eyes!'</string>
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_AH_trumbleCargo oneof FULLOFTRUMBLES,HAS_TRUMBELS</string>
				<string>status_string equal STATUS_DOCKED</string>
				<string>mission_trumblepusher equal PUSHER</string>
			</array>
			<key>do</key>
			<array>
				<dict>
					<key>conditions</key>
					<array>
						<string>local_trumbletrader notequal KEEP_TRUMBLE</string>
						<string>gui_screen_string equal GUI_SCREEN_CONTRACTS</string>
						<string>missionChoice_string undefined</string>
						<string>mission_offering undefined</string>
					</array>
					<key>do</key>
					<array>
						<string>set: mission_offering selltrumbles</string>
						<string>setMissionImage: trumblebox.png</string>
						<string>setGuiToMissionScreen</string> 
						<string>addMissionText: trumbletrader_trysell</string>
						<string>setMissionChoices: trumbletrader_trysell_yesno</string>
						<string>set: local_trumbletrader TRADECHOICE</string>
					</array>
				</dict>
				<dict>
					<key>conditions</key>
					<array>
						<string>local_trumbletrader equal TRADECHOICE</string>
						<string>missionChoice_string undefined</string>
					</array>
					<key>do</key>
					<array>
						<dict>
							<key>conditions</key>
							<array>
								<string>missionChoice_string SELL_TRUMBLE</string>
							</array>
							<key>do</key>
							<array>
								<string>setMissionImage: trumblebox.png</string>
								<string>setGuiToMissionScreen</string> 
								<string>set: local_trumbletrader ATTEMPT_SELL_TRUMBLE</string>
								<string>resetMissionChoice</string>
							</array>
						</dict>
						<dict>
							<key>conditions</key>
							<array>
								<string>missionChoice_string KEEP_TRUMBLE</string>
							</array>
							<key>do</key>
							<array>
								<string>setMissionImage: none</string>
								<string>setGuiToMissionScreen</string> 
								<string>set: local_trumbletrader KEEP_TRUMBLE</string>
								<string>resetMissionChoice</string>
							</array>
						</dict>
					</array>
				</dict>
				<dict>
					<key>conditions</key>
					<array>
						<string>local_trumbletrader equal ATTEMPT_SELL_TRUMBLE</string>
						<dict>
							<key>conditions</key>
							<array>
								<string>mission_trumbletrader_counter lessthan 5</string> <!-- first five are freebees -->
							</array>
							<key>do</key>
							<array>
								<string>set: local_trumbletrader SALE_ON</string>
							</array>
							<key>else</key>
							<array>
								<dict>
									<key>conditions</key>
									<array>
										<string>d100_number lessthan mission_trumbletrader_counter</string>
									</array>
									<key>do</key>
									<array>
										<string>set: local_trumbletrader SALE_ON</string>
									</array>
									<key>else</key>
									<array>
										<string>set: local_trumbletrader BUSTED</string>
									</array>
								</dict>
							</array>
						</dict>
					</array>
				</dict>
			</array>
		</dict>	
<!-- ***********************| actual sale of a trumble |*********************** -->							
		<dict>
			<key>conditions</key>
			<array>
				<string>local_trumbletrader equal SALE_ON</string>
			</array>
			<key>do</key> <!-- insert bargaining here -->
			<array>
				<string>addMissionText: trumble_sold_35</string>
				<string>awardCredits: 350</string>
				<string>set: local_trumbletrader SOLD_TRUMBLE</string>
				<string>increment: mission_trumbletrader_counter</string>
				<string>resetMissionChoice</string>
				<string>setMissionChoices: trumble_sell_again_yesno</string> <!-- sell again? -->
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_AH_trumbleCargo oneof FULLOFTRUMBLES,HAS_TRUMBELS</string>
				<string>local_trumbletrader equal SOLD_TRUMBLE</string>
				<string>missionChoice_string YES_TRUMBLEAGAIN</string>
			</array>
			<key>do</key>
			<array>
				<string>resetMissionChoice</string>
				<string>clearMissionScreen</string>
				<string>set: local_trumblerader ATTEMPT_SELL_TRUMBLE</string>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_AH_trumbleCargo NO_TRUMBELS</string>
				<string>local_trumbletrader equal SOLD_TRUMBLE</string>
				<string>missionChoice_string YES_TRUMBLEAGAIN</string>
			</array>
			<key>do</key>
			<array>
				<string>resetMissionChoice</string>
				<string>setMissionImage: emptybox.png</string>
				<string>setGuiToMissionScreen</string> 
				<string>addMissionText: trumbles_soldout</string>
				<string>set: local_trumbletrader NONE_TRUMBLE</string>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>local_trumbletrader equal NONE_TRUMBLE</string>
			</array>
			<key>do</key>
			<array>
				<!-- <string>clearMissionScreen</string> ***PLAYERENTITY DOES NOT RESPOND TO THIS METHOD -->
				<string>set: local_trumbletrader KEEP_TRUMBLE</string>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>local_trumbletrader equal SOLD_TRUMBLE</string>
				<string>missionChoice_string NO_TRUMBLEAGAIN</string>
			</array>
			<key>do</key>
			<array>
				<string>resetMissionChoice</string>
				<string>clearMissionScreen</string>
				<string>set: local_trumbletrader KEEP_TRUMBLE</string>
				<string>reset: mission_offering</string>
			</array>
		</dict>	
<!-- ******************************| Busted! |******************************** -->
<!-- if at MainStation: calculate amount of fine acc2gov't + legalstatus increment -->
<!-- if stationIsNotMainStation: launch -->		
		<dict>										
			<key>conditions</key>
			<array>
				<string>local_trumbletrader equal BUSTED</string>
				<string>status_string equal STATUS_DOCKED</string>
				<string>reset: mission_offering</string>
			</array>
			<key>do</key>
			<array>
				<string>setMissionImage: none</string> 
				<dict>
					<key>conditions</key>
					<array>
						<string>dockedAtMainStation_bool equal NO</string>
					</array>
					<key>do</key>
					<array>
						<string>reset: mission_trumbletrader</string>
						<string>clearMissionScreen</string> 
						<string>add: mission_trumbletrader_counter 4</string>
						<string>launchFromStation</string>
					</array>
					<key>else</key>
					<array>
						<!-- <string>setMissionImage: policeperson_holding_a_trumble.png</string> -->
						<string>set: local_bounty legalStatus_number</string>
						<string>add: local_bounty d100_number</string>
						<dict>
							<key>conditions</key> 
							<array><string>credits_number morethan [trumble_fine]</string></array>
							<key>do</key>
							<array>
								<string>setLegalStatus: local_bounty</string>
								<string>add: mission_trumbletrader_counter systemGovernment_number</string>
								<string>addMissionText: trumblepusher_fines</string>
								<string>awardCredits: -[trumble_fine]</string>
							</array>
							<key>else</key>
							<array>
								<string>add: local_bounty d100_number</string>
								<string>setLegalStatus: local_bounty</string>
								<string>add: mission_trumbletrader_counter systemGovernment_number</string>
								<string>addMissionText: trumblepusher_fines_toohigh</string>
								<string>awardCredits: -[credits_number]</string>
							</array>
						</dict>
					</array>
				</dict>
			</array>
		</dict>						
<!-- reset trade-record at launch -->
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_LAUNCHING</string>
				<string>local_trumbletrader equal KEEP_TRUMBLE</string>
			</array>
			<key>do</key>
			<array>
				<string>reset: local_trumbletrader</string>
			</array>
		</dict>	
<!-- notoriety dropoff -->
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_EXITING_WITCHSPACE</string>
				<string>mission_trumbletrader_counter morethan 0</string>
			</array>
			<key>do</key>
			<array>
				<string>decrement: mission_trumbletrader_counter</string>
			</array>
		</dict>
		<dict>
			<key>conditions</key>
			<array>
				<string>status_string equal STATUS_LAUNCHING</string>
				<string>mission_trumblepusher equal PUSHER</string>
			</array>
			<key>do</key>
			<array>
				<string>reset: local_trumbletrader</string>
			</array>
		</dict>
		<!-- Eric Walsh's missionscreen conflict avoidance: --> 
		<dict>
			<key>conditions</key>
			<array>
				<string>mission_offering selltrumbles</string>
				<string>status_string equal STATUS_LAUNCHING</string>
			</array>
			<key>do</key>
			<array>
				<string>reset: mission_offering</string>
			</array>
		</dict>	
		<string>debugOff</string>
	</array>
	<!-- later test this construction: "setMissionImage: [trumble-image].png" -->
</dict>
</plist>
Last edited by Arexack_Heretic on Thu Oct 25, 2007 9:07 pm, edited 3 times in total.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

config: missiontext. + worldscripts. + descriptions.plist

Post by Arexack_Heretic »

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>trumble_pusher_maintext1</key>
	<string>It is no longer possible to take on any cargo; your hold is full of trumbles. 
	One way to make room in your hold may be to sell some to unsuspecting victiiii-CUStomers! 
	Yes, shrewd traders that can see the growth potential of a small investment!
	
	Become a trumble pusher?</string>

	<key>trumble_fullload</key>
	<string>You can no longer take on any cargo.
	Trumbles are everywhere!</string>
	
	<key>trumble_pusher_yesno</key>
	<dict>
		<key>NEVER</key>
		<string>Never! I will find another way.</string>
		<key>PUSHER</key>
		<string>Yes... this could be a goldmine.</string>
	</dict>
	
	<key>trumble_pusher_maintext2</key>	
	<string>You have decided to become a trumblepusher.
	Try to sell as many trumbles as you can and make a tidy profit while getting rid of the pests!
	Remember that selling invasive aliens is illegal, so be carefull where you peddle your wares.
	Your sense of humour is uncharacteristic, most commanders will not appreciate the many charms of trumbles.
	</string>	
	
	<key>pusher_desc</key>
	<string>You have taken the first step down the path of Hesperus. Sell as many trumbles as you can.</string>
	
	<key>trumbletrader_trysell</key>
	<string>Do you want to hawk your pretty trumbles here?//n</string>
	
	<key>trumbletrader_trysell_yesno</key>
	<dict>
		<key>KEEP_TRUMBLE</key>
		<string>Not here, they are watching me.</string>
			<!-- <string>Not now, they are watching me.</string> <string>No, they are too cute to sell.</string> --> <!-- add to descriptions.plist ?  <string>[not_sell_trumble]</string> -->
		<key>SELL_TRUMBLE</key>
		<string>Yes, I spotted some punters who might buy some.</string>
		 <!-- add to descriptions.plist ?  <string>[do_sell_trumble]</string> -->
		<!-- <string>Yes, need to get rid of these vermin.</string> <string>Yes, I really need some Creds.</string> -->
	</dict>
	
	<key>trumble_sell_again_yesno</key>
	<dict>
		<key>YES_TRUMBLEAGAIN</key>
		<string>Yes, gotta sell'em all!</string> 
		<key>NO_TRUMBLEAGAIN</key>
		<string>No, that would not be prudent.</string>
	</dict>
	
	<key>trumble_bargain</key>
	<string>Sell a trumble at what price?/n</string>
	
	<key>trumble_price</key>
	<dict>
		<key>10</key>
		<string>Ten Credits, I'm really desperate!</string>
		<key>30</key>
		<string>Thirty Credits, a real bargain!</string>
		<key>50</key>
		<string>Fifty Credits, this one is a really rare specimen.</string>
		<key>100</key>
		<string>One-hundred Credits, the last of it's kind Sir.</string>
	</dict> 
	
	<key>trumble_sold_35</key>
	<string>You have sold a trumble for 35 Credits.</string>
	
	<key>trumble_sold_price</key>
	<string>You have sold a trumble for [missionChoice_string].0 Credits.</string>
	
	<key>trumbles_soldout</key>
	<string>You have no trumbles left to sell.</string>
	
	<key>trumblepusher_fines</key>
	<string>You have been fined [trumble_fine]Cr. for selling hazardous xenoforms without a permit./nThis offence has been added to your permanent record.</string>
	<key>trumble_fine</key>
	<string>1[systemGovernment_number]0</string>
	
	<key>trumblepusher_fines_toohigh</key>
	<string>You have been busted for pushing trumbles./nAs you are unable to pay your fines,/ncharges of vagrancy have been added to your permanent record.</string>
	
</dict>
</plist>
-----------------------------------------------------------

Code: Select all

(
	// List of world scripts provided by the OXP.
	"trumblecheck_farmer.js", //doesn't seem to function yet, therefore forcing trumbles by script "force_trumbles.plist"
	// "trumblepusher.js"
	"trumblepusher_script.plist",
	"force_trumbles.plist",
	"life_of_a_trumble_salesperson.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">
<dict>
	<key>AH_specialCargo_trumbles</key>
	<array>
		<string>A load full of trumbles.</string>
		<string>A shitload of trumbles.</string>
		<string>Trumbles up to your ears.</string>
		<string>Trumbles wall-to-wall-to-ceiling.</string>
		<string>A cargobay filled with trumbles.</string>
		<string>Trumbles fill all available cargospace.</string>
		<string>There is naught but trumbles.</string>
		<string>If only cargospace could be expanded exponentially.</string>
		<string>2[d100_number]0[d100_number] trumbles.</string>
		<string>A googleplex(R) of trumbles.</string>
		<string>Trumbles ate your cargobay.</string>
		<string>Storage-deck is overrun with trumbles.</string>
		<string>The trumbles are everywhere.</string>
		<string>More trumbles than HALs little sister can count.</string>
	</array>
</dict>
</plist>
Last edited by Arexack_Heretic on Fri Oct 26, 2007 12:13 am, edited 2 times in total.
Riding the Rocket!
ilnar
Above Average
Above Average
Posts: 21
Joined: Wed Oct 03, 2007 10:34 pm

Post by ilnar »

*looks worried*


this just looks bad,,,,,

well no it looks good, but well,,,
you know what i mean
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

first time I really try to do a missionscreen based script,
(excepting GetHesperus as I never got to testing that)
there's bound to be lots of misplaced clearmissionscreens etc.

at the moment I'm stuck in :
comparing "GUI_SCREEN_CONTRACTS" (NSConstantString) to "GUI_SCREEN_MARKET" (GSMutableString)

the market screen seems invisible, while the contracts scren is not.
I wanted to use a specific GUI screen to trigger the missionscreen, in order to avoid clashes with mission that splash the mission-screen on docking.
The trade screen seemed appropriate as you are supposed to have a hold full of trumboids, so little need to use that screen otherwise....maybe I should try using the MANIFEST screen instead. or the contracts.
updated the wiki with the current GUIscreen_querryable states.

-The /n (or //n) in missiontexts does not seem to work. (for 1.69.1)
Last edited by Arexack_Heretic on Thu Oct 25, 2007 7:08 pm, edited 1 time in total.
Riding the Rocket!
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 »

Eric's fix of just adding:-

"gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_MARKET, GUI_SCREEN_SHORT_RANGE_CHART" as a condition to displaying the screen should do that.

Worked for me to stop Assassins clashing with Thargoid Wars. If Thargoid Wars bagged the mission screen by sending the player out to squash bugs, the assassins script waits until the screen is anything other than the mission screen (ie the player has seen the Thargoid Wars briefing and either picked up his medal, refused to go or been scambled.) In the event that the player launches, then the Assassins message is displayed when he docks after the battle.
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.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Yeah, that was what I was trying for.
The problem was that GUI_SCREEN_MARKET is broken, it works fine with MANIFEST.

I made a mistake in the choice processing though...stuck in LIFECHOICE_OFFERED....gotta fix that now.

Might be because I put the set:mission_ OFFERED after the choice...

added Erik's missionscreen-conflicsavoidance missiion variable.
/cleaning out new typos.
/weeding out redundant clearMissionScreen methods etc.
/accidentally had an always valid condition through uncarefull else usage.
/Got past the OFFER and am now a PUSHER.
/more tyos introduced
/extra resets for Eriks variable.
/trumple pusher part looks good now.
/switched to pseudoFixedD100_number as d100_number is rerolled each time the script is tickled. Now I need to jump to get progression.

///bug1: UseSpecialCargo does not prevent scooping cargo, this may be related to the can-scoop-more-than-cargospace bug.
///bug2: UsedSpecialCargo dissapeared in a savegame, need to check:\
//edit: the special cargo is not saved to the savefile. makes sense given its origin. There would be no saving possible.
/fixed vanishing cargo with workaround. added descriptions.
Riding the Rocket!
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 »

Yes, I can confirm that, as mentioned elsewhere (just don't remember why) GUI_SCREEN_MARKET is one of the broken ones. So it also makes no sense in Eric's code.

Ahruman had put a list of the working gui_screen_strings somewhere in a thread, and I had added the ones working and not working for me to that. I think you should be able to find that with a quick search.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Javascript: trumblecheck_farmer.js

Post by JensAyton »

Arexack_Heretic wrote:
this.name = "JavaScript-trumblecheck";
This should start with your name or a similar tag for uniqueness. JavaScript does not qualify. ;-)

Scripts do not run (that is, there is not tickle event and as such no legacy script running) on the Market screen, because popping up a mission screen when the player is in the middle of pressing enter to buy/sell stuff would be annoying.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

/scriptname fixed.
/trumblepusher altered to compensate for use of specialcargo.[/]
/wrote small JS script to make speacial cargo not go away.
/should also remove any scooped cargo.

That feature of the market sceen might be exploited in some way?
Maybe to avoid immediate missionscreen 'pop-ups' (in JS otherwise it will be too late.)
nah. switching to the marketscreen does not matter, you'd be better of just triggering your-mission-before-thargoidwars.js missionscreen directly.
Riding the Rocket!
Post Reply