[SCRIPTING] How to create debris ?

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

Post Reply
User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

[SCRIPTING] How to create debris ?

Post by Joubarbe » Wed, 25. Feb 15, 10:39

Hey,

I'd like to create station and ship debris, but I cannot find them in X-Studio. In President's End, I can see both of them though (LU).

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 25. Feb 15, 12:19

create special...

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Wed, 25. Feb 15, 12:34

Oh yes I knew that one, with TSpecial.pck...

Thanks !
(that's the problem with programming... As soon as I leave a language, I forget most of it in two months)

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Thu, 19. Mar 15, 16:16

And how to remove them ? :)

I cannot find any command to catch them.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 19. Mar 15, 16:43

afaik the only way to get them in a var in X3 is with the return Value of create special. not sure if LU added some posibilities there. (in X2 there is the workaround with the Sectorobjects, but it works only IS and these commands are not available in X3 anymore)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Thu, 19. Mar 15, 17:00

Yeah I had hope with this :

Code: Select all

$allCollObj = $sector -> get collision objects

for each $obj in array $allCollObj
  $obj -> destroy object: killer=$Value, show no explosion=0
end
But it doesn't work :(

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 19. Mar 15, 22:02

in LU, the "get collision objects" command returns a list of ships that a ship is actively trying to avoid as its "colliding" with them, as far as i know we never added the ability to "find special", for some reason i have a vague memory of a conversation Litucbe and i had about it but i dont remember the outcome.

Like UniTrader said, if you store the return value of create special you can manipulate it that way, just create an array or table and attach it to the sector, and add all specials you create to that array or table within that sector specific local variable.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Thu, 19. Mar 15, 23:35

These specials are really weird... They cannot be rotated, for instance.

Anyway, what I'd like to do is to remove all the default billboards in the game, that's why I was asking this question...

Oh, by the way :

Code: Select all

$myTable = table alloc
$myTable2 = table alloc
table set $myTable ( 'one' ) = 1
table set $myTable ( 'two' ) = 2
table set $myTable2 ('string') = 'string'
dim $myArray = $myTable, $myTable2
$myVal = $myArray[0]
$myVal15746 = $myArray[1]
$myVal2 = table get $myVal ( 'one' )
$myVal3 = table get $myVal ('two')
$myVal4 = table get $myVal15746 ('string')

write to player logbook $myVal2
write to player logbook $myVal3
write to player logbook $myVal4
* output : 1, 2, string
That's powerful ! Better than arrays of arrays of arrays of arrays to "emulate" structures. So thanks for that again Jack :)

EDIT : Well... Considering that your "tables" are not "maps", it's better to do a table of tables, instead of mixing arrays and tables :

Code: Select all

$allStations = table alloc

* HQ
$station = table alloc
table set $station ('id') = 0
table set $station ('type') = {Argon Headquarters}
table set $allStations (0) = $station
* Military Outpost
$station = table alloc
table set $station ('id') = 1
table set $station ('type') = {Argon Military Outpost}
table set $allStations (1) = $station

$stationTable = table get $allStations ($stationID)
$stationType = table get $stationTable ('type')

$station = create station: type=$stationType owner=$owner addto=$sector x=$x y=$y z=$z

Post Reply

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