[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

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

Post by Litcube »

Lordaeron wrote:Is there any way to disable the respawning of Asteroids?
Globally, no.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Aro wrote:Does anyone know what script handles the missile barrage command?
!ship.cmd.missile.attack.std.pck
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

Is there any way to disable the respawning of Asteroids?
I'm not sure, but I think Gazz mentioned once, that you could disable the respawning of asteroids using the command <RefObj> -> disable ship rebuild.

Greetings,
ScRaT
Guest

Post by Guest »

you would probably have to make a new init. or setup. scrip to make the command script connect this specific command to this specific ship once it is done. if this script is unsighned you should probably ask permission first.
Guest

Post by Guest »

(if your using x3editor) well if you times the number entered in the price box with the offset of that box it gives you the price of the ware, same with the adjustment price too i think. as for the player rel value, that is the amount of noteriety you need in order to buy that ware from AI stations. not sure about the other value you mentioned though.
Guest

Post by Guest »

I'm not sure, but I think Gazz mentioned once, that you could disable the respawning of asteroids using the command <RefObj> -> disable ship rebuild.
so if you make a script made to find all asteroids in the game and added this bit in that would do it. i made one already if you want it.
Guest

Post by Guest »

Is there a hard limit on the fire rate of turrets? I tried equipping MD into some turrets, but it seems to fire far more slowly than the weapon's max fire rate (1/2 - 1/3?).

Can capital ship weapons be forced to use charged shots? Would the turrets still be locked in place while charging? This would let them get more speed etc. while keeping it very hard to hit small targets.


The turret command scripts add pauses and waits. For a number of reasons.
dont suppose there is any script trick to return the refire rate of guns is there?
Glimpse
Posts: 141
Joined: Thu, 29. Apr 10, 14:05
x4

Post by Glimpse »

Fire rate of the guns are stored in the either TLaser.txt or TBullets.txt.
dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle »

1. I was creating a custom menu, and everything was going fine with everything being read from the text file OK. For some reason I am now just getting readtext occurring, as though it isn't loading / recognising the text file.
If someone could shed some light on to what the cause is and how to solve it I would be grateful.


2. I know that it is possible to run a script from the Mission Director, but is it possible to run a mission director file from a script? Ultimately what I'm trying to achieve is a menu that would run different MD files depending on the choices selected. Any ideas?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

sergoba wrote:dont suppose there is any script trick to return the refire rate of guns is there?
There is no such script command.
You can do workarounds, such as checking if the fire instruction returns true after a wait of X ms.
MARS slowly adjusts the wait to best match the in-game performance - which is not the same as going by the value in TLasers.

You definitely need to alter the turret script to make this happen in any shape or form.
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.
ADStryker
Posts: 152
Joined: Mon, 22. Jun 09, 02:04
x3tc

Post by ADStryker »

I'm having a similar problem as dillpickle.

I modified a plugin menu script to read text from a text file, like so ...

Code: Select all

$text = sprintf: pageid=$pageid textid=28, null, null, null, null, null
add custom menu item to array $config.menu: text=$text returnvalue=95
 
$text = read text: page=$pageid id=29
add custom menu item to array $config.menu: text=$text returnvalue=96
... instead of specifying the menu text directly in the script. However, now most of the menu items show up as "ReadText17-0". A few seem to partially work as intended. I'm using the same text file for other scripts in the same plugin and it seems to work fine for other output, just not the menu items. I'm even using read text to populate equipment arrays with items like "{Best Buys Locator}" and that seems to work fine.

Any ideas as to what the problem is?

(edit...)

Figured out part of the problem. When using "read text" one evidently needs to precede "(" and ")" with a "\" character. This solved some blank lines that were showing up, but not the "ReadText17-0" errors.

What else could be going on here?

Also, is there a list or tutorial on formatting read text files?

(edit 2...)

Got it. The "ReadText17-0" errors were occuring, evidently, because using "read text" to get the wares from a text file caused the data type to be incorrect (may have read the wares in as a string type instead of a ware type). So, when I subsequently called ...

Code: Select all

    $ware.id = get text id: ware=$ware
    $ware.desc = read text: page=17 id=$ware.id
... I got null for $ware.id and "ReadText17-0" for $ware.desc.
Last edited by ADStryker on Sun, 20. Jun 10, 05:52, edited 1 time in total.
PSCO1 Cockpits | lowpolyroids-2.04 | Satellite Early Warning Network | Station Camper | Universal Best Buys/Sells | Invasion Warnings | ResizedAldrinBigRock | Equipment R&D | Lowpoly Complex Tubes | Mobile Ship Repairs | Player Workshop | Marauder Shipyard
Guest

Post by Guest »

You can do workarounds, such as checking if the fire instruction returns true after a wait of X ms.
i had never thought of that. with a few more sums for gametime a very flexible gunscript can be made.
andrewoproiu9
Posts: 85
Joined: Sat, 24. Apr 10, 03:16
x3tc

a few questions from a beginner

Post by andrewoproiu9 »

so before i go crazy with the mods. a few questions, I have!

will adding one or more mods effect the fps for my game??

do mods work well together?, im sure they do, just making sure

how do i enable my script editor for the mods to actually be enabled. sorry guys, i understand scripts, but from a very very amateur perspective. or just point me in the direction that gives me the algorithm

thank you, in advance!
User avatar
Cadvan
Posts: 2951
Joined: Sun, 14. Mar 04, 05:05
x4

Post by Cadvan »

1. maybe, maybe not. It depends on the script, wahte they have to do and how well they are writen. But most of scripts wich are after beta-phase shouldn't affect your fps much.

2. depends on what you are using. sometimes side effects couldn't be foreseen, sometimes its not possible to prevent - and others are simply unable to run together.

3. to activate your script editor you only needs to change your player name to Thereshallbewings. after this unsigned scripts will get loaded.
Some scripts provides files wich will set your game automaticly modified, so you don't have to activate script editopr to use unsigned scripts.

and:
Mods ands scripts are different. i think you asked about scripts, not mods.
andrewoproiu9
Posts: 85
Joined: Sat, 24. Apr 10, 03:16
x3tc

Post by andrewoproiu9 »

youre correction is correct, lol. scripts were the basis of my questions, and thank you very much for the detailed explanation. I am building my own library of faq. lol this one will be a keeper!
jlehtone
Posts: 22574
Joined: Sat, 23. Apr 05, 21:42
x4

Re: a few questions from a beginner

Post by jlehtone »

andrewoproiu9 wrote:so before i go crazy with the mods. a few questions, I have!
It is recommended to start by reading the [url=http://forum.egosoft.com/viewtopic.php?t=216696][b]T[/b][b]C[/b] [b]S[/b]&M Posting [b]R[/b]ules[/url], the [url=http://forum.egosoft.com/viewtopic.php?t=216690]TC Download Library[/url], the [url=http://forum.egosoft.com/viewtopic.php?t=216693]TC Tutorials[/url], and so forth first.

Thread merged.
User avatar
kalu
Posts: 73
Joined: Tue, 22. Sep 09, 16:58

Post by kalu »

Hi all,

I'm currently coding a Mod-Merger using Java.

I want to extract all files out of .cat/.dat-pairs. How are these files compressed?

I already realized, that .pck can be decompressed via GZip-classes.

But what about the catalogs?

I hope anybody can help me.

Kalu
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

sergoba wrote:i had never thought of that. with a few more sums for gametime a very flexible gunscript can be made.
Don't put too much weight on theory there.
Theoretical values can be a guideline but are very unhelpful when applied to time-sensitive issues in a script. There is no small scale timing in X3. Such a thing simply does not exist.

The values that MARS ends up with are completely experimental. The script uses trial and error so it gets a "value that works".
This includes the time shares required for all scripts that the player uses and the current FPS.

If any of these variables change, the script slowly adapts.

Also a bonus: since it's completely self-configurating there is no need to worry about modded lasers. =)
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.
jlehtone
Posts: 22574
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

kalu wrote:I want to extract all files out of .cat/.dat-pairs. How are these files compressed?

I already realized, that .pck can be decompressed via GZip-classes.

But what about the catalogs?
You should ask from doubleshadow or Cycrow, because both of them have written tools that deal with those files.
User avatar
kalu
Posts: 73
Joined: Tue, 22. Sep 09, 16:58

Post by kalu »

I'm already talking about that topic with doubleshadow now, thanks for the tip!

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