
I dunno how 2 make Dockscreens and weapon/armor dealers...
Can somebody help me as a newcomer make weapon dealers? pleeeeeease? 

Let's get this show on the road.
By the way, my username on Xelerus is Alfael X. heheheh...
Stats:
-A pilot of a Stalwart-class gunship
-Fleet Lieutenant of the Commonwealth Fleet
-A new Xelerus user
By the way, my username on Xelerus is Alfael X. heheheh...

Stats:
-A pilot of a Stalwart-class gunship
-Fleet Lieutenant of the Commonwealth Fleet
-A new Xelerus user
-
- Fleet Officer
- Posts: 1533
- Joined: Tue Mar 22, 2011 8:43 pm
- Location: Alaska
- Contact:
What exactly did you need?
mostly we tend to simply copy out a Arms Dealer or other station from the source .xml and edit them as we needed : if we added weapons to the game by our extensions we simply + ( whatever the name is ) : such as I had used "Morgan" as an item identifier once so in the item lists it would include "+Morgan".
you can obtain the sources @ : http://xelerus.de/index.php?s=mods&c=Sources
you will require notepad++ for best results in reading, building and editing an .xml : http://notepad-plus-plus.org/
--------------
I do not know of the newer versions since 1.08, I am still trying to beat my high score : but dockscreens are pretty simple.
Here is a DockScreen copy of an old station I did for LeRogue : ** OnPaneInit / Initialize are alternating terms George has used in many versions : be watchful of the term he uses in the version you choose to work with: you will hate flying far to reach your station only to find the screen would not come up.
Also change with some versions : so be watchful on that.
In the sell and buy screen areas " "Main" ; return screen " ARE another alternating PIA.
Some versions use it and others do not : think he does it to keep us on our toes
Also : if you have alot of code ( etc etc etc ) try to keep as much of it together as you can, spacing can trip the AI and the code will not work : I am sure RPC can tell us Horror stories of code spacing : I had a few myself.
---------------
ALSO : FOR WEAPON DEALERS IN PARTICULAR: see bottom
--------------
I like it when they buy what they might sell.
mostly we tend to simply copy out a Arms Dealer or other station from the source .xml and edit them as we needed : if we added weapons to the game by our extensions we simply + ( whatever the name is ) : such as I had used "Morgan" as an item identifier once so in the item lists it would include "+Morgan".
you can obtain the sources @ : http://xelerus.de/index.php?s=mods&c=Sources
you will require notepad++ for best results in reading, building and editing an .xml : http://notepad-plus-plus.org/
--------------
I do not know of the newer versions since 1.08, I am still trying to beat my high score : but dockscreens are pretty simple.
Here is a DockScreen copy of an old station I did for LeRogue : ** OnPaneInit / Initialize are alternating terms George has used in many versions : be watchful of the term he uses in the version you choose to work with: you will hate flying far to reach your station only to find the screen would not come up.
Code: Select all
<OnInit>
(intCorporateOnInit "Main")
</OnInit>
In the sell and buy screen areas " "Main" ; return screen " ARE another alternating PIA.
Some versions use it and others do not : think he does it to keep us on our toes

Also : if you have alot of code ( etc etc etc ) try to keep as much of it together as you can, spacing can trip the AI and the code will not work : I am sure RPC can tell us Horror stories of code spacing : I had a few myself.
---------------
ALSO : FOR WEAPON DEALERS IN PARTICULAR: see bottom
--------------
Code: Select all
<DockScreens>
<Main
name= "=(objGetName gSource)"
>
<Panes>
<Default
desc= "You are docked at a Rogue Command Trading Post.">
<Actions>
<Action name="Buy items" default="1" key="B">
(comShowBuyScreen
"*" ; items sold to player
"Main" ; return screen
)
</Action>
<Action name="Sell items" key="S">
(comShowSellScreen
"*" ; items bought from player
"Main" ; return screen
)
</Action>
<Action name="Order items" key="O">
(switch
(eq (objGetData gSource "MissionStatus") "intransit")
(scrShowScreen gScreen "OrderInTransit")
(eq (objGetData gSource "MissionStatus") "arrived")
(scrShowScreen gScreen "OrderReady")
(eq (objGetData gSource "MissionStatus") "failed")
(scrShowScreen gScreen "OrderFailed")
; If the player has exceeded quota, then she cannot order
(geq (objGetData gSource "OrderCount") 1)
(scrShowScreen gScreen "QuotaExceeded")
; Show order screen
(scrShowScreen gScreen "OrderItem")
)
</Action>
<Action name="Undock" cancel="1" key="U">
<Exit/>
</Action>
</Actions>
</Default>
</Panes>
</Main>
<OrderItem
name= "=(objGetName gSource)"
>
<Panes>
<Default
desc="Please enter an item to search for in our catalog database:"
showTextInput="true">
<Actions>
<Action name="Order" default="1">
(block Nil
(setq gItem (itmCreateByName "* -Illegal; -Military; -Alien; -ID; -CannotOrder; -NotForSale; <10" (scrGetInputText gScreen) 1))
(switch
; If we couldn't understand, say so
(not gItem)
(scrShowPane gScreen "UnknownItem")
; Otherwise, ask for a count
(block Nil
(setq gCost (itmGetActualPrice gItem))
; Add 40% markup
(setq gCost (divide (multiply gCost 140) 100))
; Compute max count
(switch
(leq (itmGetFrequency gItem) 1)
(setq gMaxCount 1)
(leq (itmGetFrequency gItem) 4)
(setq gMaxCount (itmGetMaxAppearing gItem))
(leq (itmGetFrequency gItem) 10)
(setq gMaxCount (multiply 3 (itmGetMaxAppearing gItem)))
(setq gMaxCount (multiply 10 (itmGetMaxAppearing gItem)))
)
(scrShowPane gScreen "GetCount")
)
)
)
</Action>
<Action name="Cancel" cancel="1">
(scrShowScreen gScreen "Main")
</Action>
</Actions>
</Default>
<GetCount
showCounter="true">
<OnPaneInit>
(scrSetDesc gScreen
(cat "The catalog contains a listing for " (itmGetName gItem 0x102) ". "
(if (eq gMaxCount 1) "There is one left in the warehouse." (cat "There are " gMaxCount " left in the warehouse."))
"\n\nHow many do you wish to order?"
)
)
</OnPaneInit>
<Actions>
<Action name="Order" default="1" key="O">
(switch
(gr (scrGetCounter gScreen) gMaxCount)
(scrSetCounter gScreen gMaxCount)
(gr (scrGetCounter gScreen) 0)
(block Nil
(setq gItem (itmCreate (itmGetUNID gItem) (scrGetCounter gScreen)))
(scrShowPane gScreen "ConfirmOrder")
)
)
</Action>
<Action name="Cancel" cancel="1" key="C">
(scrShowPane gScreen "Default")
</Action>
</Actions>
</GetCount>
<ConfirmOrder>
<OnPaneInit>
(block (desc shippingCost eachItem)
; Shipping cost 500 credits per ton
(setq shippingCost (multiply 500 (divide (add (multiply (itmGetMass gItem) (itmGetCount gItem)) 999) 1000)))
; Compute price of each item
(setq eachItem (itmGetActualPrice gItem))
; Charge a 40% markup
(setq eachItem (divide (multiply eachItem 140) 100))
; Compute total cost
(setq gCost (add (multiply (itmGetCount gItem) eachItem) shippingCost))
(setq desc
(cat "Order: " (itmGetName gItem 0x108) "\n"
"Unit price: " eachItem
(if (gr (itmGetCount gItem) 1) (cat " (" (itmGetCount gItem) " for " (multiply eachItem (itmGetCount gItem)) ")") "")
"\n"
"Shipping & Handling: " shippingCost "\n"
"Total: " gCost "\n\n"
)
)
(if (gr gCost (plyGetCredits gPlayer))
(setq desc (cat desc "Unfortunately, you do not have enough credits to complete the order."))
(setq desc (cat desc "Do you wish to place the order?"))
)
(scrSetDesc gScreen desc)
(scrEnableAction gScreen 0 (leq gCost (plyGetCredits gPlayer)))
)
</OnPaneInit>
<Actions>
<Action name="Place Order" default="1" key="P">
(block (transport)
; Create a transport at the nearest gate and put the item on it
(setq transport (sysCreateShip &scAntaresG; (objGetNearestStargate gSource) &svCorporate;))
(objAddItem transport gItem)
; Order the transport to dock with the station and then gate out
(shpOrderDock transport gSource)
(shpOrderWait transport (random 5 12))
(shpOrderGate transport)
; Register the transport so we know if it got destroyed
(objRegisterForEvents gSource transport)
; Remember the item and the transport
(objSetData gSource "Order" gItem)
(objSetObjRefData gSource "Transport" transport)
; Set the mission status
(objSetData gSource "MissionStatus" "intransit")
; Charge the player
(plyCharge gPlayer gCost)
(objIncData gSource "OrderCount" 1)
(scrShowPane gScreen "ThankYou")
)
</Action>
<Action name="Cancel" cancel="1" key="C">
(scrShowPane gScreen "Default")
</Action>
</Actions>
</ConfirmOrder>
<ThankYou
desc="Your order has been placed and will be ready as soon as it arrives. Please check back at this screen to see the status of your order.">
<Actions>
<Action name="Continue" default="1" cancel="1" key="C">
(scrShowScreen gScreen "Main")
</Action>
</Actions>
</ThankYou>
<UnknownItem
desc="Sorry, there are no items in the catalog matching that description."
>
<Actions>
<Action name="Continue" default="1" cancel="1" key="C">
(scrShowPane gScreen "Default")
</Action>
</Actions>
</UnknownItem>
</Panes>
</OrderItem>
<OrderInTransit
name= "=(objGetName gSource)"
>
<Panes>
<Default>
<OnPaneInit>
(scrSetDesc gScreen
(cat "Your order for " (itmGetName (objGetData gSource "Order") 0x108) " has been placed and is in route. "
"The transport holding your order is currently " (objGetDistance gSource (objGetObjRefData gSource "Transport")) " light-seconds away."
)
)
</OnPaneInit>
<Actions>
<Action name="Continue" default="1" cancel="1" key="C">
(scrShowScreen gScreen "Main")
</Action>
</Actions>
</Default>
</Panes>
</OrderInTransit>
<OrderReady
name= "=(objGetName gSource)"
>
<Panes>
<Default>
<OnPaneInit>
(block (spaceNeeded)
(setq gItem (objGetData gSource "Order"))
(setq spaceNeeded (multiply (itmGetMass gItem) (itmGetCount gItem)))
(if (geq (objGetCargoSpaceLeft gPlayerShip) spaceNeeded)
(block Nil
(scrSetDesc gScreen (cat "Your order for " (itmGetName gItem 0x108) " has arrived and has been placed in your cargo hold.\n\nThank you for your business!"))
(setq gResult True)
)
(block Nil
(scrSetDesc gScreen (cat "Your order for " (itmGetName gItem 0x108) " is ready. Unfortunately, you do not have enough room in your cargo hold. Please return when you have freed up enough room."))
(setq gResult Nil)
)
)
)
</OnPaneInit>
<Actions>
<Action name="Continue" default="1" cancel="1" key="C">
(block Nil
(if gResult
(block Nil
(itmSetKnown gItem)
(objAddItem gPlayerShip gItem)
(objSetData gSource "MissionStatus" Nil)
)
)
(scrShowScreen gScreen "Main")
)
</Action>
</Actions>
</Default>
</Panes>
</OrderReady>
<OrderFailed
name= "=(objGetName gSource)"
>
<Panes>
<Default>
<OnPaneInit>
(scrSetDesc gScreen
(cat "We regret to inform you that your order for " (itmGetName (objGetData gSource "Order") 0x108) " has been destroyed in transit. "
"As we are not liable for losses due to external events, we respectfully recommend that you pursue the matter with your insurance company, if any."
)
)
</OnPaneInit>
<Actions>
<Action name="Continue" default="1" cancel="1" key="C">
(block Nil
(objSetData gSource "MissionStatus" Nil)
(scrShowScreen gScreen "Main")
)
</Action>
</Actions>
</Default>
</Panes>
</OrderFailed>
<QuotaExceeded
name= "=(objGetName gSource)"
>
<Panes>
<Default>
<OnPaneInit>
(scrSetDesc gScreen
(cat "Sorry, only one order per customer!\n\nPlease buy our in-stock items or visit another Trading Post at a system near you.")
)
</OnPaneInit>
<Actions>
<Action name="Continue" default="1" cancel="1" key="C">
(scrShowScreen gScreen "Main")
</Action>
</Actions>
</Default>
</Panes>
</QuotaExceeded>
</DockScreens>
Code: Select all
<!-- Arms Dealer -->
<StationType UNID="&stArmsDealer;"
name= "(arms dealer)"
sovereign= "&svCorporate;"
dockScreen= "Main"
abandonedScreen= "&dsAbandonedStation;"
dockingPorts= "8"
canAttack= "true"
multiHull= "true"
armorID= "&itCeralloyArmor;"
maxHitPoints= "150"
hitPoints= "150"
repairRate= "2"
explosionType= "&vtThermoExplosion1;"
ejectaType= "&vtWreckEjecta;"
attributes= "corporate,independent,fleetDelivery,friendly,envAir,envEarth,envFire,envWater,populated"
levelFrequency= "uccr- ----- ----- ----- -----"
locationCriteria= "+planetary,-asteroids"
>
<Names noArticle="true">Azure Protection Systems; Bixbie Arms; Chiba Arms Dealers;
Dreadnought Arms; Excimer Systems; Farside Defense Systems;
General Arms, rce; Hastur Weapons; Iberian Defense Systems;
Jacob's Arms; Kraken Weapons, rce; Laser Armada; Ming Systems;
Nrummer Weapons Corp.; Obelisk Weapons; Penitent Defender;
Quixote Arms Corporation; Raptor Systems, rce; Security Weapons;
Tenhove Defense Dealer; Ultimate Weapons; Victory Systems;
Weapons World; %s Weapon Systems</Names>
<Image imageID="&rsStations1;" imageX="256" imageY="384" imageWidth="128" imageHeight="128"/>
<Ships>
<Lookup count="2" table="&tbCorpDefenders;"/>
<Lookup count="1d4" table="&tbCommPrivateCrafts;"/>
</Ships>
<Reinforcements minShips="4">
<Table>
<Lookup chance="75" table="&tbCorpDefenders;"/>
<Lookup chance="25" table="&tbCommPrivateCrafts;"/>
</Table>
</Reinforcements>
<Items>
<RandomItem count="10"
criteria= "w -Illegal; -Military; -NotForSale;"
levelFrequency= "c----"
enhanced= "10"
enhancement= "=(intHPEnhancement2)"
/>
<RandomItem count="15"
criteria= "w -Illegal; -Military; -NotForSale;"
levelFrequency= "ucu--"
enhanced= "10"
enhancement= "=(intHPEnhancement1)"
/>
<RandomItem count="8"
criteria= "w -Illegal; -Military; -NotForSale;"
levelFrequency= "rucur"
enhanced= "5"
enhancement= "=(intHPEnhancement1)"
/>
<RandomItem count="20"
criteria= "m -Illegal; -Military; -NotForSale;"
levelFrequency= "ucu--"
/>
<RandomItem count="10"
criteria= "m -Illegal; -Military; -NotForSale;"
levelFrequency= "rucur"
/>
<Item count="160" item="&itKM500Missile;"/>
<Item count="1d3" item="&itTargetingComputerROM;"/>
</Items>
<Trade currency="credit" creditConversion="100" max="50000" replenish="2500">
<Sell criteria="*NU -Illegal; -ID; -NotForSale;" priceAdj="110"/>
<Buy criteria="mwU -Illegal; -NotForSale;" priceAdj="60"/>
<Buy criteria="mwU -NotForSale;" priceAdj="60"/>
<Buy criteria="mwuU +WeaponEnhancer; -Illegal; -NotForSale;" priceAdj="80"/>
<Buy criteria="*U +unid:&itLaserAmplifier;" priceAdj="65"/>
<Buy criteria="*U +unid:&itKineticUpgrade;" priceAdj="65"/>
<Buy criteria="*U +unid:&itParticleUpgrade;" priceAdj="80"/>
<Buy criteria="*U +unid:&itBlastUpgrade;" priceAdj="80"/>
<Buy criteria="*U +unid:&itIonUpgrade;" priceAdj="90"/>
<Buy criteria="*U +unid:&itThermoUpgrade;" priceAdj="90"/>
<Buy criteria="*U +unid:&itWeaponSpeedROM;" priceAdj="90"/>
<Buy criteria="*U +unid:&itTargetingComputerROM;" priceAdj="90"/>
<Buy criteria="*U +unid:&itMilitaryMapROM;" priceAdj="90"/>
<Buy criteria="*U +unid:&itRowenaVol5;" priceAdj="80"/>
<Buy criteria="*U +unid:&itRowenaVol4;" priceAdj="80"/>
<Buy criteria="*U +unid:&itRowenaVol3;" priceAdj="80"/>
<Buy criteria="*U +unid:&itRowenaVol2;" priceAdj="80"/>
<Buy criteria="*U +unid:&itRowenaVol1;" priceAdj="80"/>
<Buy criteria="*U +unid:&itEnhanceSRSROM;" priceAdj="30"/>
<Buy criteria="*U +unid:&itAmmoBoxAkan30;" priceAdj="30"/>
<Buy criteria="*U +unid:&itAmmoBoxStrelka1;" priceAdj="30"/>
<Buy criteria="*U +unid:&itAmmoBoxMAG;" priceAdj="30"/>
<Buy criteria="*U +unid:&itAmmoBoxThermo;" priceAdj="30"/>
<Buy criteria="*U +unid:&itAmmoBoxStrelka2;" priceAdj="30"/>
<Buy criteria="mwU -Illegal; -ID;" priceAdj="10"/>
</Trade>
<StaticData>
<WeaponUpgradeList>
(
&itNAMIMissileLauncher;
&itOmniLaserCannon;
&itTurbolaserCannon;
&itArbalestCannon;
&itSlamCannon;
&itParticleBeamWeapon;
)
</WeaponUpgradeList>
</StaticData>
<Events>
<OnContractGenerate>
(intGenerateIndustrialRequestContract1)
</OnContractGenerate>
<OnContractQuery>True</OnContractQuery>
<OnCreate>
; Pick a random upgrade
(objSetData gSource "WeaponUpgrade" (random 0 5))
</OnCreate>
<OnDestroy>
(intCorporateOnDestroy)
</OnDestroy>
</Events>
<DockScreens>
<Main
name= "=(objGetName gSource)"
>
<OnInit>
(intCorporateOnInit "Main")
</OnInit>
<Panes>
<Default>
<Initialize>
(block Nil
(scrSetDesc gScreen "You are docked at an arms dealer station.")
(setq gItem (itmCreate (item (objGetStaticData gSource "WeaponUpgradeList") (objGetData gSource "WeaponUpgrade")) 1))
(scrSetActionLabel gScreen 2 (cat "Install " (itmGetName gItem 0)))
)
</Initialize>
<Actions>
<Action name="Buy items" default="1" key="B">
(comShowBuyScreen
"*" ; items sold to player
"Main" ; return screen
'( "d" ; install devices
6 ; of level 6 (and below)
Nil ; no special tech modifiers
True ; check for military ID
-50) ; install cost margin
)
</Action>
<Action name="Sell items" key="S">
(comShowSellScreen
"*" ; items bought from player
"Main" ; return screen
)
</Action>
<Action name="Install new weapon" key="I">
(block Nil
(setq gPrevScreen "Main")
(setq gPrevPane "Default")
(setq gItem (itmCreate (item (objGetStaticData gSource "WeaponUpgradeList") (objGetData gSource "WeaponUpgrade")) 1))
(setq gCost (add (itmGetPrice gItem) (divide (itmGetInstallCost gItem) 2)))
(setq gCheckMilitaryID True)
(scrShowScreen gScreen "&dsInstallSpecificDevice;")
)
</Action>
<Action name="Repair Damaged Devices" key="R">
(block Nil
(setq gPrevScreen "Main")
(setq gPrevPane "Default")
(setq gMargin 250)
(setq gShowCriteria "*~aD")
(scrShowScreen gScreen "&dsRepairItem;")
)
</Action>
<Action name="Undock" cancel="1" key="U">
<Exit/>
</Action>
</Actions>
</Default>
</Panes>
</Main>
</DockScreens>
<DockingPorts>
<Port x="0" y="70" />
<Port x="0" y="-70" />
<Port x="50" y="50" />
<Port x="50" y="-50" />
<Port x="70" y="0" />
<Port x="-70" y="0" />
<Port x="-50" y="50" />
<Port x="-50" y="-50" />
</DockingPorts>
</StationType>
Flying Irresponsibly In Eridani......
I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
I don't like to kill pirates in cold blood ..I do it.. but I don't like it..