[Discussion] Generic X3TC S&M questions III
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
AP has no "long" value support, it uses an overflow counting system, for each ( 2^31 - 1 ) the overflow value is upped by 1RoverTX wrote:What is the value at which numbers overflow in a script? Its signed so like 1 billion something correct, if it doesn't use the new big number introduced in AP?
I ask because I realized I am multiplying ship price times 18 and I am pretty sure for pricier ships thats going to cause an overflow...
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
I have a script where there is an error. I was able to isolate it down to this single section.
I put in the while loop to see what the array was, but when I check my logbook after the script is finished, I had nothing in there. So I changed it so size would be assigned 26 and I removed the get size of array command, but this just gave me 26 null statments in my logbook. So does anyone know why this array has nothing in it?
Thanks
Code: Select all
007 $alphabet = array alloc : size = 0
008 $alphabet [ 0 ] = 'a'
009 $alphabet [ 1 ] = 'b'
010 $alphabet [ 2 ] = 'c'
011 $alphabet [ 3 ] = 'd'
012 $alphabet [ 4 ] = 'e'
013 $alphabet [ 5 ] = 'f'
014 $alphabet [ 6 ] = 'g'
015 $alphabet [ 7 ] = 'h'
016 $alphabet [ 8 ] = 'i'
017 $alphabet [ 9 ] = 'j'
018 $alphabet [ 10 ] = 'k'
019 $alphabet [ 11 ] = 'l'
020 $alphabet [ 12 ] = 'm'
021 $alphabet [ 13 ] = 'n'
022 $alphabet [ 14 ] = 'o'
023 $alphabet [ 15 ] = 'p'
024 $alphabet [ 16 ] = 'q'
025 $alphabet [ 17 ] = 'r'
026 $alphabet [ 18 ] = 's'
027 $alphabet [ 19 ] = 't'
028 $alphabet [ 20 ] = 'u'
029 $alphabet [ 21 ] = 'v'
030 $alphabet [ 22 ] = 'w'
031 $alphabet [ 23 ] = 'x'
032 $alphabet [ 24 ] = 'y'
033 $alphabet [ 25 ] = 'z'
034
035 $size = size of array $alphabet
036 while $size
037 | dec $size
038 | $selection = $alphabet [ $size ]
039 | write to player logbook $selection
040 end
Thanks
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
Your allocating 0. So you either need to append instead of trying to put them into specific locations, or allocate 26 spots. Other wise your putting them in places that can't be retrieved from memory.
In short your putting stuff in a black hole, so you need to declare the space or use the append method which does it for you.
----------------------------END ANSWER --------------------------
Now for my stupid question of the day.
----------------------------START QUESTION----------------------
A few questions on calling scripts from within scripts.
Ok if I understand correctly START creates a new process that is independent of the current running script. So it will stay alive after the current one dies. It also means if it is run on the same object as the current running script it wont actually 'START' until the next wait, interrupt or the script is finished. That is correct right?
Next when should I call a script on ship with START, or when should I call the script globally and pass the ship as a parameter? This bit has got me a little confused. As long as the command is quick or has plentiful wait statements, it doesn't really matter does it?
I am a little confused because some one said to not do the following if you want the containing scrip to move on.
But instead to do this assuming [THIS] is global.
Which makes sense because the call gets put on the stack for global which of course doesn't execute till the current one is finished, waits, or is interpreted. But wouldn't the following have the same effect as above, or am I missing something?
Also wouldn't the second code clip cut out once the containing code was finished? While the third one would go on until its finished?
IE You would use the second one if you need everything to end no matter what once the top one is finished, and you would use the third when you want it to survive past the top level script? Or is there some additional difference in application that I am missing?
Sorry if this is a dumb convoluted question...
In short your putting stuff in a black hole, so you need to declare the space or use the append method which does it for you.
----------------------------END ANSWER --------------------------
Now for my stupid question of the day.
----------------------------START QUESTION----------------------
A few questions on calling scripts from within scripts.
Ok if I understand correctly START creates a new process that is independent of the current running script. So it will stay alive after the current one dies. It also means if it is run on the same object as the current running script it wont actually 'START' until the next wait, interrupt or the script is finished. That is correct right?
Next when should I call a script on ship with START, or when should I call the script globally and pass the ship as a parameter? This bit has got me a little confused. As long as the command is quick or has plentiful wait statements, it doesn't really matter does it?
I am a little confused because some one said to not do the following if you want the containing scrip to move on.
Code: Select all
@ =$ship-> call script "plugin.xxx":
Code: Select all
@ =[THIS]-> call script "plugin.xxx":ship=$ship
Code: Select all
@ START $ship-> call script "plugin.xxx":
IE You would use the second one if you need everything to end no matter what once the top one is finished, and you would use the third when you want it to survive past the top level script? Or is there some additional difference in application that I am missing?
Sorry if this is a dumb convoluted question...
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
How did I miss that
For your question, the first piece of code would be run on the object $ship and would halt the calling script until it's done.
The second would just run it as a global script assuming that [THIS] is null. It would run the called script and when it returns it would resume the calling script.
The third piece of code would run the script on task 0. Remember that the call script section is an interrupt point so the called script would run before the rest of the calling script is run.
If anyone more knowledgable than I has something to add, or point out any inaccuracies please say so.
For your question, the first piece of code would be run on the object $ship and would halt the calling script until it's done.
The second would just run it as a global script assuming that [THIS] is null. It would run the called script and when it returns it would resume the calling script.
The third piece of code would run the script on task 0. Remember that the call script section is an interrupt point so the called script would run before the rest of the calling script is run.
If anyone more knowledgable than I has something to add, or point out any inaccuracies please say so.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
Ah ok that clears it some what. So it will always enter the call script because the call itself is an inturrept intersting! I did a little test. Where [THIS] Is null
L1
L2
L3
From oldest to newest in my log book was.
L1 START
L2 START
L2 END
L1 MID
L3
L1 END
Then I tried the following changes to L1
L1
The following happened
L1 START
L2 START
L1 MID
L3
L1 END
L2 END
Then the following
L1
L1 START
L2 START
L1 MID
L3
L1 END
(It exited before L2 END could be reached)
L1 START
L2 START
L2 END
L1 MID
L3
L1 END
(Same as the first)
I think I kind of have it now.
So if I want a script to return to the top level at the next inturrpt I have to use START.
If I want a script to survive the top level dying off I need to call it globally.
That right?
L1
Code: Select all
write to player logbook 'L1 START'
= [THIS]-> call script 'AAAL2' :
write to player logbook 'L1 MID'
= [THIS]-> call script 'AAAL3' :
write to player logbook 'L1 END'
return null
Code: Select all
write to player logbook 'L2 START'
= wait 10000 ms
write to player logbook 'L2 END'
return null
Code: Select all
write to player logbook 'L3 REACHED'
return null
L1 START
L2 START
L2 END
L1 MID
L3
L1 END
Then I tried the following changes to L1
L1
Code: Select all
write to player logbook 'L1 START'
START [THIS]-> call script 'AAAL2' :
write to player logbook 'L1 MID'
START [THIS]-> call script 'AAAL3' :
write to player logbook 'L1 END'
return null
L1 START
L2 START
L1 MID
L3
L1 END
L2 END
Then the following
L1
Code: Select all
write to player logbook 'L1 START'
START [PLAYERSHIP]-> call script 'AAAL2' :
write to player logbook 'L1 MID'
START [PLAYERSHIP]-> call script 'AAAL3' :
write to player logbook 'L1 END'
return null
L2 START
L1 MID
L3
L1 END
(It exited before L2 END could be reached)
Code: Select all
write to player logbook 'L1 START'
= [PLAYERSHIP]-> call script 'AAAL2' :
write to player logbook 'L1 MID'
= [PLAYERSHIP]-> call script 'AAAL3' :
write to player logbook 'L1 END'
return null
L2 START
L2 END
L1 MID
L3
L1 END
(Same as the first)
I think I kind of have it now.
So if I want a script to return to the top level at the next inturrpt I have to use START.
If I want a script to survive the top level dying off I need to call it globally.
That right?
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
Yes. If [THIS] is either null or it is another variable eg. $ship, using start will run the called script in parallel with the calling one. If [THIS] is an object the script will be run on task 0 (also in parallel). Using a RetVal, the called script shall execute, before returning control to the calling script.
I should of said this before, but have a look on page 31 of the MSCI Handbook, it has a great description of how the command works.
I should of said this before, but have a look on page 31 of the MSCI Handbook, it has a great description of how the command works.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24965
- Joined: Sun, 2. Apr 06, 16:38
Yes, they do. They are basically (small) mods.
The ***modified*** sign is displayed at the bottom of the pilot statistics (by default press two times 'p' then scroll down to the bottom of the screen).
The ***modified*** sign is displayed at the bottom of the pilot statistics (by default press two times 'p' then scroll down to the bottom of the screen).
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24965
- Joined: Sun, 2. Apr 06, 16:38
No, there isn't.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24965
- Joined: Sun, 2. Apr 06, 16:38
It doesn't depend on the installation method, whether a mod marks your game as *modified* or not, but on the files it changes.
All scripts, except for the ones from the official bonus package, and all mods, except for a few vanilla safe mods, mark your game as *modified*.
All scripts, except for the ones from the official bonus package, and all mods, except for a few vanilla safe mods, mark your game as *modified*.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
So I have a few ships I want to add into my game, but I don't want to add the Engine Effects and Engine Emmitters so I am trying to remove them from the scene file, but if I do that then I throw off the number of the index and the turrets stop working.
So I either
A. Have to redo all the numbers and then redo the turrents in the Tship file.
OR is this possible
B. Add in an empty entry to the scene file instead of engine effect/emitters.
I would really like to be abel to do B but I really don't know whats safe to put in there as an empty place holder.
Would the following work for an empty place holder?
X being the current index number.
Edit: Tested it and it seems to work! If anyone still has any insight though I would be great full.
So I either
A. Have to redo all the numbers and then redo the turrents in the Tship file.
OR is this possible
B. Add in an empty entry to the scene file instead of engine effect/emitters.
I would really like to be abel to do B but I really don't know whats safe to put in there as an empty place holder.
Would the following work for an empty place holder?
Code: Select all
P X; B ; C 99999; N ; b // idx X
Edit: Tested it and it seems to work! If anyone still has any insight though I would be great full.
- DrBullwinkle
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Supply TL's run the job "special.idle" when they are roaming about.
If they have cargo already, then you cannot hire them.
So I think the solution is to never place stations on TL's running "special.idle".
If they have cargo already, then you cannot hire them.
So I think the solution is to never place stations on TL's running "special.idle".
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
I noticed most of they where running that job from the Job File, but thought nothing of it because it doesn't seem to do anything but tell them to move around the sector or return to their homesector if they aren't already there.
Thats like 70% of the NPC TLs out there. I think I am just going to add a signal too all the ships that will trigger a script.
The signal will work when the ship is owned by a player, and will then add a random factory after capture. Its the same outcome, just a little bit different of an effect because you wont be able to see the stations in the TLs cargo bay before capture.
Thats like 70% of the NPC TLs out there. I think I am just going to add a signal too all the ships that will trigger a script.
The signal will work when the ship is owned by a player, and will then add a random factory after capture. Its the same outcome, just a little bit different of an effect because you wont be able to see the stations in the TLs cargo bay before capture.