[Discussion] Generic X3TC S&M questions I
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 275
- Joined: Fri, 6. Feb 04, 20:16
Firstly, apologies for posting this here but the Community Script & Mod Download Library for X3: Terran Conflict is locked.
If anyone has the time would it be possible to add a section in the "Community Download List" area called Huds so that more exposure could be placed on some of the excellent work that has gone into this area.
If anyone has the time would it be possible to add a section in the "Community Download List" area called Huds so that more exposure could be placed on some of the excellent work that has gone into this area.
"As I slide down the banister of life;
my job is just another splinter in the bum"
my job is just another splinter in the bum"
-
- Moderator (Script&Mod)
- Posts: 22259
- Joined: Sun, 14. Nov 04, 23:26
Most of those marines commands are used for ships, and dont work the same way for stations.TheEarl wrote:hi !
i tried to clear a marines training center (hope thats the english name) of its marines to spawn new troopers.
i tried it with:
as result i have 71 "unknown objects" in the station instead of 71 marines.Code: Select all
Script aaaa.test Version: 0 for Script Engine Version: 44 Description Description Arguments 1: station1 , Var/Ship/Station , 'station' Source Text 001 $marines = $station1 -> get marines array 002 $marines.size = size of array $marines 003 004 while not $marines.size == 0 005 |$marine = $marines[0] 006 |= $marine -> destroy passenger 007 |remove element from array $marines at index 0 008 |$marines.size = size of array $marines 009 end 010 011 display subtitle text: text='alle tot' duration=500 ms 012 return null
i triedwith the same result.Code: Select all
destruct: show no explosion
then i moved them into a spawned TP and destroyed it, same result.
i wondered why the "unknown objects" are in the station and discovered another feature:
if you move marines withyou see them in the inventory of the TP and in the station (same names) and there still 71 left in the station. then i destroyed the TP manually in space and after this the named marines, that was in station and in TP are now "unknown objects" inside the station.Code: Select all
= $marine -> move passenger to ship $ship: set passenger as pilot=[FALSE]
and not to forget, the destroy commands work well on marines, if i buy them manually into an TP (or other ship) and destroy them inside one of my ships. they dont convert to an "unknonwn object".
now the 2 questions:
1) can i clearly remove them from game when they are in training center ?
2) is there a way to move (or buy) them by script from a station into a ship ? (for another reason i need some of them alive )
thx for help !Code: Select all
the move passenger command will have weird results if the passenger is not currently in a ship.
a simple way to remove the marines, would be to use the add ware command.
Code: Select all
$amt = $station -> get amount of ware Marine
$amt = - $amt
= $station -> add $amt units of Marine
-
- Posts: 183
- Joined: Thu, 22. Jan 09, 23:03
That may be correct for the X3 script language, but in general -1 is the same as all bits set in a variable. Signed or otherwise.ScRaT_GER wrote:A boolean TRUE value would be 1 and not -1.
And still, this does not explain, why the signal fires when a ship is bought by the shipyard, although it only should fire, when the shipyard sells a ship.
What do you get when you buy more ships at once?
TCAN TC/AP Artificial Life, Menudriven Automated Ship/Station Namer
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
No, only when signed. There is no unsigned -1. </smartass>Orfevs wrote:That may be correct for the X3 script language, but in general -1 is the same as all bits set in a variable. Signed or otherwise.
In X3 scripts, logical TRUE is defined as (not null).
That's why abominations like "if find ship..." (which returns null or a ship object) work just fine. =)
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 183
- Joined: Thu, 22. Jan 09, 23:03
You kill me.Gazz wrote:No, only when signed. There is no unsigned -1. </smartass>Orfevs wrote:That may be correct for the X3 script language, but in general -1 is the same as all bits set in a variable. Signed or otherwise.
In X3 scripts, logical TRUE is defined as (not null).
That's why abominations like "if find ship..." (which returns null or a ship object) work just fine. =)
TCAN TC/AP Artificial Life, Menudriven Automated Ship/Station Namer
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.
-
- Posts: 352
- Joined: Fri, 3. Aug 07, 17:27
@Cycrow
thank you for this good and short solution.
@all, including Cycrow
when i use this for creating new marines, i think they have random skills ?
another interesting point is, of which race are they, does it depend on the stations owner race ?
(if nobody knows, i will test this soon, i had no time so far)
Is it possible to load a selected (by script) marine into a ship in a clean way (without having him on ship and station at the same time) ?
if this is not possible, i have another idee for my script, that does not include automatically buying marines from station. so its not a big problem.
thank you !
thank you for this good and short solution.
@all, including Cycrow
when i use this for creating new marines, i think they have random skills ?
another interesting point is, of which race are they, does it depend on the stations owner race ?
(if nobody knows, i will test this soon, i had no time so far)
Is it possible to load a selected (by script) marine into a ship in a clean way (without having him on ship and station at the same time) ?
if this is not possible, i have another idee for my script, that does not include automatically buying marines from station. so its not a big problem.
thank you !
-
- Moderator (Script&Mod)
- Posts: 22259
- Joined: Sun, 14. Nov 04, 23:26
yes when you add a marine using the add ware command, they will get random stats, and usually will be of the same race as the station its added to, unless its a pirate station, then it'll be a random race.
when you say a clean way, what do you mean exactly ?
to create a marine yourself, you first create a passenger, then use the convert command to convert the passenger to a marine.
marines are basically just passengers with additional stats, adding the fighting skill to a passenger turns them into a marine
when you say a clean way, what do you mean exactly ?
to create a marine yourself, you first create a passenger, then use the convert command to convert the passenger to a marine.
marines are basically just passengers with additional stats, adding the fighting skill to a passenger turns them into a marine
-
- Posts: 352
- Joined: Fri, 3. Aug 07, 17:27
Hi !
As you told before, the move of passenger does only work from ship to ship correctly and not from a station. i tested it and theres a marin in the ship and in the station. if i detroy the ship, the marine inside the station becomes an unknown object. a clean way means, that the marine should only exist on the ship after i moved it out of the station. i hope you understand my english.
greetings
TheEarl
p.s.
perhaps as a workaround i put all marines into an array with all stats and their names. then remove all from station as you told me and create new passengers first with the same name and race like before, train them to marine and give them back the stats. and create this marine, that i wanted to move into a ship on this ship. if nothing else helps.
As you told before, the move of passenger does only work from ship to ship correctly and not from a station. i tested it and theres a marin in the ship and in the station. if i detroy the ship, the marine inside the station becomes an unknown object. a clean way means, that the marine should only exist on the ship after i moved it out of the station. i hope you understand my english.
greetings
TheEarl
p.s.
perhaps as a workaround i put all marines into an array with all stats and their names. then remove all from station as you told me and create new passengers first with the same name and race like before, train them to marine and give them back the stats. and create this marine, that i wanted to move into a ship on this ship. if nothing else helps.
-
- Posts: 691
- Joined: Mon, 27. Aug 07, 12:34
Hey, could anyone point me to a tutorial/reference concerning how multiple scripts on the same object (i.e. a ship) work? I am thinking about some insight into interrupt, script priorities etc.
I want to adjust some of the behaviour of ships in X3TC and I want to know what happens when I interrupt a script, whether I can run multiple scripts at once on one object etc.
I want to adjust some of the behaviour of ships in X3TC and I want to know what happens when I interrupt a script, whether I can run multiple scripts at once on one object etc.
-
- Posts: 16
- Joined: Mon, 7. Jul 08, 03:24
Didn't want to start a whole new thread on the matter, so here seems like a good place to ask-is there any way to affect how much ammo a weapon uses? For example-setting the Gauss Cannon to use 20 units of ammunition instead of 1?
VVV Thanks
VVV Thanks
Last edited by Northern Comfort on Fri, 26. Feb 10, 17:01, edited 1 time in total.
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
No.
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 113
- Joined: Thu, 28. Jun 07, 14:10
-
- Posts: 113
- Joined: Thu, 28. Jun 07, 14:10
-
- Sith Lord
- Posts: 8255
- Joined: Wed, 6. Nov 02, 20:31
as i'm not a trade geek
how the hell do I return an array of stations buying my defined ware at average price, I only ever get 1 returned
i tried exclude array=[FALSE] before someone says try that
Code: Select all
030 |$buyer = find station: resource $ware with best price: min.price=$average, amount=$anul, max.jumps=100, startsector=$sec, trader=$tug, exclude array=[TRUE]
i tried exclude array=[FALSE] before someone says try that
LV's TC Scripts
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
-
- Posts: 2255
- Joined: Mon, 31. Oct 05, 08:44
Ship class from ware type
Is it possible to get a ship class from it's ware type code?
I have an array which stores a ships details and resource required to build it, to get the values I used
$type = $ship->get ware type code of object
$rel.Val = get relvalue of $type
This is all fine and I can create a ship from the values stored, however if I try and pull class type from the ware code for information purposes it shows null. I take as it's not been created as an object $ship.class = $type->get object class won't work.
So my question is, can you pull a ship class from a ship ware type? If so how?
Thanks
LA
I have an array which stores a ships details and resource required to build it, to get the values I used
$type = $ship->get ware type code of object
$rel.Val = get relvalue of $type
This is all fine and I can create a ship from the values stored, however if I try and pull class type from the ware code for information purposes it shows null. I take as it's not been created as an object $ship.class = $type->get object class won't work.
So my question is, can you pull a ship class from a ship ware type? If so how?
Thanks
LA
-
- Posts: 2255
- Joined: Mon, 31. Oct 05, 08:44