[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

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 1. Apr 13, 03:59

Cascinova wrote:I want to use this but also use the bailing addon, so hopefully someone can come up with a fix.
Turn bailing off when you invade the Phanon HQ sector?

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

Post by Litcube » Mon, 1. Apr 13, 04:31

It's two lines of code. Ill post it tomorrow.

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

Post by Litcube » Mon, 1. Apr 13, 16:06

Line 446 of al.LitQB.PhanCorp.MakeShip

Code: Select all

446    $Temp = random value between 5 and 30
447    $Ship-> set pilot morale: $Temp
Edit: It was suggested by Dr. Bullwinkle that the 5 listed above is erroneous, and would be unequivocally more awesome had it been 0. You have been warned.
Last edited by Litcube on Mon, 1. Apr 13, 21:37, edited 2 times in total.

Cascinova
Posts: 239
Joined: Mon, 27. Dec 10, 18:15
x3tc

Post by Cascinova » Mon, 1. Apr 13, 20:09

Litcube wrote:Line 446 of al.LitQB.PhanCorp.MakeShip

Code: Select all

446    $Temp = random value between 5 and 30
447    $Ship-> set pilot morale: $Temp
I am not sure how exactly to add those 2 lines, (I am assuming you add them since I can't find them already there). Can someone who is a bit more experienced than me please upload a new xml file with the changes?

User avatar
Ingenious Hero
Posts: 6
Joined: Tue, 2. Apr 13, 07:39
x3tc

Post by Ingenious Hero » Tue, 2. Apr 13, 08:17

First of all, Litcube and Teleth, thank you so much for the mod! I just started my first mod installations earlier today and your instructions are as simple as I imagine they can be.

I am a long time lurker, finally registered to say thank you to everyone whose mods I've just started using. :)
Cascinova wrote:I am not sure how exactly to add those 2 lines, (I am assuming you add them since I can't find them already there). Can someone who is a bit more experienced than me please upload a new xml file with the changes?
Please do this:
1. Open the XML file Litcube referred to with notepad (or any basic text editor)
2. Find the line "$Ship ->add default items to ship" (without quotes). This is line 445. Add the code Litcube has suggested right after this line.

An easy way to find out which line number someone is talking about is by opening up the script in the in-game script editor. Here's how to enable the in-game script editor: Link.
Teleth wrote:If you really want the new ships, you need to open al.LitQB.PhanCorp.MakeShip.xml in the script editor while in-game and make sure all the ship definitions are valid, if one of them is blank, unknown, or not the class it is supposed to be, set it to a valid ship of the same class. If you fail to complete this step properly, you will see a great deal of mammoth ships instead of what Phanon intended to buy.
Thanks for the pointer! I did this and 6 entries (5 M7s and 1 M2) have invalid values (zzPlaceholder Hauler) in TC XRM. I will hopefully find which values should go with them in the next couple of days and will post them in case others are using this mod with TC XRM.
Teleth wrote:As for the map, I believe the XRM/AP map differs from the XRM/TC version so you'll also need to modify my /t/8384-L044.xml (or 8374-L0_*** if not English).

8384-L044.xml:
<t id="300">4,15</t>

Modify id 300 through 312 (use notepad or better), these are spawn locations for Phanon which will differ slightly from the XRM/AP map; unfortunately I do not know the differences.
Thank you for this info too!
Teleth wrote:Set them all to 4,15, or use Sector Finder and print out a copy of your sector (inside log00001.txt) coordinates to find locations.
The sector co-ordinates are actually in the XRM TC map (as they are in the XRM AP map too). Anyone wanting to modify co-ordinates only needs to notice on that map where 16-0 and one of the other ones, say 3-15 is. :) The rest is easy. Just an alternative method!

For anyone running TC XRM, these are unknown sectors and are fairly spread out all over the map:

Code: Select all

    <t id="300">4,15</t>
    <t id="301">9,6</t>
    <t id="302">18,16</t>
    <t id="303">17,2</t>
    <t id="304">12,0</t>
    <t id="305">20,5</t>
    <t id="306">14,7</t>
    <t id="307">4,7</t>
    <t id="308">5,10</t>
    <t id="309">10,9</t>
    <t id="310">16,6</t>
    <t id="311">12,15</t>
    <t id="312">6,15</t>

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 2. Apr 13, 08:42

Great post, Ingenious! :thumb_up:

One minor correction:

Ingenious Hero wrote:
Cascinova wrote:I am not sure how exactly to add those 2 lines
1. Open the XML file Litcube referred to with notepad (or any basic text editor)
You MUST use an editor made for X3 scripts, such as the in-game Script Editor. A normal text/xml editor will not work. If you want an external editor then use X-Studio Script Editor or Exscriptor. The human-readable portion of X3's script files is just "documentation". The real code is the array of numbers at the bottom.

A text editor is fine for editing most other files in the game. Only scripts require a special editor.

User avatar
Ingenious Hero
Posts: 6
Joined: Tue, 2. Apr 13, 07:39
x3tc

Post by Ingenious Hero » Tue, 2. Apr 13, 11:14

Thanks for that catch, DrBullwinkle! I totally made the mistake thinking that a script is a harmless xml file I could tinker with in notepad and save...NOT!

Its safe to say I have a new admiration for modders after spending the last hour trying to figure out how to enter 2 lines through the in-game script editor.

For anyone else new to the editor, this is how I did it:

1. Open the in-game script editor, load al.LitQB.PhanCorp.MakeShip. Find line 446. Click to bring up available commands.
2. In 'General Commands' section select the option <Ret/Var> = random value from <Var/Number> to <Var/Number> - 1
3. For Script Input <variable> make a new variable Temp (there's tmp and tmp2 available but the Force tells me using an existing variable to generate random numbers might make bad things happen elsewhere).
4. Click first ?, then Script Input <Number> and set this to 0 (because DrBullwinkle recommends so - justfuckin'doit)
5. Click second ?, then Script Input <Number> and set this to 31 (because the line will subtract 1 from the max and we want to get to 30)

One line down, one more to go!

6. Click on Line 447, choose 'General Object', then 'Pilot', find the option <RefObj> set pilot morale = <Var/Number>
7. For RefObj, pick the existing variables Ship (because this has to be a 'global' variable, that's why the variable we created will point to it to feed it values)
8. For <Var/Number>, pick the existing variable Temp, which we created.

Phew! I think I got it right...can't be sure though. :P

I wasn't even planning on using the NPC bail mod...could not resist the opportunity to nerdgasm. :roll:

Thufar
Posts: 407
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Thufar » Tue, 2. Apr 13, 23:18

I just want to say thanks to Ingenious Hero...

...and express my continuing appreciation for folks that can do in an hour what it would take me a month of Sundays to do - that's with a whole lot of luck too. You guys are... way-out-there awsome!

User avatar
Ingenious Hero
Posts: 6
Joined: Tue, 2. Apr 13, 07:39
x3tc

Post by Ingenious Hero » Wed, 3. Apr 13, 12:04

I looked into the al.LitQB.PhanCorp.MakeShip.xml script more today to fix the "zzPlaceholder Hauler" entries and I understand why Teleth said that modifying this script for TC XRM isn't worth the effort - its because even if the changes are not made the gameplay wouldn't be impacted much at all.

First, this script is only being used to populate Phanon Corp's fleet. The script has no effect on XRM itself.

Second, the way ship population for Phanon Corp is working in the script is by randomly picking ships across all races and classes, out of a total of 210 ships from the ship list in the script. Given that there are only 7 entries for "zzPlaceholder Hauler" in the ship list, the odds are awfully low of a ship generation have more than one (or any for that matter) placeholder ships in the Phanon fleet.

Still, since I had spent time to figure out what the script was doing, I went ahead and did the (un-needed) fix. This is how I did it:

1. Open al.LitQB.PhanCorp.MakeShip.xml with the in-game script editor.
2. Look for "zzPlaceholder Hauler". There are 5 entries among M7s and 1 among the M2s.
3. First entry should be at line 305: Make a mental note of the other ships in the 'group', i.e. other entries around this line viz. $M7[RaceBoron][number] = Kraken, Sturgeon, Thresher etc. These are Boron M7s this script understands.
4. Click on zzPlaceholder Hauler -> Script Input -> Select Ship Type -> (from this ship list pick any of the already used entries of ship name from Step 2). It is OK for the same group to have more than 1 entry of the same ship name. The unmodified script has several entries like this.

Repeat Steps 2-4 for the other "zzPlaceholder Hauler" entries. Done.


@ Thufar:

Thank you for the nice words. :) Thanks to Teleth, Litcube, DrBullwinkle really. I'm only baby-ing around trying to tinker with little things which don't need any tinkering with. :P
‎‎
Promote quality, discourage crap.

feygan
Posts: 147
Joined: Fri, 26. Dec 03, 18:41
x4

Post by feygan » Fri, 5. Apr 13, 22:37

DrBullwinkle wrote:
Cascinova wrote:I want to use this but also use the bailing addon, so hopefully someone can come up with a fix.
Turn bailing off when you invade the Phanon HQ sector?
Sadly that option is only viable for the HQ sector. Once they start to populate the galaxy you end up having to toggle bailing each and every time anything m6 or larger is in a sector. I noticed this when they build a power plant in one of my sectors. I naturally went to remove it to find an m2 jumping in as defence. With their low bravery ratings it bailed almost as soon as shields were down.

Smart_Bomb
Posts: 532
Joined: Fri, 22. Dec 06, 13:35
x4

Post by Smart_Bomb » Mon, 27. May 13, 19:38

Teleth, does your extensions to the Phan corp for XRM also include some scripts for dealing with Xenon, Kha'ak, pirates if I used the notsafe extension so that Phan corp has to deal with those 3 races like a player does? Or do you recommend and dont use it?
- Please check out & vote on my X4:F expansion idea thread

[ external image ]

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

Post by Litcube » Mon, 27. May 13, 19:57

Not that you asked me, but I wouldn't recommend that extension. The Phanon has restrictions. Kha'ak and Xenon are infinite spawns from the God engine. Allowing the Phanon to be viable targets for those two will result in a muted Phanon Coporation experience.

Smart_Bomb
Posts: 532
Joined: Fri, 22. Dec 06, 13:35
x4

Post by Smart_Bomb » Mon, 27. May 13, 21:41

It doesnt matter who answers as long as it does :wink:

Thanks Lit!
- Please check out & vote on my X4:F expansion idea thread

[ external image ]

nap_rz
Posts: 1383
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by nap_rz » Fri, 21. Jun 13, 04:08

Litcube wrote:Not that you asked me, but I wouldn't recommend that extension. The Phanon has restrictions. Kha'ak and Xenon are infinite spawns from the God engine. Allowing the Phanon to be viable targets for those two will result in a muted Phanon Coporation experience.
this, actually I mean I want that... a 'muted' experience if you say...

so... here's what I want, I want to use this XRM tweaked phanon with Improved Race 2 hot war feature...

so the question are :

1. in this XRM phanon, what race is the phanon assigned to?

2. can you customize their relation with IR2 hotwar editor?

3. will it do as intended?

basically I want another faction in the universe but they have to behave normally, not simply going berserk against me with no reason simply just because it's intended to be my rival.

possible?

thanks.

X2return
Posts: 363
Joined: Sat, 19. Nov 05, 22:54
x4

Post by X2return » Sun, 23. Jun 13, 21:24

Perhaps I should have read the Description for this Mod better. I thought this is an additional "trader-race" just well protecting it's environment etc.

For me it looks more like a stubborn bigheaded warrior. I installed the mod, got a threadening message that i have to stay out of their sector.
I was wondering because during reading that "information" I got several audio- and messagewarnings about destroyed ships and equipment.

So i jumped to the called sector and there were multiple surprises.
My entire equipment (Satellites & maybe a jump beacon) and ships (Lucikes Travel business) in that sector were totally wiped out from the new "sanctimonious dealer".
First things the script invests its 404 million Credits: (I should have taken a screenshot of this arrogant declaration of war.)
- 1x military outpost
- 1x M1 full of fighters
- 1x TL full of fighters
- many M8 + M6
- and 2 or 3 TS ...

For me this looks more like a Kha'ak invader as a competing trading company. What a pity - seems they were bankrupt, now ..., without that fleet ... I really am sorry but i had to encounter a thread like this.

My killed Travel-pilot had about 250 hours of Flight, proud of endless fans in his sector and has been a really kind person! His ship wasn't equiped with lasers at all :(

If the Phanon Corp really means that an offensive war is the best thing made of it's 404 million Credits to meet me first time than one of my smaller CODEA-Carriers will take care of that sector. I really was in hope to have found a new "Race" keeping the economic part of my universe alive because there are missing Powerplants here :evil:


Greetings from germany
X2return

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

Post by Teleth » Tue, 25. Jun 13, 04:31

X2return wrote:Perhaps I should have read the Description for this Mod better. I thought this is an additional "trader-race" just well protecting it's environment etc.

For me it looks more like a stubborn bigheaded warrior. I installed the mod, got a threadening message that i have to stay out of their sector.
I was wondering because during reading that "information" I got several audio- and messagewarnings about destroyed ships and equipment.

So i jumped to the called sector and there were multiple surprises.
My entire equipment (Satellites & maybe a jump beacon) and ships (Lucikes Travel business) in that sector were totally wiped out from the new "sanctimonious dealer".
First things the script invests its 404 million Credits: (I should have taken a screenshot of this arrogant declaration of war.)
- 1x military outpost
- 1x M1 full of fighters
- 1x TL full of fighters
- many M8 + M6
- and 2 or 3 TS ...

For me this looks more like a Kha'ak invader as a competing trading company. What a pity - seems they were bankrupt, now ..., without that fleet ... I really am sorry but i had to encounter a thread like this.

My killed Travel-pilot had about 250 hours of Flight, proud of endless fans in his sector and has been a really kind person! His ship wasn't equiped with lasers at all :(

If the Phanon Corp really means that an offensive war is the best thing made of it's 404 million Credits to meet me first time than one of my smaller CODEA-Carriers will take care of that sector. I really was in hope to have found a new "Race" keeping the economic part of my universe alive because there are missing Powerplants here :evil:


Greetings from germany
X2return
I can't quite recall how Phanon works but it certainly doesn't get a force like this when I start it, I suspect it may have something to do with your pilot ranking?

X2return
Posts: 363
Joined: Sat, 19. Nov 05, 22:54
x4

Post by X2return » Tue, 25. Jun 13, 08:04

Is the Phanon Corp intended to be an enemy after first activation? All their stations and ships were red named and I they didn't want me to dock and trade with. Ofcourse I tried that before wiping them out. I forgot to tell that there also was created a Powerplant in "Olmancketslat's Treaty" and 2 or 3 Dealers.

I didn't take a look yet but if the Mod asks my Ranks. They are:
Economic rank: 28 of 30 (Tycoon)
Fight rank: 17 of 30 (Colonel)

I'm not a fighter as long as my equipment is not bothered. That little Fight rank still comes from the plots and my actual interest in relationships to the Terran & ATF. From rank -4 (Terrorist) I saw no other way as hunting a few ships from the other races in the 3 terran war-sectors.

so long
X2return

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

Post by Teleth » Tue, 25. Jun 13, 16:14

X2return wrote:Is the Phanon Corp intended to be an enemy after first activation? All their stations and ships were red named and I they didn't want me to dock and trade with. Ofcourse I tried that before wiping them out. I forgot to tell that there also was created a Powerplant in "Olmancketslat's Treaty" and 2 or 3 Dealers.

I didn't take a look yet but if the Mod asks my Ranks. They are:
Economic rank: 28 of 30 (Tycoon)
Fight rank: 17 of 30 (Colonel)

I'm not a fighter as long as my equipment is not bothered. That little Fight rank still comes from the plots and my actual interest in relationships to the Terran & ATF. From rank -4 (Terrorist) I saw no other way as hunting a few ships from the other races in the 3 terran war-sectors.

so long
X2return
Phanon is pretty much designed to be a opponent capable of fighting on equal terms, even further into the game, it not only deals with trading but fighting too. I imagine the reason they start so amazingly powerful is because of your awesome ranks :D
If you run a pretty peaceful game it's probably not a good idea to add it.

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

Post by Litcube » Tue, 25. Jun 13, 16:44

Yes, Phanon are enemies from the outset. It's intended to be started with you as you progress through the game. At 28 economic rank, it's assumed you've had ample time to beef your forces, therefore Phanon starts with extra capital depending on what your economic rank is. They would not have started with this if you'd started the game with it. It was my way of allowing players to jump in without restarting.

X2return
Posts: 363
Joined: Sat, 19. Nov 05, 22:54
x4

Post by X2return » Tue, 25. Jun 13, 16:57

Teleth wrote:
X2return wrote:Economic rank: 28 of 30 (Tycoon)
Fight rank: 17 of 30 (Colonel)
Phanon is pretty much designed to be a opponent capable of fighting on equal terms, even further into the game, it not only deals with trading but fighting too. I imagine the reason they start so amazingly powerful is because of your awesome ranks :D
If you run a pretty peaceful game it's probably not a good idea to add it.
... my awesome ranks? :?:
I really am trying to avoid fighting whenever it's possible. Everytime Betty tells me a promotion in fighting I'm getting almost some kind of panic :oops:

I mean Rank 17 is a very low fight rank. Most of that serious pirat patrols (with 3 ships) attacking my complexes i kill with cheatpackage to avoid points to the fight rank :o

I will go on watching how Phanon Corp is growing ... actually they have about 10mio Credits and next order is a TL.

Greetings
X2return

I haven't seen Litcubes comment until here so here is my Edit:
Litcube wrote:Yes, Phanon are enemies from the outset. It's intended to be started with you as you progress through the game. At 28 economic rank, it's assumed you've had ample time to beef your forces, therefore Phanon starts with extra capital depending on what your economic rank is. They would not have started with this if you'd started the game with it. It was my way of allowing players to jump in without restarting.
Thank your for that answer. So that's why. With that explanation it makes sense to me. Now it even sounds well balanced.
But I would really prefer not to fight them, I'd rather support them with my own dealers - as told I'm no fighter.
May there be a way to create an option the user can change? e.g. like pirate guild.

Thank you
X2return

Post Reply

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