[SCRIPT] Phanon Corporation for X3AP+XRM 1.20

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

[SCRIPT] Phanon Corporation for X3AP+XRM 1.20

Post by Teleth » Sun, 15. Apr 12, 16:38

Phanon Corp 1.21 modified for use with X3AP + XRM 1.20
This modification is not supported by Litcube, if you have any questions PM me, or ask in the thread please.

The original Phanon Corporation thread is located here if you wish to know more about it.
=======================================

I wasn't happy with how Phanon was performing in XRM, so I spent 3 or 4 days getting them up to scratch, ended up fixing a few things and adding the new ships to their shop lists.

I didn't quite understand what was necessary for compatibility with NPC bailing so I didn't make any progress there. I did however fix the Weapon Dealer issue between Phanon and XRM. Hopefully I didn't miss anything.

Download (XRM 1.20 Version)
http://www.mediafire.com/?89bessfp0orcp1l (Version 1.2)

Old version for XRM 1.19
http://www.mediafire.com/?62zvd3ya5fz7ke6 (Version 1.1)

Installation
------------
Install PhanonCorp 1.21a http://members.shaw.ca/litcube/X3/Phano ... pV1.21.zip
Extract PhanonCorp XRM folders with their contents to /addons/ and overwrite.
Changes will take place by either re-enabling Phanon Corp through AL options, or upon a new generation.

Features
--------
The financial report for Phanon Corp now displays hour-based trade rank.
In the event the trade rank is bankrupt, Phanon Corp is not successfully trading.
It either lacks transport ships, can't find anywhere to trade, or is conflicting with another mod.

Phanon Corp may now buy and use most XRM vessels.
Exclude the new scripts/al.LitQB.PhanCorp.MakeShip.xml if you do not want Phanon to use new ships.

Phanon spawn locations updated for use with XRM's map, it has the choice of 13 different locations.

Issues corrected
----------
Corrected starting capital multiplier upon new generations, giving Phanon Corp a much faster starter growth for successive generations.

Balance
--------
Phanon Corp now receives cheaper transport ships and fighter craft to promote earlier growth.
Phanon Corp initial investment increased from 15 million credits to 40 million credits. This is usually enough to purchase 4 or 5 transport ships and some jumpdrives.
Salary multiplier doubled to offset higher XRM costs.
New generations of Phanon Corps spawn 3 to 4 hours after the last was defeated, rather than 18 hours later.
Phanon favors M6 sentinel configurations that are more effective for the AI.
Adjusted force ratios, for slightly less fighters and slightly more corvettes.
Added M6 and M7 craft to early Phanon forces.
Phanon Corp TL-class ships are fully re-imbursed if killed by Pirates/Xenon/Kha'ak/Yaki, this prevents Phanon being locked down in early game due to piracy etc.

Notes
------
Phanon's credit worth will occasionally go negative when it purchases jumpdrives or wares, if Phanon's trade rank is not bankrupt, then it is still expanding normally.

Hopefully these changes will enable a more prosperous Phanon in XRM. Enjoy!
Last edited by Teleth on Sun, 2. Mar 14, 16:19, edited 7 times in total.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sun, 15. Apr 12, 17:50

I tried reinstalling it but now I don't see any AL menu for phanon corp now. Is it conflicting with MARS for some reason>>

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Sun, 15. Apr 12, 19:18

BlackRain wrote:I tried reinstalling it but now I don't see any AL menu for phanon corp now. Is it conflicting with MARS for some reason>>
No, it's not going to conflict with MARS; as I explained earlier, Phanon Corp is not going to be conflicting anything other than race1 modifications as far as I know.

You had best check that it is in the correct directory, because there is very little that can go wrong when installing Phanon Corp.

Install PhanonCorp 1.21a.
Install PhanonCorpXRM over top.

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Sun, 15. Apr 12, 20:40

Moving the Weapons Dealer XL to race 2 will cause it not to be stocked with weapons without a script rewrite.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sun, 15. Apr 12, 20:55

paulwheeler wrote:Moving the Weapons Dealer XL to race 2 will cause it not to be stocked with weapons without a script rewrite.
Changing a scripts racial references is a minor 5 minute change that im sure Teleth can figure out; No need to rewrite the script ;)
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Sun, 15. Apr 12, 21:46

@ Teleth - if you need help finding which XRM scripts need altering let me know - my scripts are not fully annotated and there are quite a few to hunt through. I think there are two that will need altering for the Weapons Dealer XL to work as Race 2.

The only issues will be that if you include the changed XRM scripts in this pack you'll have to keep an eye on the said scripts in case I update them in a patch - its not likely but you never know. Also, you'll need to make users aware that they if they recopy all the XRM scripts when I release an update it will overwrite the edited ones from this pack.

To be honest, the only reason I used Race 1 for the Weapon Dealer in the first place was that when I implimented the WDs during the SRM development there was a planned feature in IR v1 (I'm pretty sure it was IR - it was a long, long time ago though and at my age, memory is not what it was) which was going to use Race 2. I decided to keep away from Race 2 in order to keep the SRM compatible with IR. This feature was never implemented in IR so there is no reason I guess why I don't just swap the ownership to Race 2 in the main XRM which would solve all the problems. Unless there are any other scripts which utilise Race 2?

I'll look at including the change in the 1.20 patch.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sun, 15. Apr 12, 22:07

paulwheeler wrote:Unless there are any other scripts which utilise Race 2?
None to my knowledge. (i wish there was a spare race usage thingy in the community library thread)

The feature in IRv1 was scrapped due a few different glitches that interfered with IRv1's core operation; one of which included the lockup problem when docking at Race2/1 stations (did you ever manage to fix that? i stopped trying after about a week lol)

Ironically we chose race 2 to maintain compatibility with Phanon Corp... :lol:
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Sun, 15. Apr 12, 22:13

Jack08 wrote:one of which included the lockup problem when docking at Race2/1 stations (did you ever manage to fix that?)
No - but ive not tested it in AP yet. I recall there being some changes to the spare races to make them more usable.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sun, 15. Apr 12, 22:44

I got it to work.

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Mon, 16. Apr 12, 05:09

paulwheeler wrote:Moving the Weapons Dealer XL to race 2 will cause it not to be stocked with weapons without a script rewrite.
I actually edited my XRM weapon's dealer re-stock to race2 but decided against including it for some reason. I can't even remember why.

I'm glad you called me out on this, else it would have never been restocked!

I modified four files for this, let me know if I missed something important; they all look pretty weapons dealer specific so I can't imagine you will update them too often.
  • plugin.xrm.rnddest.xml
    plugin.xrm.stockcheck.xml
    plugin.xrm.wd1.xml
    plugin.xrm.wd2.xml
In reality what I should have done is made phanon hostile via script instead of letting it change race1 parameters. I didn't understand enough X3 scripting to mess too heavily with Phanon at the time.

Phanon_XRM_1.1
Hopefully I didn't do anything else stupid.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Mon, 16. Apr 12, 06:10

Hey Teleth,

Thanks for putting this together.

One small suggestion though. Add something like [SCRIPT] or something to the beginning of the thread title. Otherwise it just looks like a random thread or something. This will make finding it easier in the future.

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Mon, 16. Apr 12, 08:04

How does this plugin find what ships it should use? Does it just pick a random ship or is there a hard coded list?
Also can you add this to The script and mod libary.

Good Luck You'll need it ;)
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Mon, 16. Apr 12, 09:56

Teleth wrote:
paulwheeler wrote:Moving the Weapons Dealer XL to race 2 will cause it not to be stocked with weapons without a script rewrite.
I actually edited my XRM weapon's dealer re-stock to race2 but decided against including it for some reason. I can't even remember why.

I'm glad you called me out on this, else it would have never been restocked!

I modified four files for this, let me know if I missed something important; they all look pretty weapons dealer specific so I can't imagine you will update them too often.
  • plugin.xrm.rnddest.xml
    plugin.xrm.stockcheck.xml
    plugin.xrm.wd1.xml
    plugin.xrm.wd2.xml
In reality what I should have done is made phanon hostile via script instead of letting it change race1 parameters. I didn't understand enough X3 scripting to mess too heavily with Phanon at the time.

Phanon_XRM_1.1
Hopefully I didn't do anything else stupid.
Yes that sounds about right for the scripts that need editing.

Ill make the change to Race 2 in XRM 1.20.

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Mon, 16. Apr 12, 12:56

jack775544 wrote:How does this plugin find what ships it should use? Does it just pick a random ship or is there a hard coded list?
Also can you add this to The script and mod libary.

Good Luck You'll need it ;)
It's a hard-coded list that I had to fill out manually.

As for the community index; it looks like too much trouble.
joelR wrote:Hey Teleth,

Thanks for putting this together.

One small suggestion though. Add something like [SCRIPT] or something to the beginning of the thread title. Otherwise it just looks like a random thread or something. This will make finding it easier in the future.
Will do, thanks.

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Tue, 17. Apr 12, 05:34

Wouldn't a nicer way to find ships be to get an array of all purchasable ships in the galaxy and then to just select a random ship out of that array. Much easier to mantain then a hard coded list (ie. every time Paul adds a new ship you don't have to modify the script to support it.)
And if you don't put something in the libary it will be lost about 2-3 weeks after it was created.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Tue, 17. Apr 12, 06:27

jack775544 wrote:Wouldn't a nicer way to find ships be to get an array of all purchasable ships in the galaxy and then to just select a random ship out of that array. Much easier to mantain then a hard coded list (ie. every time Paul adds a new ship you don't have to modify the script to support it.)
And if you don't put something in the libary it will be lost about 2-3 weeks after it was created.
Well I could do that, as I'm not particularly fond of hardcoded lists, but I'm pretty much done with working on Phanon Corp. I currently spend much of my X3 time working on my UFJD mod, which will hopefully amount to something if I don't slack off too much..

Litcube himself expressed some interest for doing a newer version of Phanon at some point, so maybe he will work at it (and hopefully include XRM support).

As for the library, perhaps I should just ask Paul to link to the thread if users want to use Phanon in XRM. The more XRM-related content in the main post, the easier it is for people to get things running. So long as I strip out the weapons dealer fix for 1.20, future versions of XRM should be 100% compatible.
Personally I'm not terribly worried about Phanon XRM becoming lost, in the end I only created the mod for myself, and released it because others might find it useful. If I really wanted to work something like Phanon for an extended period, I would probably just write something from scratch. Maybe I will attack those XRM privateers next :)

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Tue, 17. Apr 12, 08:10

Yeah - ill update the script compatibility section in the XRM thread with a link to this when i get five mins - probably later today.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Fri, 4. May 12, 23:45

Teleth wrote:
jack775544 wrote:Wouldn't a nicer way to find ships be to get an array of all purchasable ships in the galaxy and then to just select a random ship out of that array. Much easier to mantain then a hard coded list (ie. every time Paul adds a new ship you don't have to modify the script to support it.)
And if you don't put something in the libary it will be lost about 2-3 weeks after it was created.
Well I could do that, as I'm not particularly fond of hardcoded lists, but I'm pretty much done with working on Phanon Corp. I currently spend much of my X3 time working on my UFJD mod, which will hopefully amount to something if I don't slack off too much..
A hardcoded list is more modder friendly than trying to build a ship array. The reason being, is that I have no way of parsing an unexpected TShip file. If you look at vanilla, they have drones assigned to M5s, Argon. Unused ships assigned to valid races and classes, etc. XRM TShips is the same way.

My own Tships is organized strictly. Only valid ships are to be assigned to a usable race, and only valid classes to a usable class. OTAS is friendly race, Neutral contains all utility ships, enemy is for #deca ships. I deleted all obsolete or unused indexes. This way, I can pull an array of RACE and CLASS, and know I have a valid array of spawnable ships. I posted a call to all modders to change ways, come to a consensus, but no one answered. If everyone adhered, all script packages that spawn ships would be compatible.

The problem remains.

A hardcoded list is easy to change once as opposed to guessing how a modder organized his TShips.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Sat, 5. May 12, 18:55

So if I want to have Phanon+X3TC+XRM, do I download this script too, or the original one ?

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Sat, 5. May 12, 21:59

Ive swapped the weapons dealer xl to race 2 in the latest xrm release, so the changes this makes to the xrm scripts are no longer necessary.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”