[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
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

'get ship array' might work.

To loop through the universe you can use 'get max sectors in x direction, 'get max sectors in y direction', and a couple of while/dec loops with 'get sector from universe index' (and checking it exists, of course).
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

Is there an easy way to get the number of docking slots for all stations (for LittleShips, for BigShips & for HugeShips)?

I can't find the data in the T files, and I'm not sure what 'get dock bay size' is returning.
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Don't mean to be repetitive, but no-one answered my post on the previous page, think it got drowned out by the sudden flood of other posts!

Is there a way to modify the Highlight bars and the text colours ingame as working on a complete conversion of the HUD to a different colour looks odd with out of sync font and highlight colours.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Carlo the Curious wrote:Is there an easy way to get the number of docking slots for all stations (for LittleShips, for BigShips & for HugeShips)?

I can't find the data in the T files, and I'm not sure what 'get dock bay size' is returning.
I can't be much help, except to say that 'get dock bay size' returns the total amount of docking slots, external and internal for all ship classes. I don't think there are any script commands to find the number of docking slots of different types. As for t-files, no idea I'm afraid.
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
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked »

If by "internal docking" you mean the "fighter bay". Afaik it's unlimited and there's no way to know if one is here or not through script (sadly) only. Well you could still stock what station dock what in an array, but it wouldn't be mod friendly.

Using the "is docking allowed/possible" commands may help in determining what kind of docking clamps are available. But yeah, it's unpractical.
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

Bah. Thanks anyway.
ShotGlockMF
Posts: 40
Joined: Fri, 27. Aug 10, 14:29
x3tc

Post by ShotGlockMF »

I played around with CockPitCallback mod, and when i hid the HUD the front of the ship showed up. I don't want the cockpit, i just want the front of the ship to show up. When i uninstall the mod, i lose everything.

Are there any mods that just show the front of the ship, or is there an option somewhere to just show the front of the ship with the mod or the standalone game? Thanks.
jlehtone
Posts: 22572
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

As I hinted in your (now merged) thread, you are probably looking for moving the position of the cockpit camera. Cockpit and each turret do have their own camera positions (set somewhere in the model of the ship, I presume).

There have been such mods, or at least users claiming having done so in their own games. Camera position tends to be a "personal preference", so there might not be any "published" ones -- cannot recall for sure.

With luck, [url=http://forum.egosoft.com/viewtopic.php?t=216693]TC Tutorials[/url] might have hints now that you have couple more keywords to look with.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

@Carlo and docking
Unfortunately, I do not think there is, and the script editor has a... disconnect between it's can-dock script(s) and whether or not it can actually dock.
From my limited experience, is docking possible just checks if there are any clamps, that could possibly support a ship of that size (irrespective of whether or not they are full). (e.g. Which means there could be no space on the station for a TS, but it would still return true)
(I think at least... - I do tend to imagine these things some times...)
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Does anyone know a way to get the amount of jumpdrive resupply in terms of Energy Cells, rather than in terms of jumps? I mean, not the fuel required but the max quantity.
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
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

There is this command:

<RetVar/IF> <RefObj> -> get resupply fuel required
(v 2.1? addition? make sure your ex scriptor is up to date if its not there)



If you need to do more complex things, you can do:
$SingleJumpEnergy = $ship> needed jump drive energy for jump to sector $ship.sector
(ususally i just do $single = [THIS]-> needed jumpdrive... to [SECTOR]) and stick that in a separate lib script)
$jumps = $ship -> get jumpdrive fuel resupply


$total = $jumps * $SingleJumpEnergy
Get Jump driver energy usage to [SECTOR] gives you the required for a single sector jump, then you can just multiply the numbers.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

I have the 'get resupply fuel required', but that only works if fuel is required, and I need to know the resupply quantity in ecells regardless of whether it is required or not.

Your second solution is just what I was after, however. I wasn't sure if just multiplying the cost of a single jump would work out. Cheers 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.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Does anyone know the exact way that debris is placed on asteroid death?

I know it's part of the engine, but is it set what size, rottation and position debris will be for each asteroid? If not, then I can't replicate that. Is there any other way I can kill and asteroid which will yeild the debris?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Can you not destroy asteroid with the S.E?

However, their position/rotation is someone... funky.. in that if you target it with the script editor, it will not quite target the debris it self, but instead target the previous centre point of one of the original asteroid (I don't know which one thou...)

But from all my testing, destroying with the s.e does not seem to have the same affect (the debris visually remains there, but in every other sense it is not) and results in FAR lower yield then if I manually destroy the rocks (i.e. continuously ramming the rocks with my M7, produced about 200+ Nvidium from a 2-3 yield asteroid, where as trying to use a script to destroy them for me resulted in a lot less)

I may have imagined it (as I have never been able to find the post since) but I think back in the days of x3r/x2, someone worked out exactly which each type of debris subtype spawns on it's death. (It was link to a different site, as I remember it being in a table). But I do tend to imagine these things... some times...
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

All SE commands I use cause it to run the break into debris animation, then it disappears.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren »

I may have imagined it (as I have never been able to find the post since) but I think back in the days of x3r/x2, someone worked out exactly which each type of debris subtype spawns on it's death. (It was link to a different site, as I remember it being in a table). But I do tend to imagine these things... some times...
Don't worry, your not going 'Gah Gah', i remember that too. Was all layed out in a table with, if you break this asteroid type you get between x and y amount of debris, if you break that you get between a and b amount of collectable rock etc. Along with explanations on how they got the data.

No idea now were i found it, it was a while ago though.

MarCon
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

If someone found it I'd be very grateful... :P
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
Gyver162
Posts: 17
Joined: Tue, 7. Jul 09, 14:19
x3tc

Post by Gyver162 »

Hello, i have a simple question.
How to write a script that will inform me about destroyed ship (for example in log book)? Is there any way to recognize destroyed ship in script? (there must be ;] )
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Well what are the chances of that!

I'm working on my military plugin at the moment and I'm currently coding a script which notifies the player of losses! :)

It's quite simple, but requires the use of signals.

First you need to add a secondary 'Signal: Killed' to ships.

Then the script that runs, just check if it's player or not, and if it is just make your basic text line 'Your ship (ship) was killed in (sector)'

You can even make it as complex as you like, saying what killed it etc.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
Gyver162
Posts: 17
Joined: Tue, 7. Jul 09, 14:19
x3tc

Post by Gyver162 »

Two questions:
First: why this line is running twice script x when I destroyed a ship.

Code: Select all

global secondary signal map: add signal={SIGNAL_KILLED} race={Player} class={Ship} script='x' prio=1000 name='x'
And second:

Code: Select all

$ship.dist.1 = find ship: sector=$sector class or type={Ship} race={Player} flags=null refobj=[THIS] maxdist=2000 maxnum=null refpos=null
What this command is returning out? Array or a single ship?

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