[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

ladyboy
Posts: 69
Joined: Fri, 14. Sep 07, 19:18

Post by ladyboy »

can anybody tell me if it's possible to just rename existing wares? (and the method)
instead of creating new ones.

I've checked out the tutorials on creating wares but i can't get custom wares to work. - sorry if the info is already in this thread.. i've gone through a lot of the pages but.. there's a lot. :D
All those moments will be lost.. in time, like tears.. in rain.
[ external image ]
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

I'm having trouble retasking Xenon ships, i.e. starting a different script on Xenon ships after they have spawned via jobs.

It seems that retasking a Xenon ship causes jobs to see it as dead and respawn it. My script then retasks the newly spawned Xenon ship, so jobs spawns another, etc. This results in non-stop respawns of Xenon ships, which is obviously bad.

I've tried with and without changing the homebase/homesector, and using 'interrupt task' instead of START. Doesn't seem to help.

Surely someone has come across this issue before? Any hints?
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.
jlehtone
Posts: 22541
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

@ladyboy: The names of wares are in text files. However, use of custom wares may still be a better alternative. Look at the EMP mod, if you haven't already.


@ThisIsHarsh: Why not an edit of TJobs to make the Xenon run the right script all along?
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

Gazz wrote:Like jlehtone said, missile objects do not exist OOS, therefore you can not intercept them.
When fired, they hit instanteous at any range.

However, missiles do not automatically hit. I don't know the responsible variables but a missile fired OOS hits... sometimes.

It's black magic just like the OOS laser fire results.
i havn't looked at the code for awhile, but i think its simply a random value to weather it hits or not
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

jlehtone wrote:@ThisIsHarsh: Why not an edit of TJobs to make the Xenon run the right script all along?
I really want to avoid the murky world of mods and their incompatibilities. Besides, there *has* to be an easier way, I don't like giving up on things so easily...
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.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

ThisIsHarsh wrote:
jlehtone wrote:@ThisIsHarsh: Why not an edit of TJobs to make the Xenon run the right script all along?
I really want to avoid the murky world of mods and their incompatibilities. Besides, there *has* to be an easier way, I don't like giving up on things so easily...
u need to turn race logic off if u want to use a different scripts, otherwise the jobs engine will will either kill it or restart its original task

jsut set the race logic to false on the ship and it should just follow your script instead. As it still has a job id it should still remain in the jobs list quota
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

Hah! You remember what happend the last time the Xenon got "just a patch"?

There's never enough time to do it right but always time to fight an interstellar war...
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.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Cycrow wrote:
ThisIsHarsh wrote:
jlehtone wrote:@ThisIsHarsh: Why not an edit of TJobs to make the Xenon run the right script all along?
I really want to avoid the murky world of mods and their incompatibilities. Besides, there *has* to be an easier way, I don't like giving up on things so easily...
u need to turn race logic off if u want to use a different scripts, otherwise the jobs engine will will either kill it or restart its original task

jsut set the race logic to false on the ship and it should just follow your script instead. As it still has a job id it should still remain in the jobs list quota
Aha! Nice one, thanks a lot for that!
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.
ladyboy
Posts: 69
Joined: Fri, 14. Sep 07, 19:18

Post by ladyboy »

jlehtone wrote:@ladyboy: The names of wares are in text files. However, use of custom wares may still be a better alternative. Look at the EMP mod, if you haven't already.

I'm having trouble finding the text files jlehtone is refering to. Can anybody point me in the right direction?

Edit: Found it.
All those moments will be lost.. in time, like tears.. in rain.
[ external image ]
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

How do you remove a preload script from a command?
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Litcube wrote:How do you remove a preload script from a command?
The only way I found is to overwrite it with your own preload script. I had to do this when overwriting a stock script that had a preload.
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.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

But I did overwrite it with my own; the wrong one. That's the problem.
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

So overwrite it again with a dummy script that does nothing. =)
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 »

Technically, the dummy script will have to return true.
jlehtone
Posts: 22541
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

When is the preload script assigned to command? Once and stored in savegame, or during every load?


(Anecdote: MS had a program called "Word". It had predefined shortcut keys. US version did use Ctrl-Alt-2 for "set header style". On non-US keyboard, that keycode was expected to generate '@'. Semi-useful character. So, every media around had "tip": how to bind "insert special symbol @" to Ctrl-Alt-2. User shortcut did override the default shortcut.

Except that it was generally sluggish. One could have simply undefined the default keybinding, and thus got the raw '@'. :roll:)
Raumkraut93
Posts: 1368
Joined: Wed, 18. Mar 09, 22:20
x3tc

Post by Raumkraut93 »

Hi,

I've a few questions to the TJobs...

1) How can I set, that Ships of the Argon Federation spawn in all Sectors that belong to PLAYER ?

OR

2) When there are factories of the argon federation in my sector, will that Factories automatically generate Freighters or must I set it, when yes how?

3) When I create new Xenon Sectors, are there automatically Xenon spawns or have i to adjust it first (how?)

Thank you a lot in advance

mfg
"Dies ist alles, was ich über den Krieg weiss: Einer gewinnt, einer verliert
und nichts ist nachher so
wie es vorher war."

"Stellt eure Truppen auf, oh große Generäle,
Der Preis des Sieges übersteigt den Preis der Niederlage."
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

3. Some ships spawn in any xenon sector. Others are set with specific sectors.
i.e. Job 2001-2003 Are xenon and non sector specific (where 2003 is the m6/m7 raiding parties that fly out). The rest seem to be tied to specific sectors.
If you wanted other stuff as well, you would need to create more jobs tied to your sector (or just all xenon sectors)


2. Use the Has owners stations flags (X3 editor 2 can edit the jobs for you), and owner is Argon. Although I'm fairly certain that the only options for ship spawns is, in gate, in shipyard, or in space. So either in your config script, or the top of the job script, use a move to environment, and move it to a station.


1. Spawning dynamically in player sectors is not so easy. You could set it to spawn in all non-enemy sectors thou.
Although if you felt the overwhelming urge to make them spawn in JUST player sectors, you could do the same trick mentioned in 2 with the job/config script, moving them to the right sector.




Btw, did anyone else notice the 2003 job has Repair beam ticked? (Although, that is really just the "special weapons" bit mask, so it could be tractors/others. I don't suppose anyone has encountered repair beams on those xenon raiders?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

jlehtone wrote:When is the preload script assigned to command? Once and stored in savegame, or during every load?
Once and stored in savegame, which makes thing totally bunk if you accidentaly use the wrong preload. Using a fake script isn't an elegant solution, really. If your regular keymap script requires arguments, that fake script has to be designed in such a way so as to work with it.

I have a feeling this was accidentally overlooked during developement.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

just return an empty array in the dummy preload and the command should run normally
ladyboy
Posts: 69
Joined: Fri, 14. Sep 07, 19:18

Post by ladyboy »

I'm using a script to count how many of a particular ware is in the cargo bay and printing it to the message log.

I'm using "$ship [this]" It works but it's only checks the cargo in 1 ship.

is it possible to make it check the cargo bay of all ships belonging to the player?
All those moments will be lost.. in time, like tears.. in rain.
[ external image ]

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