[Discussion] Generic X3TC S&M questions I

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

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

A scene is nothing but a collection of body files and you can access the body file directly.
Yes Gazz but i want to look at the scene, i already found the bodies =P

Thx someone else
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

@ThisIsHarsh

Thanks for the explanations!
Good news that secondary ressources have an effect.
Of course more detailed info would be appreciated. :)

So, these are the questions left:

1. How do secondary ressources speed up the production process?

2. Does anybody know how exactly the cycle time is calculated? I know it has something to do with the RelValue, but nothing more specific.

3. In the X3 Editor by doubleshadow you can set a factories subtype to SG_FAC_STORAGE. I didn't notice a change to the normal SG_FAC_TECH - is there any?

4. In the Exscriptor (and in the MD) you can choose an object class called "Scrapyard". It does not appear in the SE and there seems to be no station of the class "Scrapyard". Is there a way to create one, and if so, how?

Greets,
ScRaT
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

I want to create a new Dockingdummy that only allows M5 to dock -
a normal fighter extern dock looks like this:

Code: Select all

ships\props\extern_M4_dock;ANIMATEDF_DOCKPORT_FIGHTER|ANIMATEDF_DOCKPORTDF_FDWPUSH;0
how can i change that it can only dock M5?
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
Aydan
Posts: 238
Joined: Sat, 8. Sep 07, 20:56

Post by Aydan »

What i always wonder about is the stat/value "Launch delay" in the TBullets file (name taken from the X3 editor). It's obviously tied to the bullet charge feature, but does it have any other impact? I haven't found any informations by searching the forum and the net.
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

By now I found a few answers to my above questions.

1. Secondary ressources do speed up the production process. Looking at products which are produced quickly, it seems as if it would diminish the production time by ~20%.

2. I still don't know the exact formula, but the production time is closely connected to the RelVal. However the number of products produced per cycle has to be considered. Of course two products take twice as much time.

I'd be glad, if someone answered the remaining questions. :)

When testing a bit with shipyards, I noticed that if you turn shipyards into a factory, which has the ships as products of course, the number of products (in this case ships) in the shipyards cargo, is always 10.
It does not display the true values, which can be read by script though.

Does anybody know why?

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

Post by Cycrow »

i dont know the exact formula used, but i do know that its based soley on the relval of the product.

the number of products and resources needed are based on the relval of the resources that are added.

each resource type has a coefficent, ie tech wares relval is used differently to a mineral ware, etc

so slight changes to relval in the resources can considerably alter the number of products per cycle
Virenex
Posts: 2
Joined: Sun, 2. Aug 09, 18:09

Post by Virenex »

hi i just downloaded the scrip to create derelict ships. i installed it fine and it shows up in my script editor in-game but i cannot execute the file. this is my first time trying to use a script and i would like some help in doing so. thxx
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Q:

$flyware = create flying ware: maintype=$main subtype=$sub count=$ware.amt sector=[SECTOR] x=$x y=$y z=$z selfdestruct=0

What does the selfdestruct argument do?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

That's the lifetime I'd say.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

Gazz wrote:That's the lifetime I'd say.
not quite, its actually just a switch.

0 being disabled, then any other number will activate the self destruct timer.

this will destroy the object after a random time, which is between 15 and 45 minutes
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Ahh cool thanks, ok and now for another question

[Find.Expand]
What does it do? it seems to be used in the find.gate commands, but I'm unsure of what it does... I'm trying to use the find.gate to do a quick -is this sector jumpable (find.jumpable) but the stock scripts use this flag too, so I thought I would as well.. but its giving false positives.

Does find.expand|find.jumpable do something like... does this gate eventually link to a gate that fulfils the other criteria?

The exact flags I'm using are:
017 $flags = [Find.Nearest] | [Find.Expand] | [Find.JumpableGate]
018 skip if not [OWNER] == Player
019 |$flags = $flags | [Find.Known]

*edit* I've since taken out find.nearest (as I didn't actually need it..). Also the false positives could be caused by multiple reasons, but this one seemed like the most likely
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

the find gate command will search for gates in the current sector, as its a sector search routine.

the expand flags expands this search into the universe, this only works along side Find.Nearest.

basically, if you just use find.nearest, u get the nearest gate in the sector if there is one.

if you use it, it will expand out sector by sector until it finds the nearest viable gate to you
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Q: When a ship is killed, is it still running its original task 0 task?

e.g. I want to replace the signal signal.killed, but I want it to only run on ships running my scripts. So is using the following statement valid? Or does the task 0 get stopped prior to signal.killed being run?

Code: Select all

if [THIS] is script 'myscript' on stack of scripts on task 0
   do stuff stuff
else
   call script !ship.signal.killed (the stock ego soft one)
end
return null
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

s9ilent wrote:Q: When a ship is killed, is it still running its original task 0 task?

e.g. I want to replace the signal signal.killed, but I want it to only run on ships running my scripts. So is using the following statement valid? Or does the task 0 get stopped prior to signal.killed being run?

Code: Select all

if [THIS] is script 'myscript' on stack of scripts on task 0
   do stuff stuff
else
   call script !ship.signal.killed (the stock ego soft one)
end
return null
Two ideal ways.

You could set the signal individually for each ship. E.g. at the top of 'myscript'' connect the signal via "[THIS]->connect ship command/signal", or preferably "[THIS]->add secondary signal".

Second way is to make it global, but have myscript set a local variable on the ship to flag it should use the alternative signal, e.g.

Code: Select all

if [THIS]->get local variable: name='mysigkilled.enabled'
   do stuff stuff
else
   call script !ship.signal.killed (the stock ego soft one)
end
Again, use of a secondary signal is preferred, then the stock script will still be run after yours.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I'm hoping to specifically overwrite the stock script, as I want to replace the on death message. (I want to do lots of other stuff, but they could easily be done on a sec signal)

The use of a global variable is not recommended either, as it will not pick up the issue that the script may not be running (as it could've been terminated)

Q: Which once again leads to the original question, is the ships original task 0 still running, when the signal.killed is fired?




Also, on a similar note
Q: The signal.killed arguments, what do they do?
killer, the killer, obvious
cmd, the command, obvious
cmd targ1, the command target, obvious
cmd targ 2, the cmd target 2, obvious
cmd par1 ????
cmd par2 ????

Given that the signal uses this line:

Code: Select all

  START $newleader->command $cmd : arg1=$cmdtarget, arg2=$cmdtarget2, arg3=$cmdpar1, arg4=$cmdpar2
I can only assume.. they are command arguments... but on the other hand, par ~ partner?




Another question...
Q: ... Where/ how to I over write the stock logbook message on ship death.. I thought it was in the signal.killed.. but its not
aka1nas
Posts: 1414
Joined: Thu, 7. Jul 05, 05:17
x4

Post by aka1nas »

Is it possible for UI/HUD mods to change the size of the menus? They get pretty small on larger resolutions like 1920x1200 and having lists scale downwards vertically more would mean a lot less clicking around.

If so, where would I need to look at to get at these properties?
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

s9ilent wrote:I'm hoping to specifically overwrite the stock script, as I want to replace the on death message. (I want to do lots of other stuff, but they could easily be done on a sec signal)

The use of a global variable is not recommended either, as it will not pick up the issue that the script may not be running (as it could've been terminated)

Q: Which once again leads to the original question, is the ships original task 0 still running, when the signal.killed is fired?
no its not still running, as the signal script also runs on task 0, so it'll overright it
s9ilent wrote:Also, on a similar note
Q: The signal.killed arguments, what do they do?
killer, the killer, obvious
cmd, the command, obvious
cmd targ1, the command target, obvious
cmd targ 2, the cmd target 2, obvious
cmd par1 ????
cmd par2 ????

Given that the signal uses this line:

Code: Select all

  START $newleader->command $cmd : arg1=$cmdtarget, arg2=$cmdtarget2, arg3=$cmdpar1, arg4=$cmdpar2
I can only assume.. they are command arguments... but on the other hand, par ~ partner?
those 4 are just the arguments of the command.
targ1 and targ2 is usually defined as the 2 targets, par1 and par2 stand for parameter 1 and 2.

its just additional arguments for your command
s9ilent wrote:Another question...
Q: ... Where/ how to I over write the stock logbook message on ship death.. I thought it was in the signal.killed.. but its not
this is hardcoded when the ship is killed, so you cant remove it, only add your own on top
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

Cycrow wrote:this is hardcoded when the ship is killed, so you cant remove it, only add your own on top
If the secondary signal fires first and your secondary signal includes

set owner race: neutral race,

the hardcoded signal should not write a log message because it isn't your ship any more? =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Hmmm... this comes as a mixed blessing :):(:S<3</3

@ Gazz, Thanks for the tip :)

@ Cycrow. But I thought that signals where interrupts, so shouldn't the higher priority signal.killed script just be on the top of the stack, but the main script still there (just not being run at the time due to its 0 priority)?
:S



I don't suppose someone could explain to me how priorities work?


*Edit* Just to clarify what I said earlier, when I said ".. is it still running.." I mean to say, is it still on the stack of scripts on task 0
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

They are interrupt scripts. Cycrow was just being very literal because the former task 0 script isn't "running" while interrupted. =)

Priorities only rule who can interrupt who.

A Pri 99 interrupt cannot interrupt a Pri 150 script. It merely bounces.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

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