[Discussion] Generic X3TC S&M questions I

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

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

Post by Cycrow » Tue, 1. Dec 09, 13:09

im not sure the reason there isn't a hit signal, i can only guess that it would create too much of an overhead trying to run a script everytime a ship gets hit.

only really way to do this, would be to have a watch script that checks the shield and hull levels of the ship, if they decrease you can assume a hit.

it wont be all that accurate, but its the best you can do

KNT79
Posts: 80
Joined: Thu, 10. Sep 09, 19:14

Post by KNT79 » Tue, 1. Dec 09, 18:14

Well, I plan to write some combat software after all the ships I am porting to X3TC are finished. I want them to watch for friendly fire particularly. I have had an idea to implement this "in hardware" - to install the target designation laser that fires just before the main gun to check for the friendly obstacles. The hit callback would be ideal for this. But there is no such thing. The signal_attacked obviously won't work.

I had an idea of watching for the hull level (one needs the "mass driver" type laser for this), the shields regenerate and thus spoil the measurements. If the laser shot and hull check are done in the same atomic operation this would work, not as efficient as hit callback but still good enough I think. But I think also that there is the problem of synchronization here. For this to work one needs the laser with "infinite" bullet velocity. If I understand this correctly, once fired the bullet is controlled by the engine and is not synchronized with scripts. So it is not gauranteed that the bullet have hit something (or have passed away) at the moment of the hull level check. I think one can find workarounds here too but then it becomes so complicated that it seems to me the "software" solution (check all ships/stations in the area and do some calculations) gets an advantage.

These speculations are not rigorous and may be incorrect, so if you have any comments, ideas...
NOT PEACE BUT A SWORD

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

Post by Gazz » Tue, 1. Dec 09, 20:29

Well, what friendly fire situations are you looking at?
With the classic PPC at maybe 2 km you're facing a 6 second lead and a quite large volume of space filled with ships that might be traveling towards intercepting your bullets.

I've tinkered with such ideas before but found no workable solution.

Maybe if your test laser was a PSG / flamer design and covered a cone of space?

Another thought would be to make it a repair laser. That is shield piercing as well and hull going up is a rather more unusual event.

I doubt that it would be an atomic operation, though. You'll end up doing a ton of guesswork on who's hitting who, especially with a few M2 in the fray spraying bullets in every direction.
And if you make it a super fast laser you might run into trouble with it skipping cleanly through ships without colliding.
(a common PBE "bug" from Reunion at low FPS)
Maybe a beam laser...

But then again, if you do use a super fast laser, it would have the wrong lead and be completely useless for a PPC FF forecast except for extremely short ranges - where FF is not much of an issue to begin with.
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.

KNT79
Posts: 80
Joined: Thu, 10. Sep 09, 19:14

Post by KNT79 » Wed, 2. Dec 09, 10:25

Yes, I was about to make the engine to do the work for me. It would be an atomic operation if one has the "raycasting" weapon with immediate return containing collision information. Now I see there is no such thing. Workarounds are too complex and unreliable, so I have to take some more CPU power to do it with old good math :)

I am new to this game. How do the beam weapons work? Is it possible to have the "skipping cleanly through ships without colliding" bug with the beam weapon?
NOT PEACE BUT A SWORD

pelador
Posts: 1399
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by pelador » Sat, 5. Dec 09, 17:25

Ideally we need a hit trigger event to mark for each bullet so the owner etc can be tracked for each hit encounter, but again this would likley be degrading to performace to track these events and utilise them in scripts.

Maybe when technology catches up developers ideal conceptions future games will allow for more realism of this type. Though to be honest without the baseline information from ES I'm unsure how performance impacting it would be as they have to do something in the engine on bullet hits anyway to encompass the damage events etc.

(I imagine also such features may only at present be applicable to IS encounters as opposed to OOS?)

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sun, 6. Dec 09, 09:47

Anyone know how I can destroy station wrecks in a sector?

I've tried the "find debris" command, using the station type as the ware, but it doesn't find the wrecks.

Any ideas?
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 » Wed, 16. Dec 09, 14:53

I have some questions relating to the Unfocussed jumpdrive (UJD).

is there a way to make the playership jump using UJD using scripting?
is there a way to make the playership return to the known universe?
anyway to detect if the player is in the known universe?

I wrote a jumping script that works fine in the known universe (it finds your fleet and jumps to them) but if you're outside the known universe it fails to jump.

Any help would be great :)
All those moments will be lost.. in time, like tears.. in rain.
[ external image ]

Rodion Karimov
Posts: 55
Joined: Fri, 6. Mar 09, 12:35
x3tc

Post by Rodion Karimov » Tue, 29. Dec 09, 19:44

Hello.
Is there ability to somehow reduce the speed of notority and rankings gaining?

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

Post by ScRaT_GER » Sat, 2. Jan 10, 22:50

@ladyboy

I think you cannot make the playership jump using the UJD. Maybe you can check whether the player is in the known universe by using some of the object commands (e.g. "is detectable" or "is discovered"), but I didn't try. If I were you, I'd check some commands and see if I can use their return values somehow.

@ThisIsHarsh

It isn't possible to detect wrecks via SE or MD.

@Rodion Karimov

You'd have to edit some of the MD files, most likely some library file.
But I don't know which.

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

I have a question concerning the script command "get object name array".
It returns quite a strange array of the following structure:

ARRAY(PAGE_ID, TEXT_ID, 0, 0, 0, 0, ..., 0, PAGE_ID, TEXT_ID, 0, 0, ..., 0)

The first PAGE_ID & TEXT_ID don't have a corresponding entry in the t-files. The second PAGE_ID & TEXT_ID actually points to the objects original name (like #deca.deff).

While I have to accept that this command seemingly does not simply divide the ships name into its sub-parts (e.g. "CAG Argon Prime" into ARRAY(CAG, Argon, Prime) ), I don't understand what the first PAGE_ID & TEXT_ID and all the nulls stand for.

Does anybody have a clue?

Greetings,
ScRaT

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

Post by Gazz » Sun, 3. Jan 10, 00:50

Rodion Karimov wrote:Is there ability to somehow reduce the speed of notority and rankings gaining?
Sure.
The easiest way is to take an off-the-shelf AL Plugin template and have the script check all your notorieties every few minutes.
If the gain during that time is faster than whatever you defined, then the notoriety is reduced to your intended max gain.

That can be tagged on and requires no changes to MD files and besides, the hardcoded gains (like trading) cannot be edited directly so this is the only way that always works.
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.

Silverileon
Posts: 1
Joined: Wed, 6. Jan 10, 10:46
x3tc

Post by Silverileon » Wed, 6. Jan 10, 11:11

So I downloaded the Script Editor program and installed it. I performed the search of my drive to find the directory and it came up with nothing. Any way to fix this problem? As it is now, I am unable to use any of the script editor functions or the ship builder or any of it. I am not up on all the programmer savvy stuff, so some help would be greatly appreciated so I can get down to playing around with my X3TC in a whole new way.

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

Post by Carlo the Curious » Wed, 6. Jan 10, 12:38

Silverileon wrote:So I downloaded the Script Editor program and installed it. I performed the search of my drive to find the directory and it came up with nothing. Any way to fix this problem?
Asking in the thread for whatever program you downloaded would be a start.

[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].

pelomar
Posts: 7
Joined: Tue, 4. Mar 08, 09:39

Post by pelomar » Wed, 6. Jan 10, 19:59

Hi everyone,

a really quick question : is it possible to install an english mod/script on a non-english version ?

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV » Thu, 7. Jan 10, 21:26

a quicker answer, yes

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

Post by ScRaT_GER » Fri, 8. Jan 10, 19:37

The Exscriptor (external SE by Whimsy) lists a signal called SIGNAL_COLLISIONWARN, which is not listed in the ingame SE.

A script created externally using that signal is displayed correctly in the internal SE.

However the signal does not seem to work. Does anybody know more about this signal?

Greetings,
ScRaT

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

Post by Cycrow » Fri, 8. Jan 10, 20:12

the signal was never implemented.

it was available in Reunion, but was removed completly in TC

it doesn't work in Reunion however, its only visible

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

Post by ScRaT_GER » Fri, 8. Jan 10, 21:19

Thanks, good to know.

So I guess the collision avoidance routines are completely hardcoded and cannot be changed?

BTW: Since you have the insigth, maybe you could say, if "get object name array" is really supposed to work as described here. It seems a bit odd.

Greetings,
ScRaT

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

Post by Cycrow » Sat, 9. Jan 10, 00:39

the collision avoidance is built into the movement commands, which cant be adjusted by scripts.

as for the get object name array, it simply returns the array that the game engine uses for speech.

have u tryed putting that array directly into the speak text array command ?

doing it for a ship should speak the exact name of the ship, this includes and race, or job title, etc

as for the 0's, this could be a result of the speech generation, or act as a gap, im not really sure

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

Post by ScRaT_GER » Sat, 9. Jan 10, 10:00

have u tryed putting that array directly into the speak text array command ?
Yes, all the nulls are omitted. I also tested what happened, when I created an array containing only the necessary information and it sounded exactly the same, which leads to the question why they are there in the first place.

And the command is not working on every object. For example, running the command with an equipment dock as reference object returns a null.

Is the array, which this command returns, by any chance accesible (and changable) via some local variable? This would be really cool for a custom name script I am working on, because I wouldn't need the MD to start my script.

Greetings,
ScRaT

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

Post by s9ilent » Sun, 10. Jan 10, 21:13

Just a quick question
Have commands changed between v2.1-> 2.5? As I've noticed that my SFM scripts, have quite a few ships with Command.Unknown showing and I'm not entirely sure why? (And I had not noticed it in 2.1 but I know that I've made a few changes since then)

-resolved Did not my own install script properly....-
Last edited by s9ilent on Wed, 13. Jan 10, 21:30, edited 1 time in total.

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