[Help - Solved] MD Objects & Variables

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
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

[Help - Solved] MD Objects & Variables

Post by Createse » Mon, 3. Mar 14, 12:57

I'm having trouble understanding the format I need to calculate the number of shields needed, marines to add and ship upgrades to apply to any specific object without 'lookups'. Can anyone shed some light on this for me please?

I've been trying to follow the Schema and Definitions for snippets like 'object.marines.maxcount@object' but I am unsure how to use these useful snippets in context. I also tried assigning a name to the objects beforehand and trying to reference them by name.

Please ignore the values placed in the relevant sections, these are just placeholders as the only time I've got this to work was when I used 'player.ship' as the object, but of course this made calculations based on the player's ship which isn't ideal, despite Egosoft using the same method for Yaki Insurgent and Humble Merchant starts.

Code: Select all

. . .
	<do_when value="{player.gamestart}" exact="1">
		<set_value name="Albion Prelude Link Plot" exact="1" />
		<reward_player>
			<notoriety>
				<relation race="argon" operation="set" exact="neutral" mutual="1" />
				<relation race="boron" operation="set" exact="neutral" mutual="1" />
				<relation race="paranid" operation="set" exact="neutral" mutual="1" />
				<relation race="split" operation="set" exact="neutral" mutual="1" />
				<relation race="teladi" operation="set" exact="neutral" mutual="1" />
				<relation race="goner" operation="set" exact="neutral" mutual="1" />
				<relation race="pirate" operation="set" exact="neutral" mutual="1" />
				<relation race="khaak" operation="set" exact="neutral" mutual="1" />
				<relation race="xenon" operation="set" exact="neutral" mutual="1" />
				<relation race="atf" operation="set" exact="neutral" mutual="1" />
				<relation race="terran" operation="set" exact="neutral" mutual="1" />
				<relation race="yaki" operation="set" exact="neutral" mutual="1" />
			</notoriety>
			<equipment>
				<!-- Equipment -->
				<ware typename="SS_WARE_BEAMING" exact="1" />
				<ware typename="SS_WARE_BESTBUY" exact="1" />
				<ware typename="SS_WARE_BESTSELL" exact="1" />
				<ware typename="SS_WARE_BIOSCANNER" exact="1" />
				<ware typename="SS_WARE_BOOST" exact="1" />
				<ware typename="SS_WARE_LIFESUPPORT" exact="1" />
				<ware typename="SS_WARE_ORECOLLECTOR" exact="1" />
				<ware typename="SS_WARE_SCANNER2" exact="1" />
				<ware typename="SS_WARE_SCANNER3" exact="1" />
				<ware typename="SS_WARE_SPACEFLYCOLLECTOR" exact="1" />
				<ware typename="SS_WARE_SW_CARRIER_1" exact="1" />
				<ware typename="SS_WARE_SW_EXPLORE_1" exact="1" />
				<ware typename="SS_WARE_SW_FIGHT_1" exact="1" />
				<ware typename="SS_WARE_SW_FIGHT_2" exact="1" />
				<ware typename="SS_WARE_SW_NAV_1" exact="1" />
				<ware typename="SS_WARE_SW_NEW2" exact="1" />
				<ware typename="SS_WARE_SW_NEW3" exact="1" />
				<ware typename="SS_WARE_SW_NEW13" exact="1" />
				<ware typename="SS_WARE_SW_PATROL_1" exact="1" />
				<ware typename="SS_WARE_SW_SPECIAL_1" exact="1" />
				<ware typename="SS_WARE_SW_SUPPLY_1" exact="1" />
				<ware typename="SS_WARE_SW_TRADE_1" exact="1" />
				<ware typename="SS_WARE_SW_TRADE_2" exact="1" />
				<ware typename="SS_WARE_TECH231" exact="1" />
				<ware typename="SS_WARE_TECH241" exact="1" />
				<ware typename="SS_WARE_TECH242" exact="1" />
				<ware typename="SS_WARE_TECH275" exact="1" />
				<ware typename="SS_WARE_TECH276" exact="1" />
				<ware typename="SS_WARE_TECH277" exact="1" />
				<ware typename="SS_WARE_WARPING" exact="1" />
				<!-- Inventory -->
				<ware typename="SS_WARE_L_A" exact="1" />
				<ware typename="SS_WARE_L_B" exact="1" />
				<ware typename="SS_WARE_L_S" exact="1" />
				<ware typename="SS_WARE_L_P" exact="1" />
				<ware typename="SS_WARE_L_T" exact="1" />
				<ware typename="SS_WARE_UNFOCUS_JUMP" exact="1" />
				<!-- Shields -->
				<ware typename="SS_SHIELD_D" exact="1" />
				<!-- Upgrades -->
				<ware typename="SS_WARE_TECH213" exact="{player.ship.equipment.SS_WARE_TECH213.maxcount}" />
				<ware typename="SS_WARE_TECH246" exact="{player.ship.equipment.SS_WARE_TECH246.maxcount}" />
				<ware typename="SS_WARE_TECH251" exact="{player.ship.equipment.SS_WARE_TECH251.maxcount}" />
			</equipment>
			<cargo>
				<!-- Cargo -->
				<ware typename="SS_WARE_ENERGY" exact="125" />
			</cargo>
			<property>
				<ship typename="SS_SH_GO_MSY" name="aran">
					<equipment>
						<!-- Equipment -->
						<ware typename="SS_WARE_BEAMING" exact="1" />
						<ware typename="SS_WARE_BESTBUY" exact="1" />
						<ware typename="SS_WARE_BESTSELL" exact="1" />
						<ware typename="SS_WARE_BIOSCANNER" exact="1" />
						<ware typename="SS_WARE_BOOST" exact="1" />
						<ware typename="SS_WARE_LIFESUPPORT" exact="1" />
						<ware typename="SS_WARE_ORECOLLECTOR" exact="1" />
						<ware typename="SS_WARE_SCANNER2" exact="1" />
						<ware typename="SS_WARE_SCANNER3" exact="1" />
						<ware typename="SS_WARE_SPACEFLYCOLLECTOR" exact="1" />
						<ware typename="SS_WARE_SW_CARRIER_1" exact="1" />
						<ware typename="SS_WARE_SW_EXPLORE_1" exact="1" />
						<ware typename="SS_WARE_SW_FIGHT_1" exact="1" />
						<ware typename="SS_WARE_SW_FIGHT_2" exact="1" />
						<ware typename="SS_WARE_SW_NAV_1" exact="1" />
						<ware typename="SS_WARE_SW_NEW2" exact="1" />
						<ware typename="SS_WARE_SW_NEW3" exact="1" />
						<ware typename="SS_WARE_SW_NEW13" exact="1" />
						<ware typename="SS_WARE_SW_PATROL_1" exact="1" />
						<ware typename="SS_WARE_SW_SPECIAL_1" exact="1" />
						<ware typename="SS_WARE_SW_SUPPLY_1" exact="1" />
						<ware typename="SS_WARE_SW_TRADE_1" exact="1" />
						<ware typename="SS_WARE_SW_TRADE_2" exact="1" />
						<ware typename="SS_WARE_TECH231" exact="1" />
						<ware typename="SS_WARE_TECH241" exact="1" />
						<ware typename="SS_WARE_TECH242" exact="1" />
						<ware typename="SS_WARE_TECH275" exact="1" />
						<ware typename="SS_WARE_TECH276" exact="1" />
						<ware typename="SS_WARE_TECH277" exact="1" />
						<ware typename="SS_WARE_WARPING" exact="1" />
						<!-- Shields -->
* * * * * * * * * <ware typename="SS_SHIELD_F" exact="{this.maxshieldcount}" />
						<!-- Upgrades -->
* * * * * * * * * <ware typename="SS_WARE_TECH213" exact="{this.equipment.SS_WARE_TECH213.maxcount}" />
* * * * * * * * * <ware typename="SS_WARE_TECH246" exact="{this.equipment.SS_WARE_TECH246.maxcount}" />
* * * * * * * * * <ware typename="SS_WARE_TECH251" exact="{this.equipment.SS_WARE_TECH251.maxcount}" />
					</equipment>
					<cargo>
						<!-- Cargo -->
						<ware typename="SS_WARE_ENERGY" exact="2000" />
						<ware typename="SS_WARE_FREIGHTDRONE" exact="150" />
						<ware typename="SS_WARE_JUMPBEACON" exact="1000" />
						<!-- Marines -->
* * * * * * * * * <ware typename="SS_WARE_SOLDIER_1" exact="{this.marines.maxcount}" />
					</cargo>
				</ship>
				<ship typename="SS_SH_GO_TL" dockobject="{object@aran}" homebase="{object@aran}" name="ozias">
					<equipment>
						<!-- Equipment -->
						<ware typename="SS_WARE_BEAMING" exact="1" />
						<ware typename="SS_WARE_BESTBUY" exact="1" />
						<ware typename="SS_WARE_BESTSELL" exact="1" />
						<ware typename="SS_WARE_BIOSCANNER" exact="1" />
						<ware typename="SS_WARE_BOOST" exact="1" />
						<ware typename="SS_WARE_LIFESUPPORT" exact="1" />
						<ware typename="SS_WARE_ORECOLLECTOR" exact="1" />
						<ware typename="SS_WARE_SCANNER2" exact="1" />
						<ware typename="SS_WARE_SCANNER3" exact="1" />
						<ware typename="SS_WARE_SPACEFLYCOLLECTOR" exact="1" />
						<ware typename="SS_WARE_SW_CARRIER_1" exact="1" />
						<ware typename="SS_WARE_SW_EXPLORE_1" exact="1" />
						<ware typename="SS_WARE_SW_FIGHT_1" exact="1" />
						<ware typename="SS_WARE_SW_FIGHT_2" exact="1" />
						<ware typename="SS_WARE_SW_NAV_1" exact="1" />
						<ware typename="SS_WARE_SW_NEW2" exact="1" />
						<ware typename="SS_WARE_SW_NEW3" exact="1" />
						<ware typename="SS_WARE_SW_NEW13" exact="1" />
						<ware typename="SS_WARE_SW_PATROL_1" exact="1" />
						<ware typename="SS_WARE_SW_SPECIAL_1" exact="1" />
						<ware typename="SS_WARE_SW_SUPPLY_1" exact="1" />
						<ware typename="SS_WARE_SW_TRADE_1" exact="1" />
						<ware typename="SS_WARE_SW_TRADE_2" exact="1" />
						<ware typename="SS_WARE_TECH231" exact="1" />
						<ware typename="SS_WARE_TECH241" exact="1" />
						<ware typename="SS_WARE_TECH242" exact="1" />
						<ware typename="SS_WARE_TECH275" exact="1" />
						<ware typename="SS_WARE_TECH276" exact="1" />
						<ware typename="SS_WARE_TECH277" exact="1" />
						<ware typename="SS_WARE_WARPING" exact="1" />
						<!-- Shields -->
* * * * * * * * * <ware typename="SS_SHIELD_D" exact="{this.maxshieldcount}" />
						<!-- Upgrades -->
* * * * * * * * * <ware typename="SS_WARE_TECH213" exact="{player.ship.equipment.SS_WARE_TECH213.maxcount}" />
* * * * * * * * * <ware typename="SS_WARE_TECH246" exact="{player.ship.equipment.SS_WARE_TECH246.maxcount}" />
* * * * * * * * * <ware typename="SS_WARE_TECH251" exact="{player.ship.equipment.SS_WARE_TECH251.maxcount}" />
					</equipment>
					<cargo>
						<!-- Cargo -->
						<ware typename="SS_WARE_ENERGY" exact="2000" />
						<ware typename="SS_WARE_FREIGHTDRONE" exact="150" />
						<ware typename="SS_WARE_JUMPBEACON" exact="1000" />
						<!-- Marines -->
* * * * * * * * * <ware typename="SS_WARE_SOLDIER_1" exact="{this.marines.maxcount}" />
					</cargo>
				</ship>
			</property>
		</reward_player>
	</do_when>
. . .
Last edited by Createse on Thu, 20. Mar 14, 23:13, edited 1 time in total.

Guest

Post by Guest » Mon, 3. Mar 14, 14:27

{object.maxshieldcount@object} ... Maximum number of shields that can be installed on the specified object (same as current number for stations)
{object.maxshieldtype@object} ... Ware type of maximum shield that can be installed on the specified object

... i don´t know if U can use these variables while creating a ship but U can use them if the specific object exists !!
// so i would use these variables after U´ve created the ships & checked if they exist
=> the only thing you may change is the green marked "object" !!

---------------------------------------------------------------------------------------------------

{this.marines.maxcount} ... this variable doesn´t exist !!
{player.ship.equipment.TYPE} ... this variable doesn´t exist !!

EDIT:
Createse wrote:According to this they do. The latter is even done in a vanilla Starts.xml file.
... cant see anything (but a schema-file which says me nothing :D) // using "noscript"
Last edited by Guest on Mon, 3. Mar 14, 14:53, edited 3 times in total.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Mon, 3. Mar 14, 14:48

JonfersonSDD wrote:{this.marines.maxcount} ... this variable doesn´t exist !!
{player.ship.equipment.TYPE} ... this variable doesn´t exist !!
According to this they do. The latter is done in a vanilla Starts.xml file too.

Also, if we're to use 'whatever@object' why can Egosoft use 'player.ship.<whatever>'?
I see no '@object' in their example: 'player.ship.equipment.type.maxcount'
The definitions list has it down as 'object.equpment.type.maxcount@object' which is inline with what you said. 'player.ship' is down as a predefined variable though.

Going back to the proper syntax, can I use @object in the literal sense? or @this? So I don't have to give every object a name.

Guest

Post by Guest » Mon, 3. Mar 14, 15:01

... the only thing i can say is: (i´m not an IT-specialist)
--> if it doesn´t function as you think, use them as described in .xsd ;)

object.equpiment.SS_WARE_blabla.maxcount@{player.ship} ... or something like that ^^
// if you R trying to make a custom gamestart, create a separate <cue> which checks the id of your gamestart (& cancels itselves on failure)

"this" is (as far as i know) the cue name in which it is
Last edited by Guest on Mon, 3. Mar 14, 15:06, edited 1 time in total.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Mon, 3. Mar 14, 15:06

JonfersonSDD wrote:if you R trying to make a custom gamestart, create a separate <cue> which checks the id of your gamestart (& cancels itselves on failure)
Why?

Guest

Post by Guest » Mon, 3. Mar 14, 15:09

Createse wrote:Why?
... you could write a mini-plot in the same cue afterwards :P (if U want)

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Mon, 3. Mar 14, 15:11

Neat, nice idea. Perhaps another time though, when I'm more experienced. I've already got my eyes on those .obj files!

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Mon, 3. Mar 14, 18:23

Code: Select all

 <ship typename="SS_SH_GO_MSY" name="aran">
The name you have given the ship is the object name that you can reference for all the variables, it should be a little more specific in the name as 'aran' is a little general and could get reused somewhere causing complications.

Code: Select all

<ware typename="SS_WARE_TECH213" exact="{this.equipment.SS_WARE_TECH213.maxcount}" /> 
Variables need to follow the format laid out in director.htm - the bold text is the 'fixed' condition, the normal is what needs to be specific to your object, type etc...

So, {object.equipment.type.maxcount@object}

in the above example would be:

<ware typename="SS_WARE_TECH213" exact="{object.equipment.SS_WARE_TECH213.maxcount@aran}" />

Would add the max number of engine tunings that the Aran can have.

Createse wrote:Also, if we're to use 'whatever@object' why can Egosoft use 'player.ship.<whatever>'?
I see no '@object' in their example: 'player.ship.equipment.type.maxcount'
The definitions list has it down as 'object.equpment.type.maxcount@object' which is inline with what you said. 'player.ship' is down as a predefined variable though.
There is a whole section of player specific variables...
Createse wrote:Going back to the proper syntax, can I use @object in the literal sense? or @this? So I don't have to give every object a name.
Apart from player.ship, which is always the ship the player is currently flying, any object that you wish to reference with a variable needs a unique name, whether it's defined when created, or via <find_ship/station/object/gate/etc...>

PDF versions of the director.htm files can be found here -> Dillpickle's X3TC Downloads, bookmarked for easy usage...

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Mon, 3. Mar 14, 19:03

dillpickle wrote:The name you have given the ship is the object name that you can reference for all the variables, it should be a little more specific in the name as 'aran' is a little general and could get reused somewhere causing complications.
Are the names global or are you referring to generic inheritance?
Can I reuse object names like temporary variables, and possibly make them undefined afterwards?

Code: Select all

<create_ship type="SS_SH_X_M3P" name="Ship" />
<do_all>. . .do something with Ship. . .</do_all>
<create_ship type="SS_SH_X_M2P" name="Ship" />
<do_all>. . .do something with new Ship. . .</do_all>
dillpickle wrote:<ware typename="SS_WARE_TECH213" exact="{object.equipment.SS_WARE_TECH213.maxcount@aran}" />

Would add the max number of engine tunings that the Aran can have.
This doesn't seem to work from inside the <create_ship> or <ship> elements. I don't know why, perhaps it's similar to the "Delayed Expansion" clause in Batch.
dillpickle wrote:PDF versions of the director.htm files can be found here -> Dillpickle's X3TC Downloads, bookmarked for easy usage...
Thanks, although I've already got my local copies handy. Ctrl+F FTW!

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Mon, 3. Mar 14, 19:39

Createse wrote: Are the names global or are you referring to generic inheritance?
Can I reuse object names like temporary variables, and possibly make them undefined afterwards?

Code: Select all

<create_ship type="SS_SH_X_M3P" name="Ship" />
<do_all>. . .do something with Ship. . .</do_all>
<create_ship type="SS_SH_X_M2P" name="Ship" />
<do_all>. . .do something with new Ship. . .</do_all>
This will cause problems as you now have two ships with the same name - these will be global variables.

If someone else were to release a mod with, for example:

Code: Select all

<destroy_object object="Ship" explosion="1"/>
Then one of your ships would be destroyed, which one just depends on which one the game engine guesses is the correct 'Ship' at the time...

Local variables can be created within a cue, by using 'this.':

Code: Select all

<cue name="CreateShip_1">
  <action>
    <create_ship name="this.Ship" typename="SS_SH_A_M3"/>
  </action>
</cue>

<cue name="CreateShip_2">
  <action>
    <create_ship name="this.Ship" typename="SS_SH_A_M3"/>
  </action>
</cue>
These two ships would be seen as two individual ships, can be referenced within their own cue as this.Ship, and in other cues by replacing 'this' with the cue name -> CreateShip_1.Ship and CreateShip_2.Ship

Objects can removed from tracking with

Code: Select all

<remove_object object=""/>
Which will remove the object from MD tracking and you could then reuse the name, just make sure you're not going to want to reference it again in the future...

Take a look at Ketraar's [Video Tutorial] Mission Director Basics

Which has some good information on object naming and global/local differences/uses.

Also Mission Director Basics and Installation It's from Reunion, but a lot of the information in the support files that can be downloaded there, has some useful stuff that is still relevant.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Mon, 3. Mar 14, 21:12

Excellent post! Thank you - very enlightening.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Wed, 5. Mar 14, 16:51

An update: Using 'this.ship' doesn't seem to work in this instance. On the first ship (the Aran) it doesn't work at all and on the second ship (the Ozias) only the Rudder and Engine upgrades aren't calculated/do not work. Is it because 'this' is cue specific only?

Code: Select all

<do_when value="{player.gamestart}" exact="1">
	<set_value name="Albion Prelude Link Plot" exact="1" />
	<reward_player>
		. . .
		<property>
			<ship typename="SS_SH_GO_MSY" name="this.ship">
				<equipment>
					<!-- Equipment -->
					<ware typename="SS_WARE_BEAMING" exact="1" />
					<ware typename="SS_WARE_BESTBUY" exact="1" />
					<ware typename="SS_WARE_BESTSELL" exact="1" />
					<ware typename="SS_WARE_BIOSCANNER" exact="1" />
					<ware typename="SS_WARE_BOOST" exact="1" />
					<ware typename="SS_WARE_LIFESUPPORT" exact="1" />
					<ware typename="SS_WARE_ORECOLLECTOR" exact="1" />
					<ware typename="SS_WARE_SCANNER2" exact="1" />
					<ware typename="SS_WARE_SCANNER3" exact="1" />
					<ware typename="SS_WARE_SPACEFLYCOLLECTOR" exact="1" />
					<ware typename="SS_WARE_SW_CARRIER_1" exact="1" />
					<ware typename="SS_WARE_SW_EXPLORE_1" exact="1" />
					<ware typename="SS_WARE_SW_FIGHT_1" exact="1" />
					<ware typename="SS_WARE_SW_FIGHT_2" exact="1" />
					<ware typename="SS_WARE_SW_NAV_1" exact="1" />
					<ware typename="SS_WARE_SW_NEW2" exact="1" />
					<ware typename="SS_WARE_SW_NEW3" exact="1" />
					<ware typename="SS_WARE_SW_NEW13" exact="1" />
					<ware typename="SS_WARE_SW_PATROL_1" exact="1" />
					<ware typename="SS_WARE_SW_SPECIAL_1" exact="1" />
					<ware typename="SS_WARE_SW_SUPPLY_1" exact="1" />
					<ware typename="SS_WARE_SW_TRADE_1" exact="1" />
					<ware typename="SS_WARE_SW_TRADE_2" exact="1" />
					<ware typename="SS_WARE_TECH231" exact="1" />
					<ware typename="SS_WARE_TECH241" exact="1" />
					<ware typename="SS_WARE_TECH242" exact="1" />
					<ware typename="SS_WARE_TECH275" exact="1" />
					<ware typename="SS_WARE_TECH276" exact="1" />
					<ware typename="SS_WARE_TECH277" exact="1" />
					<ware typename="SS_WARE_WARPING" exact="1" />
					<!-- Shields -->
					<ware typename="SS_SHIELD_F" exact="{object.maxshieldcount@this.ship}" />
					<!-- Upgrades -->
					<ware typename="SS_WARE_TECH213" exact="{object.equipment.SS_WARE_TECH213.maxcount@this.ship}" />
					<ware typename="SS_WARE_TECH246" exact="{object.equipment.SS_WARE_TECH246.maxcount@this.ship}" />
					<ware typename="SS_WARE_TECH251" exact="{object.equipment.SS_WARE_TECH251.maxcount@this.ship}" />
				</equipment>
				<cargo>
					<!-- Cargo -->
					<ware typename="SS_WARE_ENERGY" exact="2000" />
					<ware typename="SS_WARE_FREIGHTDRONE" exact="150" />
					<ware typename="SS_WARE_JUMPBEACON" exact="1000" />
					<!-- Marines -->
					<ware typename="SS_WARE_SOLDIER_1" exact="{object.marines.maxcount@this.ship}" />
				</cargo>
			</ship>
			<ship typename="SS_SH_GO_TL" dockobject="{object@this.ship}" homebase="{object@this.ship}" name="this.ship">
				<equipment>
					<!-- Equipment -->
					<ware typename="SS_WARE_BEAMING" exact="1" />
					<ware typename="SS_WARE_BESTBUY" exact="1" />
					<ware typename="SS_WARE_BESTSELL" exact="1" />
					<ware typename="SS_WARE_BIOSCANNER" exact="1" />
					<ware typename="SS_WARE_BOOST" exact="1" />
					<ware typename="SS_WARE_LIFESUPPORT" exact="1" />
					<ware typename="SS_WARE_ORECOLLECTOR" exact="1" />
					<ware typename="SS_WARE_SCANNER2" exact="1" />
					<ware typename="SS_WARE_SCANNER3" exact="1" />
					<ware typename="SS_WARE_SPACEFLYCOLLECTOR" exact="1" />
					<ware typename="SS_WARE_SW_CARRIER_1" exact="1" />
					<ware typename="SS_WARE_SW_EXPLORE_1" exact="1" />
					<ware typename="SS_WARE_SW_FIGHT_1" exact="1" />
					<ware typename="SS_WARE_SW_FIGHT_2" exact="1" />
					<ware typename="SS_WARE_SW_NAV_1" exact="1" />
					<ware typename="SS_WARE_SW_NEW2" exact="1" />
					<ware typename="SS_WARE_SW_NEW3" exact="1" />
					<ware typename="SS_WARE_SW_NEW13" exact="1" />
					<ware typename="SS_WARE_SW_PATROL_1" exact="1" />
					<ware typename="SS_WARE_SW_SPECIAL_1" exact="1" />
					<ware typename="SS_WARE_SW_SUPPLY_1" exact="1" />
					<ware typename="SS_WARE_SW_TRADE_1" exact="1" />
					<ware typename="SS_WARE_SW_TRADE_2" exact="1" />
					<ware typename="SS_WARE_TECH231" exact="1" />
					<ware typename="SS_WARE_TECH241" exact="1" />
					<ware typename="SS_WARE_TECH242" exact="1" />
					<ware typename="SS_WARE_TECH275" exact="1" />
					<ware typename="SS_WARE_TECH276" exact="1" />
					<ware typename="SS_WARE_TECH277" exact="1" />
					<ware typename="SS_WARE_WARPING" exact="1" />
					<!-- Shields -->
					<ware typename="SS_SHIELD_D" exact="{object.maxshieldcount@this.ship}" />
					<!-- Upgrades -->
					<ware typename="SS_WARE_TECH213" exact="{object.equipment.SS_WARE_TECH213.maxcount@this.ship}" />
					<ware typename="SS_WARE_TECH246" exact="{object.equipment.SS_WARE_TECH246.maxcount@this.ship}" />
					<ware typename="SS_WARE_TECH251" exact="{object.equipment.SS_WARE_TECH251.maxcount@this.ship}" />
				</equipment>
				<cargo>
					<!-- Cargo -->
					<ware typename="SS_WARE_ENERGY" exact="2000" />
					<ware typename="SS_WARE_FREIGHTDRONE" exact="150" />
					<ware typename="SS_WARE_JUMPBEACON" exact="1000" />
					<!-- Marines -->
					<ware typename="SS_WARE_SOLDIER_1" exact="{object.marines.maxcount@this.ship}" />
				</cargo>
			</ship>
		</property>
	</reward_player>
</do_when>

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Wed, 5. Mar 14, 17:28

It is cue specific in the way that having two or more objects named this.ship within the same cue is going to cause problems. The game engine has to guess which one of the two (or more) identically named objects you're referring to... this.Ship1 and this.Ship2 or this.Aran and this.Ozias should work.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Wed, 5. Mar 14, 17:40

I tried 'this.Aran' and 'this.Ozias' and it didn't work, for either ship: Temporary upload of related files

P.S. I appreciate you helping me through this btw.
Last edited by Createse on Wed, 5. Mar 14, 18:09, edited 1 time in total.

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Wed, 5. Mar 14, 18:05

Createse wrote:P.S. I appreciate you helping me through this btw.
Can't help anymore at present, as have no facility to unpack .pck, until I get home Friday... xml I can look at OK.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Wed, 5. Mar 14, 18:11

dillpickle wrote:Can't help anymore at present, as have no facility to unpack .pck, until I get home Friday... xml I can look at OK.
Re-download, they're uncompressed for you now. If you've no means to play-test however, then the XML posted previously should be enough to work with I would've thought, unless of course it isn't in which case the download probably won't help much either :D.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Fri, 7. Mar 14, 14:57

I've determined it's not a syntax issue by outputting the calculated values to a message log. None the wiser as to why it's not populating the two ships with the dynamic values though.

{object.maxshieldcount@this.Aran} (for example) will be populated with the correct value but for some reason isn't used or is ignored (value = 0) when I try to equip this.Aran in Start.xml.
Last edited by Createse on Thu, 20. Mar 14, 19:57, edited 1 time in total.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Thu, 20. Mar 14, 19:56

Has anyone encounter this before?

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Thu, 20. Mar 14, 21:47

It may be that it adds all the wares etc... to the ship and then assigns the object name, which is why it can't find the 'object' - but that's only a guess.

If you take the cargo/equipment that relies on '@object' out of the actual ship creation part and put them after the reward_player, thus:

Code: Select all

</reward_player>
<add_cargo object ="this.Aran">
  <!-- Marines -->
  <ware typename="SS_WARE_SOLDIER_1" exact="{object.marines.maxcount@this.Aran}" comment="Mercenary" />
</add_cargo>
<add_equipment object="this.Aran">
  <!-- Shields -->
  <ware typename="SS_SHIELD_F" exact="{object.maxshieldcount@this.Aran}" comment="2 GJ Shield" />
  <!-- Upgrades -->
  <ware typename="SS_WARE_TECH213" exact="{object.equipment.SS_WARE_TECH213.maxcount@this.Aran}" comment="Engine Tunings" />
  <ware typename="SS_WARE_TECH246" exact="{object.equipment.SS_WARE_TECH246.maxcount@this.Aran}" comment="Rudder Optomisation" />
  <ware typename="SS_WARE_TECH251" exact="{object.equipment.SS_WARE_TECH251.maxcount@this.Aran}" comment="Cargo Bay Extension" />
</add_equipment>
<add_cargo object ="this.Ozias">
  <!-- Marines -->
  <ware typename="SS_WARE_SOLDIER_1" exact="{object.marines.maxcount@this.Ozias}" comment="Mercenary" />
</add_cargo>
<add_equipment object="this.Ozias">
  <!-- Shields -->
  <ware typename="SS_SHIELD_D" exact="{object.maxshieldcount@this.Ozias}" comment="200 MJ Shield" />
  <!-- Upgrades -->
  <ware typename="SS_WARE_TECH213" exact="{object.equipment.SS_WARE_TECH213.maxcount@this.Ozias}" comment="Engine Tunings" />
  <ware typename="SS_WARE_TECH246" exact="{object.equipment.SS_WARE_TECH246.maxcount@this.Ozias}" comment="Rudder Optomisation" />
  <ware typename="SS_WARE_TECH251" exact="{object.equipment.SS_WARE_TECH251.maxcount@this.Ozias}" comment="Cargo Bay Extension" />
</add_equipment>
Then shields/engine tunings/etc... get added to your ships.

User avatar
Createse
Posts: 58
Joined: Fri, 20. Mar 09, 23:28
x4

Post by Createse » Thu, 20. Mar 14, 21:56

dillpickle wrote:It may be that it adds all the wares etc... to the ship and then assigns the object name, which is why it can't find the 'object' - but that's only a guess.
Perhaps it does the ship creation (tag to tag) in a single pass like Batch/Bash scripts do, or something similar. Point is, the object obviously doesn't exist at that stage, which is what you or JonfersonSDD said previously - or something.
dillpickle wrote:If you take the cargo/equipment that relies on '@object' out of the actual ship creation part and put them after the reward_player
Haha! That's exactly what I just did after having a short discussion with Bullwinkle. It works as intended. I'll need to use a different variable for marines though, {object.marines.maxcount@object} doesn't work.

Post Reply

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