Traffic behavior that actually works w/ supplies

Post ideas & suggestions you have pertaining to the game here.
Post Reply
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1366
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Traffic behavior that actually works w/ supplies

Post by shanejfilomena » Sat Feb 13, 2016 8:36 pm

we all been there : we KNOW that the ships are supposed to dump loot at a station and because we Know this we find ourselves looking for the station to update it's inventory with something we want ...... Here is my idea of how I deal with that : it's not perfect, but it does keep the stations in loot to buy ( in high systems I usually don't have Corporate stations calling in traffic so it's less concern for Freighter wrecks with lots of loot )
---------------------------------------------------
In my personal games my ships are stocked at the gate w/ &trCargoContainer and / or &trStationSupplies ( depends on the traffic, I have one for corporate, commonwealth & blackMarket (&trIllegalItems2 ) )

Code: Select all

(block (theShip)
						(setq theShip (sysCreateShip
							&tbCommTraffic;
							(random (sysFindObject Nil "G -uncharted;"))
							&svCommonwealth;
							&evCommTrafficBehavior;
							))
						(objSetObjRefData theShip "home" homeObj)
							; Add some items to the transport
	                   (objAddRandomItems theShip &trCargoContainer; (random 1 4))
						(objFireEvent theShip "OrderBeginTraffic")
						)


Now that covers the part where the stuff comes in, but it will overload the stations if the system calls in alot of ships ..so that = ships have got to get rid of the stuff as well.

Code: Select all

ShipClass UNID="&evCommTrafficBehavior;"
			class=				"(commonwealth traffic behavior)"
			virtual=			"true"
			noFriendlyFire=		"true"
			
			attributes=			"behaviorClass"
			>
	<StaticData>
				<Trade currency="credit" max="50000" replenish="25000">
		       </Trade>
		</StaticData>
		<Events>
			<OrderBeginTraffic>
				(block (homeObj)
					; If the home station is not set, set it now
					(if (not (setq homeObj (objGetObjRefData gSource "home")))
						(block Nil
	(setq homeObj (sysFindObject gSource "TAFN +commonwealth; +primary;"))
							(if (not homeObj)
(setq homeObj (sysFindObject gSource "TAFN +populated; -korolovShipping; -occupation;"))
								)

							(objSetObjRefData gSource "home" homeObj)
							)
						)

					; Set data so we know we are traffic
					(objSetData gSource "0010300C_traffic" True)

					; Set state
					(objSetData gSource "behavior" 'enteredSystem)
					)
			</OrderBeginTraffic>
			
			<OnOrdersCompleted>
	(block (behavior newBehavior allDests dockedAt allWrecks allLoot allBits)
					(setq behavior (objGetData gSource "behavior"))
					(setq dockedAt (shpGetDockObj gSource))
					
					; If we're docked at an object, dump any loot that we found
					(if (and dockedAt
							(objHasAttribute dockedAt "populated")
							
							; Compose a list of all loot on board that the station
							; might want to buy from us.
							
				(setq allLoot (filter (objGetItems gSource "*~f U") theItem
								(objGetBuyPrice dockedAt theItem)
								))
							)
						(block Nil
			(enum allLoot theItem (objRemoveItem gSource theItem))
			(enum allLoot theItem (objAddItem dockedAt theItem))
							)
						)
					
						
					(if (and dockedAt
							(objHasAttribute dockedAt "populated;")
							
							; Compose a list of all loot on board that the station
							; might want to sell to us.
							
				(setq allBits (filter (objGetItems dockedAt "tU -Info; -Fuel;") theItem
								(objGetSellPrice dockedAt theItem)
								))
							)
						(block Nil
			(enum allBits theItem (objRemoveItem dockedAt theItem))
							(enum allBits theItem (objAddItem gSource theItem))
							)
						
						)
						
					; Figure out what to do next
					(switch

			; Check for wrecks in the area; if we find some, then loot them
						(and (leq (objGetDestiny gSource) 180)
								(not (objHasAttribute gSource "freighter"))
								(leq (random 1 100) 50)
								
								; Compose a list of all wrecks in the area
								
(setq allWrecks (filter (sysFindObject gSource "TK N:100; +shipwreck; -uncharted; -locked;") theObj
									(and 
			(not (objIsRadioactive theObj))
			(not (objGetData theObj "0010300c_marked"))
										)
									))
								)
							(block (destObj)
								(setq destObj (random allWrecks))
								(shpOrder gSource 'loot destObj)
								(objSetData destObj "0010300c_marked" True)
								(objSetData gSource "behavior" 'looting)
								)
					
						; If we have no destinations or randomly, we gate out
	(or (and (not (eq behavior 'enteredSystem)) (leq (random 1 100) 20))
								(not 
		; Compose a list of stations that we could go to.
									
	; stations that don't have too many dock ports open.

(setq allDests (filter (sysFindObject gSource "TAF +populated; -korolovShipping; -occupation;") theObj 
	(and (gr (objGetOpenDockingPortCount theObj) 2)
											(or (not dockedAt) (not (eq dockedAt theObj)))
											)
										))
									)
								)
							(block (gateObj)
								(setq gateObj (random (sysFindObject gSource "G -uncharted;")))
								(shpOrder gSource 'gate gateObj)
								(objSetData gSource "behavior" 'leavingSystem)
								)
								
						; Otherwise, we go to another station
						(block (destObj)
							(setq destObj (random allDests))
							(shpOrder gSource 'dock destObj)
							(shpOrder gSource 'wait (random 10 60))
							(objSetData gSource "behavior" 'docked)
							)
						)
						
					; If we were docked at an object that we just looted, then destroy the object
					(if (objGetData dockedAt "0010300c_marked")
						(objDestroy dockedAt gSource)
						)
					)
			</OnOrdersCompleted>
	
			  
		</Events>
	</ShipClass>
Now I do have freighters for Corporate to restock the Fuel supplies : these ships dump everything they have, including their own fuel, but they are set to create their own fuel if they need it :

Code: Select all

; If we are out of fuel, then we stop
						(if (and (not dockedAt
							(not (objGetItems gSource "f"))
							
				(objAddItem gSource (itmCreate &itHelium3FuelRod;(random 2 6)))
							))
							
					; Figure out what to do next


but that's just me : the wrecks have to be set so the player can't overload with loot and in one of my .xml I had them set to give up nothing if the player killed them :) ( they became hostile wrecks too :) )

but I doubt there is a totally perfect answer to the problem ..we have tried the Galactic Trader
we added refreshing dynamic inventories ...but it's always seems to just be there to bite us in the dark ...
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 799
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Re: Traffic behavior that actually works w/ supplies

Post by TheLoneWolf » Fri Feb 26, 2016 5:34 am

A good idea! But I'm still wondering where the Kronosaur stashes its loot :/

Then we can have a Korolev mission like 'Restore the loot'.

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1366
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Re: Traffic behavior that actually works w/ supplies

Post by shanejfilomena » Sat Feb 27, 2016 6:39 am

EDIT : I had been testing a piece that doesn't seem to work in my Globals, but it works on the Ship just fine ( so far ) : so i updated the Freighters to carry it like they do in my .xml
the change is made in the <OnDestroy>
TheLoneWolf wrote:A good idea! But I'm still wondering where the Kronosaur stashes its loot :/

Then we can have a Korolov mission like 'Restore the loot'.
I believe the Frigates are set to dump loot at the nearest Pirate base. I do not think the Kronosaurus is set for that because it's primary function is to 'huntPlayer , so basically they are an assassin, not really a Pirate.

However, the Korolov Shipping Containers are about 25 tons of sealed scrap value .
even if you looted a wrecked freighter you wouldn't make much off them in the end for the trouble of hauling them.

Once I had set the Korolov Containers to be "usable" : meaning you could open them up for about 25 tons of goodies ...IF you came across them in the game ... but I can tell you it got old real fast because it overloads a player who doesn't play with stronger weapons on the freighters like I do. ( I simply upgraded them to the next level : such as instead of a Laser Cannon I gave one a Blaster : I took the Antares V and gave it Ballista Cannons ( makes it a ship you don't want to upset, but it still can't take a group attack from pirates )

gave the Scarab 3 Slam Cannons & a "&vtDamageControlParty;" ( the Scarab is still vulnerable to Pirates attacking in groups like on the CSC delivery Missions but up against a Single Hostile it can Hold it's own pretty nice.)

Here are my Freighters & the shipping container I was testing in Interior : the Interior Extension was side lined by the changes in the game : there are not as many Hostiles per system as I think there used to be in most of the games I have played, , once powerful weapons are now not so hot ...the IM90 is my favorite, but lately it's nothing I want to run into a crowd with

Code: Select all

<!-- Shipping Container -->

	<ItemType UNID="&itKorolovShippingContainer;"
			name=				"Korolov shipping container"
			level=				"1"
			value=				"125000"
			mass=				"25000"
			frequency=			"notrandom"
			attributes=			"CorporateProperty; NotForSale"

			description=		"These standardized shipping containers hold everything from ore to consumers goods."

			sortName=			"shipping container, Korolov"

			charges=			"5000"
			valueCharges=		"true"
			>

		<Image imageID="&rsItems1;" imageX="288" imageY="0" imageWidth="96" imageHeight="96"/>

		<Invoke>
			(block (cost count boxItems)
				(setq boxItems (itmCreateRandom "fmut +Consumable; -Illegal; -Military" "ruccc ccur-"))

				(setq cost (itmGetPrice boxItems 'credit))
				(setq cost (if (eq cost 0) 100 cost))
				(setq count (divide (random 2000 4000) cost))
				(setq count (if (ls count 1) 1 count))
				(setq boxItems (itmCreate (itmGetType boxItems) count))

				(intAmmoBoxOpen boxItems)
				)
		</Invoke>
		</ItemType>

Code: Select all

<!-- Scarab Freighter -->

	<ShipClass UNID="&scScarabFreighter;"
			manufacturer=		"NAMI"
			class=				"Scarab"
			type=				"superfreighter"
			level=				"6"
			   
			attributes=			"commonwealth,freighter,genericClass"

			size=				"175"
			mass=				"15000"
			thrustRatio=		"0.2"
			maxSpeed=			"6"
			cargoSpace=			"120000"

			explosionType=		"&vtBlastExplosion4;"
			leavesWreck=		"100"
			>

		<Names definiteArticle="true">
			superfreighter St. Aoki; superfreighter St. Beatrice; superfreighter St. Celendin;
			superfreighter St. Dominarus; superfreighter St. Elaine; superfreighter St. Florentine;
			superfreighter St. Goramesh; superfreighter St. Haldane; superfreighter St. Inez;
			superfreighter St. Jotur; superfreighter St. Kim; superfreighter St. Lin Chemei;
			superfreighter St. Miranda; superfreighter St. Navreen; superfreighter St. Orinaga;
			superfreighter St. Pelerine; superfreighter St. Queleborn; superfreighter St. Rebecca;
			superfreighter St. Salvador; superfreighter St. Tomashi; superfreighter St. Unami;
			superfreighter St. Voxanna; superfreighter St. Ha-neul; superfreighter St. Joo-eun;
			superfreighter St. Emiko; superfreighter St. Aiko; superfreighter St. Rumiko;
			superfreighter St. Bharati; superfreighter St. Madhavi; superfreighter St. Astrel
		</Names>

		<!-- Configuration -->
		
		<Armor
			armorID=			"&itAdvancedReactiveArmor;"
			count=				"20"
			/>
		
		<Devices>
			<Device deviceID="&itSlamCannon;" secondaryWeapon="true" posAngle="0" posRadius="50" omnidirectional="true"/>
			<Device deviceID="&itSlamCannon;" secondaryWeapon="true" posAngle="0" posRadius="0" omnidirectional="true"/>
			<Device deviceID="&itSlamCannon;" secondaryWeapon="true" posAngle="180" posRadius="50" omnidirectional="true"/>
			<Device deviceID="&itMissileDefense;" omnidirectional="true" />
			<Device deviceID="&vtDamageControlParty;" />
		</Devices>

		<Maneuver
			maxRotationRate=	"2.0"
			rotationAccel=		"0.2"
			/>

		<Interior>
			<Compartment name="interior"
					hitPoints=	"20"
					/>
			
			<Compartment name="main drive"
					type=		"mainDrive"
					hitPoints=	"50"

					posX=		"-68"
					posY=		"0"
					sizeX=		"26"
					sizeY=		"50"
					/>
			
			<Compartment name="cargo contatiners"
					type=		"cargo"
					hitPoints=	"100"

					posX=		"19"
					posY=		"0"
					sizeX=		"140"
					sizeY=		"50"
					/>
		</Interior>

		<Items>
		</Items>

		<!-- Image and Effects -->

		<Image imageID="&rsLargeShips1;" imageX="1344" imageY="0" imageWidth="192" imageHeight="192"/>

		<Effects>
			<Effect type="thrustMain"		posAngle="177"	posRadius="78"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-177"	posRadius="78"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="175"	posRadius="78"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-175"	posRadius="78"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="180"	posRadius="78"	posZ="10"	rotation="180"	effect="&efMainThrusterLarge;"/>
		</Effects>

		<AISettings
			fireRateAdj=		"20"
			fireAccuracy=		"90"
			perception=			"4"
			
			combatStyle=		"standOff"
			/>

		<!-- AI and Behavior -->

		<Events>
			<OnDestroy>
					(block Nil
			;; remove everything from the station
						(objEnumItems gSource "* U" theItem
							(objRemoveItem gSource theItem)
							)
							
				(korOnShipDestroyed)
				)
			</OnDestroy>
		</Events>
	</ShipClass>

<!-- Antares I Freighter -->

	<ShipClass UNID="&scAntaresI;"
			manufacturer=		"Makayev-Energia"
			class=				"Antares I"
			type=				"freighter"
			defaultSovereign=	"&svCorporate;"

			attributes=			"commonwealth,freighter,genericClass"
			   
			size=				"135"
			mass=				"5000"
			thrustRatio=		"1"
			maxSpeed=			"8"
			cargoSpace=			"30000"
			>

		<Names noArticle="true">Antares Heavy 1%0%0</Names>

		<!-- Configuration -->
		
		<Armor
			armorID=			"&itHeavyTitaniumPlate;"
			count=				"12"
			/>
		
		<Devices>
			<Device deviceID="&itCentauriHeavyCLAW;" omnidirectional="true"/>
		</Devices>

		<Maneuver
			maxRotationRate=	"2.0"
			rotationAccel=		"0.2"
			/>

		<Interior>
			<Compartment name="interior"
					hitPoints=	"20"
					/>
			
			<Compartment name="main drive"
					type=		"mainDrive"
					hitPoints=	"30"

					posX=		"-50"
					posY=		"0"
					sizeX=		"28"
					sizeY=		"28"
					/>
			
			<Compartment name="cargo contatiners"
					type=		"cargo"
					hitPoints=	"20"

					posX=		"2"
					posY=		"0"
					sizeX=		"72"
					sizeY=		"60"
					/>
		</Interior>

		<Items>
		</Items>

		<!-- Image and Effects -->
		
		<Image imageID="&rsAntaresIImage;" imageWidth="128" imageHeight="128"/>

		<Effects>
			<Effect type="thrustMain"		posAngle="176"	posRadius="61"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-176"	posRadius="61"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="173"	posRadius="61"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-173"	posRadius="61"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="180"	posRadius="61"	posZ="10"	rotation="180"	effect="&efMainThrusterLarge;"/>
		</Effects>
		
		<!-- AI and Behavior -->

		<AISettings
			fireRateAdj=		"120"
			fireAccuracy=		"90"
			perception=			"4"
			combatStyle=		"standOff"
		/>

		<StaticData>
			<korolovContainerPrice>
				(item
					(list
						0 ; no level 0
						0 ; apprentices cannot escort
						0 ; journeymen cannot escort

						; Masters: 30 - 150 credits per container
						; 36,000 - 180,000 cargo value
						(multiply 5 (add (random 2 10) (random 2 10) (random 2 10)))

						150 ; legends don't escort, but add anyway
						)
					(typGetGlobalData &stKorolovShipping; "level")
					)
			</korolovContainerPrice>

			<korolovEscortRate>350</korolovEscortRate>

			<korolovMinLevel>3</korolovMinLevel>
		</StaticData>
		
		<Events>
			<OnDestroy>
					(block Nil
			;; remove everything from the station
						(objEnumItems gSource "* U" theItem
							(objRemoveItem gSource theItem)
							)
							
				(korOnShipDestroyed)
				)
			</OnDestroy>
		</Events>
	</ShipClass>

	<!-- Antares II Freighter -->

	<ShipClass UNID="&scAntaresII;"
			manufacturer=		"Makayev-Energia"
			class=				"Antares II"
			type=				"freighter"
			defaultSovereign=	"&svCorporate;"

			attributes=			"commonwealth,freighter,genericClass"
			   
			size=				"135"
			mass=				"6000"
			thrustRatio=		"1.5"
			maxSpeed=			"12"
			cargoSpace=			"30000"
			>

		<Names noArticle="true">Antares Heavy 2%0%0</Names>

		<!-- Configuration -->
		
		<Armor
			armorID=			"&itLightPlasteelPlate;"
			count=				"12"
			/>
		
		<Devices>
			<Device deviceID="&itFlenserCannon;" secondaryWeapon="true" posAngle="0" posRadius="25" omnidirectional="true"/>
			<Device deviceID="&itFlenserCannon;" secondaryWeapon="true" posAngle="180" posRadius="25" omnidirectional="true"/>
		</Devices>

		<Maneuver
			maxRotationRate=	"2.0"
			rotationAccel=		"0.2"
			/>

		<Interior>
			<Compartment name="interior"
					hitPoints=	"15"
					/>
			
			<Compartment name="main drive"
					type=		"mainDrive"
					hitPoints=	"30"

					posX=		"-50"
					posY=		"0"
					sizeX=		"28"
					sizeY=		"28"
					/>
			
			<Compartment name="cargo contatiners"
					type=		"cargo"
					hitPoints=	"30"

					posX=		"2"
					posY=		"0"
					sizeX=		"72"
					sizeY=		"60"
					/>
		</Interior>

		<Items>
		</Items>

		<!-- Image and Effects -->

		<Image imageID="&rsAntaresIIImage;" imageWidth="128" imageHeight="128"/>

		<Effects>
			<Effect type="thrustMain"		posAngle="176"	posRadius="61"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-176"	posRadius="61"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="173"	posRadius="61"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-173"	posRadius="61"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="180"	posRadius="61"	posZ="10"	rotation="180"	effect="&efMainThrusterLarge;"/>
		</Effects>
		
		<!-- AI and Behavior -->

		<AISettings
			fireRateAdj=		"120"
			fireAccuracy=		"90"
			perception=			"4"
			combatStyle=		"standOff"
		/>

		<StaticData>
			<korolovContainerPrice>
				(item
					(list
						0 ; no level 0
						0 ; apprentices cannot escort

						; Journeymen: 60 - 240 credits per container
						; 72,000 - 288,000
						(multiply 2 (add (random 10 40) (random 10 40) (random 10 40)))

						; Masters: 200 - 400 credits per container
						; 240,000 - 480,000
						(multiply 2 (add (random 30 60) (random 30 60) (random 40 80)))

						400 ; legends don't escort, but add anyway
						)
					(typGetGlobalData &stKorolovShipping; "level")
					)
			</korolovContainerPrice>

			<korolovEscortRate>100</korolovEscortRate>

			<korolovMinLevel>2</korolovMinLevel>
		</StaticData>

		<Events>
			<OnDestroy>
					(block Nil
			;; remove everything from the station
						(objEnumItems gSource "* U" theItem
							(objRemoveItem gSource theItem)
							)
							
				(korOnShipDestroyed)
				)
			</OnDestroy>
		</Events>
	</ShipClass>

	<!-- Antares V Freighter -->

	<ShipClass UNID="&scAntaresV;"
			manufacturer=		"Makayev-Energia"
			class=				"Antares V"
			type=				"freighter"
			level=				"4"
			defaultSovereign=	"&svCorporate;"

			attributes=			"commonwealth,freighter,genericClass"

			size=				"180"
			mass=				"10000"
			thrustRatio=		"1"
			maxSpeed=			"8"
			cargoSpace=			"50000"
			>

		<Names noArticle="true">Antares Heavy 5%0%0</Names>

		<!-- Configuration -->
		
		<Armor
			armorID=			"&itLightPlasteelPlate;"
			count=				"12"
			/>
		
		<Devices>
			<Device deviceID="&itBallistaCannon;" secondaryWeapon="true" posAngle="0" posRadius="50" omnidirectional="true"/>
			<Device deviceID="&itBallistaCannon;" secondaryWeapon="true" posAngle="0" posRadius="0" omnidirectional="true"/>
			<Device deviceID="&itBallistaCannon;" secondaryWeapon="true" posAngle="180" posRadius="50" omnidirectional="true"/>
		</Devices>

		<Maneuver
			maxRotationRate=	"2.0"
			rotationAccel=		"0.2"
			/>

		<Interior>
			<Compartment name="interior"
					hitPoints=	"20"
					/>
			
			<Compartment name="main drive"
					type=		"mainDrive"
					hitPoints=	"40"

					posX=		"-74"
					posY=		"0"
					sizeX=		"28"
					sizeY=		"28"
					/>
			
			<Compartment name="cargo contatiners"
					type=		"cargo"
					hitPoints=	"30"

					posX=		"2"
					posY=		"0"
					sizeX=		"120"
					sizeY=		"60"
					/>
		</Interior>

		<Items>
		</Items>

		<!-- Image and Effects -->

		<Image imageID="&rsAntaresVImage;" imageWidth="180" imageHeight="180"/>

		<Effects>
			<Effect type="thrustMain"		posAngle="177"	posRadius="84"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-177"	posRadius="84"	posZ="-3"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="175"	posRadius="84"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="-175"	posRadius="84"	posZ="5"	rotation="180"	effect="&efMainThrusterLarge;"/>
			<Effect type="thrustMain"		posAngle="180"	posRadius="84"	posZ="10"	rotation="180"	effect="&efMainThrusterLarge;"/>
		</Effects>
		
		<!-- AI and Behavior -->

		<AISettings
			fireRateAdj=		"120"
			fireAccuracy=		"90"
			perception=			"4"
			combatStyle=		"standOff"
		/>

		<StaticData>
			<korolovContainerPrice>
				(item
					(list
						0 ; no level 0
						0 ; apprentices cannot escort

						; Journeymen: 40 - 160 credits
						; 80,000 - 320,000 cargo value
						(multiply 10 (add (random 1 4) (random 1 4) (random 1 4) (random 1 4)))

						; Masters: 160 - 400 credits
						; 320,000 - 800,000 cargo value
						(add (multiply 10 (add (random 4 10) (random 4 10))) (multiply 10 (add (random 4 10) (random 4 10))))

						400 ; legends don't escort, but add anyway
						)
					(typGetGlobalData &stKorolovShipping; "level")
					)
			</korolovContainerPrice>

			<korolovEscortRate>50</korolovEscortRate>

			<korolovMinLevel>2</korolovMinLevel>
		</StaticData>

		<Events>
			<OnDestroy>
					(block Nil
			;; remove everything from the station
						(objEnumItems gSource "* U" theItem
							(objRemoveItem gSource theItem)
							)
							
				(korOnShipDestroyed)
				)
			</OnDestroy>
		</Events>
	</ShipClass>

	<!-- EI100 Freighter -->

	<ShipClass UNID="&scEI100;"
			manufacturer=		"Earth Industries"
			class=				"EI100"
			type=				"freighter"
			level=				"2"
			defaultSovereign=	"&svCorporate;"

			attributes=			"commonwealth,freighter,genericClass"
			   
			size=				"40"
			mass=				"100"
			thrustRatio=		"2.2"
			maxSpeed=			"12"
			cargoSpace=			"250"
			>

		<Names definiteArticle="true">
			freighter Anon7; freighter Beta Antares; freighter Claire Rennard;
			freighter Don Antonio; freighter Enfield; freighter Farsol;
			freighter Gravity's Pull; freighter Heseltine; freighter Ibanez;
			freighter Jovian Cargo; freighter Korean Star; freighter Liquid Metal;
			freighter Matori Maru; freighter North Sea; freighter Ologous;
			freighter Paolo Sante; freighter Qinlong; freighter Remora;
			freighter San Cristobal; freighter Titus Gaelianus; freighter Umgala Kori;
			freighter Velo; freighter Wantanabe Maru; freighter Xan; freighter Yasu Maru;
			freighter Zodiac Bound
		</Names>

		<!-- Configuration -->

		<Armor
			armorID=			"&itLightReactiveArmor;"
			count=				"4"
			/>

		<Devices>
			<Device deviceID="&itBlaster;" omnidirectional="true"/>
			<Device deviceID="&itClass1Deflector;"/>
		</Devices>

		<Maneuver
			maxRotationRate=	"4.5"
			rotationAccel=		"0.5"
			/>

		<!-- Image and Effects -->

		<Image imageID="&rsEI100Image;" imageX="0" imageY="0" imageWidth="70" imageHeight="70"/>

		<Effects>
			<Effect type="thrustMain"		posAngle="180"	posRadius="29"	posZ="8"	rotation="180"/>
		</Effects>
		
		<!-- AI and Behavior -->

		<AISettings
			fireRateAdj=		"80"
			fireAccuracy=		"85"
			perception=			"4"
		/>

		<StaticData>
			<korolovContainerPrice>
				(item
					(list
						0 ; no level 0

						; Apprentices: 1500 - 4000 credits
						; 15,000 - 40,000 cargo value
						(multiply 100 (random 15 40))

						; Journeymen: 2500 - 5000 credits
						; 25,000 - 50,000 cargo value
						(multiply 100 (random 25 50))

						; Masters: 3000 - 5000 credits
						; 30,000 - 50,000 cargo value
						(multiply 100 (random 30 50))

						5000 ; legends don't escort, but add anyway
						)
					(typGetGlobalData &stKorolovShipping; "level")
					)
			</korolovContainerPrice>

			<korolovEscortRate>200</korolovEscortRate>

			<korolovMinLevel>1</korolovMinLevel>
		</StaticData>

		<Events>
			<OnDestroy>
					(block Nil
			;; remove everything from the station
						(objEnumItems gSource "* U" theItem
							(objRemoveItem gSource theItem)
							)
							
				(korOnShipDestroyed)
				)
			</OnDestroy>
		</Events>
	</ShipClass>
Last edited by shanejfilomena on Sun Mar 06, 2016 8:05 am, edited 2 times in total.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Re: Traffic behavior that actually works w/ supplies

Post by pixelfck » Sun Feb 28, 2016 1:44 pm

Nice idea and implementation.

I always thought it would be nice if the spaceships that jumped a gate just before you would actually exist on the other side of the gate if you jumped right after them.

If you would combine this trade behaviour with the above, you could (with smoke and mirrors) create the suggestion of inter-system trade :)

Cheers,
Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de

User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 799
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Re: Traffic behavior that actually works w/ supplies

Post by TheLoneWolf » Sun Feb 28, 2016 3:15 pm

Pure genius! But it would be unfair. Players can farm by clearing all goodie missions, but let the freighter die when its transporting weapons or vice versa. Maybe only Tinkers can extract from those containers. 50t of containers is equal to 10t of loot, or something accordingly. Moreover, the last mission (destroy fortress) would result in player getting filthy rich, and break in game mechanics.

User avatar
Watch TV, Do Nothing
Militia Captain
Militia Captain
Posts: 706
Joined: Sun Feb 05, 2012 12:22 am

Re: Traffic behavior that actually works w/ supplies

Post by Watch TV, Do Nothing » Sun Feb 28, 2016 6:09 pm

pixelfck wrote:Nice idea and implementation.

I always thought it would be nice if the spaceships that jumped a gate just before you would actually exist on the other side of the gate if you jumped right after them.

If you would combine this trade behaviour with the above, you could (with smoke and mirrors) create the suggestion of inter-system trade :)

Cheers,
Pixelfck
This behavior also bothered me in Escape Velocity- ships could jump out of a system to escape the player you but then they wouldn't be in adjacent systems if you tried to follow them.

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1366
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Re: Traffic behavior that actually works w/ supplies

Post by shanejfilomena » Sat Mar 05, 2016 5:53 pm

pixelfck wrote:Nice idea and implementation.

I always thought it would be nice if the spaceships that jumped a gate just before you would actually exist on the other side of the gate if you jumped right after them.

If you would combine this trade behaviour with the above, you could (with smoke and mirrors) create the suggestion of inter-system trade :)

Cheers,
Pixelfck
I do believe LIVE Inter-System Trade was attempted by Great Icons of The UNID Holders, if it had any chance of working without eating the computer, I am sure they would have made it work. However : not-so-live Inter System activities is not that hard to do :

NPC Ships CAN 'FollowPlayer , not just the Autons, when you gate out : However, the NPC Ships that gate out on their own are basically 'Destroyed.

As we see with Kate moving forward in the game with us ( provided she is alive - but apparently that is not always important and even if she dies on a Corporate Command Mission against the Chimera HQ where she goes off chasing fleeing Chimeras while you are helping Anton complete the mission and gets her tail handed to her : somehow You are the one to blame for it .....)

The best option is to set data for a new ( next ) encounter with a ship or character : once you leave a system it is suspended : the next system you gate into sets itself " in motion " based on the Automated script of what is in that system : this is why you will find recently destroyed stations even if it looks like nobody was near it in days.....and the most obvious suspect would have been on the opposite side of the system at the time it occurs .

Let us say you encounter a Xenophobe World Ship : it gates out because you were crowding it's space : that ship can carry Data for it's next manifestation if it happens to see you on it's radar and say "Hello, %Player%, Domina might not save you this time if you get too close"

or if you killed one " Hello, %Player%, I know what you did last summer"

But for the actual ship to run from one system into an another directly would be hard on the game because the ship calls for the Next system might NOT include that Class of ship, or if it does it might include a dozen of them: creating a dozen of ships with the same data that is supposed to carry "X" cargo ( creates too much loot ) or feelings toward to the player ( which can turn every usually friendly Class of ship into a Hostile because you stray shot one of their Class in a system 6 hours ago .....)

so using Not Random or very rare ships for the purpose of carrying Data is the best option.

Now some MIGHT think the T33 or Anubis Class is not very popular : actually they are :
with Corporate Command I have seen more of them then ever ( probably because there are so many systems where they are applicable ) and I know that in some regular game systems you get a good 6 sets of these Independent Trading minions ( they don't actually trade anything, which always caused me to not be happy with them, if you kill them you basically know exactly what they are holding simply because they only drive the 'traderoute, they don't actually do much else )
I often use them, if I see them after entering a system, to help me find my way around : they are the "ORIGINAL Explorer Autons" for me :) because they can lead you to everything directly ( no scenic routes) but remembering nobody is going to shoot them is something easy to forget on a long ride : so you have to hold back and keep your eyes on the LRS because that sneaky Phobos is not going to shoot your Guide, it's going to shoot you.

However, putting Data on a ship like that isn't too bad for the game engine, mostly because that ship is decoration and only the Anarchists ( dumb as box of rocks wannabe aliens ) would dare to upset : which is totally moronic of them because if the Trader DID trade then they would be cutting their own throats by messing with the only traders that will bring them fuel & food since they are too weak to actually be a Pirate.
Last edited by shanejfilomena on Sat Apr 09, 2016 5:59 pm, edited 2 times in total.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1366
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Re: Traffic behavior that actually works w/ supplies

Post by shanejfilomena » Sat Mar 05, 2016 6:30 pm

TheLoneWolf wrote:Pure genius! But it would be unfair. Players can farm by clearing all goodie missions, but let the freighter die when its transporting weapons or vice versa. Maybe only Tinkers can extract from those containers. 50t of containers is equal to 10t of loot, or something accordingly. Moreover, the last mission (destroy fortress) would result in player getting filthy rich, and break in game mechanics.
'Destroy Fortress would not : simply because the Frigates rarely , I only seen it once in all my games , loots a Kill : I have never seen a Frigate drop loot at a Pirate Base and I have had test ships that can get within a range of 10 to anything because I once created Pirates and wanted to watch them function. Why they don't dump the loot, I don't know : I have tried the code on Salvagers too to try to get them to dump at a Tinker but they refuse to obey.

** I have had Salvagers stop and trade with a "Player friendly" station if they had stuff in the cargo hold to sell, then carry on with their normal activities, but the Pirate "Dump Loot" Code has never worked for me

However: the Pirate bases have their own loot and some come up with a good deal of it : like the Charon Fortress - that one I sometimes have to make several trips to unload and there is nothing in the system to account for the loot it holds.

Freighters with lots of loot : in MY games it has been rare to get a ton of ships destroyed, However, it does happen.
I have a response to Freighters being destroyed :
A Manticore gates in to Avenge the dead crew.

With Upgraded weapons on the Freighters they aren't that easy to kill in lower levels by a random Hostile, Which is where you would get the Korolov Missions ( and the containers ) unless you removed Charon from the game as a Set System and make it a Legend reward system like I once did : then Korolov comes up in many places until that mission system is completed.

The Object of the Missions is to NOT let the freighter get destroyed, so leaving your mission ship to face the Hostiles alone is enough to get the player fired so whatever loot you had gained better last forever because the containers are only loaded when the mission starts

but a Frigate deploying raiders, Ventari or Ranx can usually make a mess :
The only real answer is to get rid of the wreck or alter the WreckType to something like I once did :

Code: Select all

wreckType=			"&stCorporateMissionWreck;"
Here you can control the amount or type of loot found in wrecks ( the wreck will be destroyed after you exit the dock screen : it's a silent kill, usually.)

Code: Select all


	<!-- Mission Station -->

	<!-- CorporateMissionWreck -->

	<StationType UNID="&stCorporateMissionWreck;"
			name=				"Wreck of the (objGetName gSource 0) "
			sovereign=			"&svIndependent;"
			dockScreen=			"Main"
			scale=				"ship"
			mobile=				"true"
			noMapLabel=			"true"
			immutable=			"true"

			ejectaType=			"&vtWreckEjecta;"
			>

		<Events>
			<GetExplosionType>
				(intContainerGetExplosionType gSource)
			</GetExplosionType>

			<OnDamage>
				(intContainerOnDamage gSource aDamageHP)
			</OnDamage>
		</Events>
		<Items>
		  (block (theItem level)
				;; remove everything from the station
						(objEnumItems gSource "*~mf U" theItem
							(objRemoveItem gSource theItem)
							)
							
                    ;; we'll add some code here to dynamically add items to
                    ;; the ship's inventory.
                    (setq level (sysGetLevel))
                    (itmEnumTypes "*" theItem
                        (block Nil
					
                            (switch
                                ;; we don't want any common or uncommon
                                (geq (itmGetFrequency theItem) 10)
                                    Nil
                                    
                                ;; we don't want notRandom
                                (leq (itmGetFrequency theItem) 0)
                                    Nil
                                    
                                ;; no items of lvl less than 2 below system level 
                                (leq (itmGetLevel theItem) (subtract level 3))
                                    Nil
                                    
                                ;; no items of lvl 2 higher than the system
                                (geq (itmGetLevel theItem) (add level 3))
                                    Nil
                                    
                                ;; if we have a weapon, shield or device add 1 or 2
                                (itmHasAttribute theItem "MajorItem")
                                    (objAddItem gSource theItem (random 0 2))
                                    
                                ;; if we have less critical items, add a few
                                (itmHasAttribute theItem "MinorItem")
                                    (objAddItem gSource theItem (random 0 4))
                                    
                                ;; trade goods are plentiful
                                (itmHasAttribute theItem "Consumable")
                                    (objAddItem gSource theItem (random 0 2))
                                    
                                ;; anything we haven't matched yet we add 1     
                                (objAddItem gSource theItem 1)
                                )
                            )
                        )
                     )
		</Items>

		<DockScreens>
			<Main
					name=			"=(objGetName gSource)"
					>
					
                 <Panes>
				 
				<Default>
				<OnPaneInit>
					(block (desc extensionVersion)
						; Get the abandoned screen description from the object.
						(setq desc (objTranslate gSource 'AbandonedScreenDesc))
						
	; If the object doesn't have a description then come up with a good
						; default
						(if (not desc)
							(setq desc (switch
			; If not populated, then just a destroyed installation
								(not (objHasAttribute gSource "populated"))
	(cat "You are docked at a destroyed ship. "
	"Leaking fluids and venting gases obscure the ruined machinery inside.")
										
	; Standard default
	(cat "You are docked at the lifeless ruins of a wrecked ship. "
	"Wrecked machinery and smoldering bodies litter the silent ship.")
								))
							)
							
						; Set it
						(scrSetDesc gScreen desc);
						)
				</OnPaneInit>

				<Actions>
					<Action name="Loot" key="L" default="1" >
						(block Nil
						(shpCancelOrders gPlayerShip)
						(scrShowScreen gScreen &dsRPGLoot;)
						)
					</Action>

					<Action name="Jettison" key="J">
						(scrShowScreen gScreen &dsRPGJettison;)
					</Action>	

					<Action name="Undock" cancel="1" key="U">
					(block Nil
							(objDestroy gSource)
							(scrExitDock gScreen)
								)
					</Action>

				</Actions>

			</Default>
		</Panes>
			
			</Main>
		</DockScreens>

		<DockingPorts>
			<Port x="0"		y="24" />
			<Port x="0"		y="-24" />
			<Port x="24"	y="0" />
			<Port x="-24"	y="0" />
		</DockingPorts>
	</StationType>
I did have a system where I had over a dozen wrecks : but between the ships making it to the stations Vs. the ships that didn't : the loot you can pick up isn't as sell-able as you would think :

the stations will not buy something if they have alot of it : and since most ships going to a station are Basically carrying the same stuff : you really are left holding the bag if you thought you could break a Million Credits in a few sweet wrecks..

You can make a little profit, yes, just not get overly rich : in a system where I had over a dozen wrecks I was lucky to have Cargo/ Ore hauling Packers http://xelerus.de/index.php?s=mod&id=732 to carry some of the stuff I knew I could use later - like Ammunition and fuel : the most I ever get out a system is about 50K with fighting, buying/selling and looting but I was never one to care about how many Credits I have so long as I have Fuel, weapons & shields : I like to Mine - even have the Mining Auton http://xelerus.de/index.php?s=mod&id=215 to help me clear a system, but again : things are not as sell-able with the traffic actually doing it's job.

To offset the " lag" in station buying / selling from Traffic I have many station Use some material like Res; Damaged; Ore; ( in one or two stations ) Food; & Lux;
( like the Corporate Enclave) or ( what I was going to do with Armor Stations is grab everything under the system level in Armor )

and use it to manufactiure stuff the player & NPC ships can use

I did once have NPC ship upgrade their stuff , but they usually don't stay in the system long enough to matter for that sort of thing : However, like the Luminous, I did want something to upgrade if they died.....but the options and decisions on shields when you know they play differently for the player then for a NPC is hard.

It is too easy to over-power a Wolfen if the Ship Class gates in wearing an R1 or 5 : then you BETTER NOT get a station angry at you :)
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests