[Discussion] Generic X3TC S&M questions II

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

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

Post by dillpickle »

apricotslice wrote:I'm just wondering why I've never been able to get a new md file to run.
I had this problem to start with, and it was because (I think) I had the top level cue set as a Library, when I removed the Library setting, it ran fine.

The way I understand it, is that Libraries only run when they are called by another file, so all the plot mission (libraries) are called by the 3.02 Plot Missions.xml, generic missions by 3.01 Generic Missions.xml etc..

If your MD file is set as a library, you need something to call that library.

Of course there is a possibility that I'm may off the mark (wouldn't be the first time!) with my understanding of this, and it's something entirely different that is causing your problem...
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice »

Can you quote the bit of code that defines it as a library ?
dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle »

apricotslice wrote:Can you quote the bit of code that defines it as a library ?
This is from the very top of the Terran Plot, Scene 1.

Code: Select all

<cues>
  <cue name="L2M001" library="1">
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice »

Would library = 0 turn it off ?
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12187
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

apricotslice wrote:So does that mean that to add a new md file, you need to add it into mdfiles.txt for it to run ?
MD Files in cats only get loaded if they are mentioned in mdfiles.txt. Files "lying around" in extracted form are always loaded, given your game is modified.
apricotslice wrote:Would library = 0 turn it off ?
0 is default, so if its not a library, cues will run as any other cue.
An yes, Libarries need to be called. To call a library use <cue ref=mylibrary>

MFG

Ketraar
Image
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

MD Files in cats only get loaded if they are mentioned in mdfiles.txt.
Thanks for that info - goot to know!

Greetings,
ScRaT
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Q: What is the best way to get a unique reference to a particular object?

I thought there was like a get unique ID command (But I don't think there is)
I'm using it for my x3 internet thingy, so I need a unique reference to each ship. Is there a better way other then creating a 2xn array for all objects in the universe? (i.e. number, stations ships debris etc.)
lp
Posts: 16
Joined: Tue, 24. Feb 09, 09:12
x4

weapon range

Post by lp »

I've modded the tbullet to increase range of weapons , let's say the PSP has 20 km range but the turret auto aim keep consider that a target at 10 km is out of range is there anything else to modify? :?
lp
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

s9ilent wrote:Q: What is the best way to get a unique reference to a particular object?

I thought there was like a get unique ID command (But I don't think there is)
I'm using it for my x3 internet thingy, so I need a unique reference to each ship. Is there a better way other then creating a 2xn array for all objects in the universe? (i.e. number, stations ships debris etc.)
There indeed a unique ID command: General Commands -> "<RetVar> = <RefObj> -> get ID code" (near the top of the list). Of course this only works on ships and stations.

There is also the: Audio Commands -> "<RetVar> = <RefObj> -> serialise object". Rather weird place to put such a command. I think that command will work with anything and get a unique reference (except I suppose wares onboard a ship). Not tried it though.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Re: weapon range

Post by ThisIsHarsh »

lp wrote:I've modded the tbullet to increase range of weapons , let's say the PSP has 20 km range but the turret auto aim keep consider that a target at 10 km is out of range is there anything else to modify? :?
Hmm, maybe the ship is outside of scanner range?

I just checked the !turret.killenemies.std.main script and it does indeed use the "is $victim in firing range of turret $turretid", so it's not, as I suspected, a script issue.

Maybe there is a hardcoded maximum range of 10km?
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
lp
Posts: 16
Joined: Tue, 24. Feb 09, 09:12
x4

Re: weapon range

Post by lp »

Maybe there is a hardcoded maximum range of 10km?
This means no way to use my Imperial Executor Super Star Destroyer :( it is so big that enemies are often out of range.
lp
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: weapon range

Post by LV »

lp wrote: it is so big that enemies are often out of range.
I have the same problem with women

maybe someone should look in the script (if there is one) for the turrets on the earth torus which has an insector insta kill, of course it may just cheat and in addition my ISD should not be abused and overpowered in such a fashion.
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

iirc, the torus does have its own set of fight scripts.
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

I have a question concerning the stack execution after a "fly to station" command.

Let's say I have the following scripts:

Code: Select all

* pluing.fly.to.station
= [THIS] -> fly to station $someStation
return null

Code: Select all

* plugin.call.script
= [THIS] -> call script 'plugin.fly.to.station: station=$someStation
write to player logbook 'test'
When I now run the script "plugin.call.script" and the ship docks successfully, "test" is never written into the logbook, even though it clearly should be written after "plugin.fly.to.station" was executed.

Is this behaviour correct and wanted or is it a bug?

Greetings,
ScRaT
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

is this the players ships, or another ship ?
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

Thanks for the quick response! A short test showed, that it's only the playship.
Still, it would be nice if all scripts executed correctly, but as long as it's only the playership it's no big deal.

Greetings,
ScRaT
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

its not possible for the playership, as when you dock, the engine terminates the running script, this is to allow things like the trading system and such to work.

there are workarounds thou, if you need something done after docked, running on a seperate task to check would work, as would using the docked signal
Lyth
Posts: 2355
Joined: Mon, 21. Jan 08, 03:48
x4

Post by Lyth »

Checked everywhere in the tutorials (I believe) and can't find any station data breakdowns.

I'm going to create some new stations that use existing wares and models but don't know what all the data represents, anyone able to help or can point me in the direction of some good info?
Take it easy, If you can't - Take it by force.
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

its not possible for the playership, as when you dock, the engine terminates the running script, this is to allow things like the trading system and such to work.
Yeah, that's what I thought.
I'm going to create some new stations that use existing wares and models but don't know what all the data represents, anyone able to help or can point me in the direction of some good info?
Creating new stations is quite an easy task. Just use the X3 Editor 2 by doubleshadow and open the TFactories.txt.
The rest should be self-explanatory.

Greetings,
ScRaT
Last edited by ScRaT_GER on Sat, 1. May 10, 19:23, edited 1 time in total.
Lyth
Posts: 2355
Joined: Mon, 21. Jan 08, 03:48
x4

Post by Lyth »

I wouldn't have posted if this for example was self explanatory.

1;0;0;0;0;SG_FAC_TECH;16111;116;-1.200000;-3;200;stations\others\marine_training_station_scene;33;8;37;38;2000;2;ICON_TRG_ST_CRYSTAL;15000;48200;25;20;5;10000;1000;0;0;SS_FAC_SOLDIER_1;

I was just hoping their was atleast some examples out their I could base my calcs on, identifying which variables are for time/resource/output is all I need.
Take it easy, If you can't - Take it by force.

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