[Discussion] Generic X3TC S&M questions III

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

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

Post Reply
User avatar
Aldebaran_Prime
Posts: 1386
Joined: Sat, 20. Feb 10, 17:47
x4

Post by Aldebaran_Prime » Mon, 10. Jul 17, 07:51

Reaper507 wrote:Hello guys,

changing jobs.txt requires start a new game? What means field "Is Owner Sector"?
I just tested a changing of jobs.txt - no it doesn't. But it need several hours (>4) until it worked in my case.

"Is Owner Sector" means, that ships only appear in sectors which have the same race as the job-entry race. Sure - after spawning, they may move into other sectors...

Xe-131
Posts: 64
Joined: Mon, 1. Jun 15, 15:23
x4

Post by Xe-131 » Thu, 24. Aug 17, 21:34

Hi,

I decided against creating a thread as I'm sure this question or similar has been asked a thousand times, but I've started playing around with the galaxy editor and when I try to add sectors that weren't already in the loaded x3_universe (from import patch data, I'm on Litcube's Universe and haven't tried vanilla yet but I have to download it first) I can't see them on the universe map afterwards, nor can I connect gates to them or access them in any way. I can't even change sector names or descriptions.

Is what I'm trying to do beyond the editor's capabilities? If so, could anyone point me in the right direction?

Cheers!

Darth_Wayner
Posts: 33
Joined: Sun, 20. Jan 13, 01:01

Post by Darth_Wayner » Sun, 28. Jan 18, 15:18

I'm trying to write a script similar to "Space Loot Transpoter" that works on Marines. I'm tired of flying around trying to scoop up marines after a failed boarding attempt so I want to put them back into my cargo hold via transporter device.

SLT uses <var> get object class

I can find "Astronaut" under get object class and "space suit" under a <var> get ship class but niether of these seem to work for marines, which show on the sector map as "Astronaut (Marine)". I can't seem to find this object anywhere in the scripting menus.

As a follow-on, I tried alternatively to have the script read the Marine information with "<Var> get marine fighting skill" etc then destroy the flying marine and create a duplicate in my cargo hold. This isn't favorable because I'd lose the marine historical stats such as number of boarding etc, but better than nothing. I can't get this to work either because the scripts doesn't seem to recognize a flying marine the same way it does a Marine in you cargo hold.

Based on oth of these attempts, I can only surmise that a flying marine is a special type of object that I just haven't been able to find in the scripting menus?

Any help would be appreciated!

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sun, 28. Jan 18, 16:57

Are you sure that your code finds the correct astronaut in space, before you perform the class check? Best you post your script code here, so that we can have a look. (Double click on the script file in your "scripts" folder, then post the browser view of your script in code-tags here.)

An object class check for Astronaut should work on any astronaut in space, whether it's a passenger or a marine. To determine whether it really is a marine then, there's the <RetVar/IF> is marine: passenger/astronaut=<Var/Passenger> command. The commands to retrieve the marine skills should work on a marine in a space suit, too.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Darth_Wayner
Posts: 33
Joined: Sun, 20. Jan 13, 01:01

Post by Darth_Wayner » Mon, 29. Jan 18, 03:25

thanks for your help illuminatus, not sure what i was foing wrong, but i got it working now. my last minor hiccup is that i'm trying to get the marine's name. everytime i beam a marine aboard, its name is "Astronaut ( Marine)". im using "<ret/var> get object name" or something similar under general object commands. Is there a command where i can get the marine's actual name name (Leonar Jovi, for example)?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Mon, 29. Jan 18, 10:34

Try "<RetVar> = <RefObj> get pilot name" from General Object Commands -> Pilots.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Darth_Wayner
Posts: 33
Joined: Sun, 20. Jan 13, 01:01

Post by Darth_Wayner » Mon, 19. Mar 18, 13:02

so i've been a scripting maniac lately, really enjoying it. Anyway, i wrote a script to sprinkle some PALC, IBL, and PSG forges randomly around the universe. i put the PALC forges in split sectors and set owner to split, and same setup for PSG and IBL forges but Paranid. It looked like it was going to work fine...NPC traders and my UTs promptly answered the call for resources but the factories are not producing. is there a script that needs to be called for each station to start them producing?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Mon, 19. Mar 18, 13:29

Yes, you have to turn on the factory production task.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

sajjukar
Posts: 15
Joined: Sun, 10. Feb 08, 10:56
x3ap

Post by sajjukar » Mon, 19. Mar 18, 22:10

Has any one you tried :

AP + XTC + Caudiu's Xtra (XTC compatibility versions ) ?
yvy

sajjukar
Posts: 15
Joined: Sun, 10. Feb 08, 10:56
x3ap

Post by sajjukar » Wed, 21. Mar 18, 18:56

On XTC AP + Cadius/Xtra pack (XTC compatible version)

I am not able to dock a TP/TS/M6 to the Tapukei Spport Frigate.
It does say that it has 10 Fighter bays and 6 External Ports.

Checked the model and it does actually have the Ext. Docking ports.
But when I order a dock to, the Tapukei cannot be selected....


Anyone knows how to fix this?
Is it an issue with the script and not the Tships/Model ?
yvy

UnknownObject
Posts: 393
Joined: Fri, 15. Jan 10, 12:05
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by UnknownObject » Mon, 19. Nov 18, 13:30

In 2 cases game creates ships that aren't in the Jobs file: 1) M6 + a large group of fighters intruding to the space of an unfriendly race (for example, Argon Heavy Centaur and a swarm of Novas, Busters and Discoverers invade a Paranid sector and start fighting; 2) a small group of fighters guarding an OWP.
There can be some rare ships among them: Argon Notus Hauler, Teladi Kite Vanguard, Teladi Kestrel (I know it's buyable, but NPCs use it rarely), Drones Haulers (in AP).
I'm curious, where is the code for these events?
Мир всем народам на свете.
Нам не нужна
Война!

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by SirNukes » Mon, 19. Nov 18, 20:07

UnknownObject wrote:
Mon, 19. Nov 18, 13:30
2) a small group of fighters guarding an OWP.
That is found in the x3_universe map file.

UnknownObject
Posts: 393
Joined: Fri, 15. Jan 10, 12:05
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by UnknownObject » Tue, 20. Nov 18, 07:53

SirNukes wrote:
Mon, 19. Nov 18, 20:07

That is found in the x3_universe map file.
Thanks!

Code: Select all

		<o id="3996" t="7" s="SS_SH_A_OWP_1" x="3034120" y="298855" z="6798024" r="1">
			<o t="23" s="10">
				<o t="24" s="15"/>
				<o t="26" s="0" v="0"/>
				<o t="26" s="0" v="0"/>
				<o t="26" s="0" v="0"/>
				<o t="26" s="0" v="0"/>
			</o>
But I don't understand, how this code can create a Notus Hauler in Legend's Home?
Мир всем народам на свете.
Нам не нужна
Война!

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by SirNukes » Tue, 20. Nov 18, 08:18

That quoted part is apparently a script command. You can use Chealec's writeup to look up the node types: http://www.xenotaph.net/lib_pdf/galaxy_hacking_x3tc.pdf. Though I don't know what script subtype 15 would be; I also don't see those nodes in the x3_universe file in AP 02.cat.

Anyway, I only see ships for large platforms, and only basic ship types, eg.:

Code: Select all

<o t="7" s="SS_SH_A_OWP_3" x="2588413" y="1691026" z="3330708" r="1">
  <o t="23" s="5">
    <o t="7" s="SS_SH_A_M5" r="1">
    </o>
    <o t="7" s="SS_SH_A_M4" r="1">
    </o>
    <o t="7" s="SS_SH_A_M3" r="1">
    </o>
  </o>
</o>

User avatar
creatoxx
Posts: 32
Joined: Wed, 17. Oct 18, 14:01
x3tc

Re: [Discussion] Generic X3TC S&M questions III

Post by creatoxx » Thu, 22. Nov 18, 13:50

Hey there,

in desperate need of help for Mission Director. I have this MD-code...
please click to open
Show

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>

<director name="TX_MD02_name" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">

	<documentation>	
		<author name="CrEaToXx" alias="M.Adam" contact="creatorx42@gmail.com"/>
		<content name="Exploring Auto Credits" description="Terran Explorer Service"/>
		<version number="0.0.1" date="15.11.2018" status="development"/>
	</documentation>
	
	<cues>
	
		<cue name="TX_MD02_cue01">
			<condition>
				<check_all>
					<check_age value="{player.age}" min="3s"/>
				</check_all>	
			</condition>
			<timing>
				<time min="1s"/>
			</timing>
			<action>
				<do_all>
					<find_debris findobject="{player.ship}" name="TX_MD02_sector_dummy" typename="SS_DEBRIS_FGH" silent="1">
						<sector sector="{player.sector}"/>
					</find_debris>
					<do_if negate="1" value="{object.sector@TX_MD02_sector_dummy}" exact="{player.sector}">
						<show_help force="1" text="{TX_MD02_sector_dummy} is not in {player.sector}, creating!"/>
						<create_debris name="TX_MD02_sector_dummy" typename="SS_DEBRIS_FGH" invincible="1" hidden="1" scanned="0">
							<position object="{player.ship}" min="1000km"/>
						</create_debris>
					</do_if>
					<do_if value="{object.sector@TX_MD02_sector_dummy}" exact="{player.sector}">
						<show_help force="1" text="{TX_MD02_sector_dummy} is in {player.sector}!"/>
					</do_if>
				</do_all>	
			</action>					
			<cues>	
				<cue name="TX_MD02_cue02">
					<condition>
						<check_all>
							<cue_is_complete cue="TX_MD02_cue02"/>
							<object_changed_sector/>
						</check_all>	
					</condition>
					<timing>
						<time min="1s"/>
					</timing>
					<action>
						<do_all>
							<find_debris findobject="{player.ship}" name="TX_MD02_sector_dummy" typename="SS_DEBRIS_FGH" silent="1">
								<sector sector="{player.sector}"/>
							</find_debris>
							<do_if negate="1" value="{object.sector@TX_MD02_sector_dummy}" exact="{player.sector}">
								<show_help force="1" text="{TX_MD02_sector_dummy} is not in {player.sector}, but in{object.sector@TX_MD02_sector_dummy},  creating!"/>
								<create_debris name="TX_MD02_sector_dummy" typename="SS_DEBRIS_FGH" invincible="1" hidden="1" scanned="0">
									<position object="{player.ship}" min="1000km"/>
								</create_debris>
								<reward_player>
									<money exact="1000"/>
								</reward_player>																			
								<reset_cue cue="TX_MD02_cue02"/>
							</do_if>
							<do_if value="{object.sector@TX_MD02_sector_dummy}" exact="{player.sector}">
								<show_help force="1" text="{TX_MD02_sector_dummy} is in {player.sector}, resetting!"/>
								<reset_cue cue="TX_MD02_cue02"/>
							</do_if>
						</do_all>	
					</action>				
				</cue>
			</cues>		
		</cue>
					
	</cues>		

</director>
...what I am trying to achieve is using a object dummy, to evaluate if I visited a sector before(aka "known"), since I can't use sector_is_known when arriving in a sector. The problem is my <do_if negate="1" value="{object.sector@TX_MD02_sector_dummy}" exact="{player.sector}">-check, will always return true, because if the dummy can't be found inside the player.sector, it can be found in any other sector I visited before. So what I need is an exclusive check for the sector im dwelling, without the engine checking any other sector. Is this possible?

Please, if anyone has some code snippets, I'd be grateful for lifetime. I'm tearing my hair out trying to get this working since over a week... :gruebel:

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Re: [Discussion] Generic X3TC S&M questions III

Post by JSDD » Thu, 22. Nov 18, 19:07

you want to figure out if the sector you´ve entered wasnt known before? then you´ve got to create a list of values beforehand, storing wheater it is known or not (is my first guess) ... when arriving, check the value stored in the list, and update it afterwards ... you want to figure out how to loop over a certain range of values?! => check out my example code pieces in my signature ;)
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

User avatar
creatoxx
Posts: 32
Joined: Wed, 17. Oct 18, 14:01
x3tc

Re: [Discussion] Generic X3TC S&M questions III

Post by creatoxx » Fri, 23. Nov 18, 12:25

JSDD wrote:
Thu, 22. Nov 18, 19:07
you want to figure out if the sector you´ve entered wasnt known before? then you´ve got to create a list of values beforehand, storing wheater it is known or not (is my first guess) ... when arriving, check the value stored in the list, and update it afterwards ... you want to figure out how to loop over a certain range of values?! => check out my example code pieces in my signature ;)
:? :gruebel: ...

Code: Select all

	<cues>
	
		<cue name="initCue">
			<timing>
				<time min="1s"/>
			</timing>
			<action>
				<do_all>
					<set_value name="earthKnown" exact="1"/><!-- this list is going to be endless! -->
					<set_value name="moonKnown" exact="0"/>
					<set_value name="venusKnown" exact="0"/>
				</do_all>				
			</action>
		</cue>
		
		<cue name="cue01">
			<condition>
				<check_all>
					<cue_is_complete cue="initCue"/>
					<object_changed_sector/>
				</check_all>
			</condition>
			<timing>
				<time min="1s"/>
			</timing>			
			<action>
				<do_all>
					<do_if value="{sector.known@sector.earth}" exact="1"><!-- this list is also going to be endless! -->
						<set_value name="initCue.earthKnown" exact="1"/><!-- value@initCue.earthKnown? -->
					</do_if>			
					<do_if value="{sector.known@sector.moon}" exact="1">
						<set_value name="initCue.moonKnown" exact="1"/>
					</do_if>
					<do_if value="{sector.known@sector.venus}" exact="1">
						<set_value name="initCue.venusKnown" exact="1"/>
					</do_if>					
				</do_all>	
			</action>
			<cues>
				<cue>
					<condition>
						<cue_is_complete cue="cue01"/>
					</condition>
					<action>
						<do_all>
							<do_if value="initCue.earthKnown" exact="1"><!-- value@initCue.earthKnown? -->
								<reward_player>
									<money exact="1000"/>
								</reward_player>
								<remove_value value="initCue.earthKnown"/><!-- what happens if I remove a value, that's going to be checked in a loop...paradoxon of evil crash? -->																	
							</do_if>			
							<do_if value="initCue.moonKnown" exact="1">
								<reward_player>
									<money exact="1000"/>
								</reward_player>
								<remove_value value="initCue.moonKnown"/><!-- remove needs to be done, so that the check doesn't happen all over again? -->
							</do_if>
							<do_if value="initCue.venusKnown" exact="1">
								<reward_player>
									<money exact="1000"/>
								</reward_player>
								<remove_value value="initCue.venusKnown"/><!-- because I want to get to know an unknown sector only once, to give reward for exploring -->
							</do_if>									  <!-- otherwise that would only benefit the player, for doing mass jumps^^ -->
							<reset_cue cue="cue01"/>						
						</do_all>
					</action>
				</cue>
			</cues>
		</cue>
	</cues>
Edit:

Btw. if I'd just import a list like that upside, I could just as well do it like that, probably using less code, not using any resets...

Code: Select all

	<cues>
	
		<cue name="moonCue">
			<condition>
				<object_changed_sector/>
			</condition>
			<timing>
				<time min="1s"/>
			</timing>
			<action>
				<do_all>
					<do_if value="{sector.known@sector.moon}" exact="1">
						<reward_player>
							<money exact="1000"/>
						</reward_player>					
					</do_if>
				</do_all>
			</action>
		</cue>
		
		<cue name="moonCue">
			<condition>
				<object_changed_sector/>
			</condition>
			<timing>
				<time min="1s"/>
			</timing>
			<action>
				<do_all>
					<do_if value="{sector.known@sector.venus}" exact="1">
						<reward_player>
							<money exact="1000"/>
						</reward_player>					
					</do_if>
				</do_all>
			</action>
		</cue>		
		
	</cues>
It doesn't necessarily matter if I set up a list, as long as MD can't handle lists, groups, whatever, dynamically. That is the simple solution that MD is supposed to deliver, as it is a simple one liner...

Code: Select all

<do_if value="{sector.known@player.sector}" exact="1" & value="initCue.unknownMoon" exact="0">
		...bla bla bla give reward
		...bla bla bla set initCue.unknownMoon exact="1"
		</do_if>
The whole reason why MD is so complicated, is because it can't handle processing two value comparisons. It can't even handle a <do_if> after a <do_if>.

Btw. you bet I already figured how to make endless lists as long as 14 days back. Figuring how endless those lists would be, I tried to figure how to make this dynaically. But obviously MD isn't a script engine.

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Re: [Discussion] Generic X3TC S&M questions III

Post by JSDD » Fri, 23. Nov 18, 15:25

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">

  <cues>
    
    <cue name="you_name_it">
      <action>
        <do_all>
          <!-- loop over universe grid -->
          <do_all exact="24" counter="cx">
            <do_all exact="20" counter="cy">
              <set_value name="you_name_it.sector_was_known_{counter@cx}_{counter@cy}" exact="0"/>
            </do_all>
          </do_all>
        </do_all>
      </action>
    
      <cues>
        
        <cue name="you_name_that_one_too" instantiate="static">
          <condition>
            <check_all>
              <object_changed_sector object="{player.ship}"/>
            </check_all>
          </condition>
          <action>
            <do_all>
              <!-- read list value, update list value -->
              <set_value name="this.sector_was_known" exact="{value@you_name_it.sector_was_known_{player.sector.x}_{player.sector.y}}"/>
              <set_value name="you_name_it.sector_was_known_{player.sector.x}_{player.sector.y}" exact="1"/>
              <!-- here your code, use this.sector_was_known as you wish ... -->
            </do_all>
          </action>
        </cue>
      
      </cues>
    
    </cue>
  
  </cues>
  
</director>
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

bit.hauler
Posts: 36
Joined: Sun, 21. Feb 10, 23:38
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by bit.hauler » Wed, 5. Dec 18, 03:58

I apologise if I'm posting in the wrong place. I did some searches but the key words were so frequenti couldn't narrow down to what I need.

Is there a mod that removes the buying and selling price minimum and maximum? My buddy won't play X3 because the economy is broken if there's limitations like this. I think the game has the economics really well figured out but he would enjoy if the limits weren't there.

Thanks!

Lyth
Posts: 2355
Joined: Mon, 21. Jan 08, 03:48
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Lyth » Wed, 5. Dec 18, 09:08

bit.hauler wrote:
Wed, 5. Dec 18, 03:58
I apologise if I'm posting in the wrong place. I did some searches but the key words were so frequenti couldn't narrow down to what I need.

Is there a mod that removes the buying and selling price minimum and maximum? My buddy won't play X3 because the economy is broken if there's limitations like this. I think the game has the economics really well figured out but he would enjoy if the limits weren't there.

Thanks!
In short, no.
You could tell him that if he docks at stations he can directly barter with traders or accept trade missions as ways to greatly improve the value of the goods or you could install mods that alter the price of good but the min/max would still be a % of that price based on supply.

I have to be honest though, if he thinks that is broken then he doesn't understand the mechanic or the principles of maximum trade prices and he probably should not play the game. Will save him and you alot of stress in the future or just stick to the combat side of things, plenty of other economic games out there if that is his thing. I am not unsympathetic btw, I do get it but it is not broken.
Take it easy, If you can't - Take it by force.

Post Reply

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