[DISCUSSION+REGISTRATION] - MSCI Reference

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

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

Post by Cycrow » Tue, 19. Apr 16, 10:30

first off, what game is this for ?
as that command has been changed over the different versions

Is it a ship or station you are trying, have you tried both ?

also, try it without the set position command and see if that works

shanrak
Posts: 651
Joined: Wed, 25. Feb 09, 05:54
x4

Post by shanrak » Tue, 19. Apr 16, 11:37

Cycrow wrote:first off, what game is this for ?
as that command has been changed over the different versions

Is it a ship or station you are trying, have you tried both ?

also, try it without the set position command and see if that works
This is for x3 ap but with litcubes mod.

It doesn't move the either the ship nor the station to a new sector, even if I remove the set position command.

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

Post by Joubarbe » Tue, 19. Apr 16, 11:49

Try to create another script to call "put into environment" with a START keyword. Then in the same script, wait 100 ms, then use "set position".

shanrak
Posts: 651
Joined: Wed, 25. Feb 09, 05:54
x4

Post by shanrak » Tue, 19. Apr 16, 12:02

Joubarbe wrote:Try to create another script to call "put into environment" with a START keyword. Then in the same script, wait 100 ms, then use "set position".
Just tried it, behavior is still the same as before.

I also added a log line in the new script just to make sure its being called, and it does print.

I also tried hard coding in a sector in the put into environment script, that didn't work either :?

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

Post by Joubarbe » Tue, 19. Apr 16, 17:59

The following work fine for me :

Code: Select all

$x = $pos[0]
$y = $pos[1]
$z = $pos[2]
$sec = $pos[3]

$sector = [THIS]-> get sector

if $sec == $sector

  [THIS]-> set position: x=$x y=$y z=$z

else

  [THIS]-> put into environment $sec->

end
You can easily make a loop and break it after setting position.

shanrak
Posts: 651
Joined: Wed, 25. Feb 09, 05:54
x4

Post by shanrak » Tue, 19. Apr 16, 22:43

Joubarbe wrote:The following work fine for me :

Code: Select all

$x = $pos[0]
$y = $pos[1]
$z = $pos[2]
$sec = $pos[3]

$sector = [THIS]-> get sector

if $sec == $sector

  [THIS]-> set position: x=$x y=$y z=$z

else

  [THIS]-> put into environment $sec->

end
You can easily make a loop and break it after setting position.
So I tried it and it still doesn't work for me :/

I didn't try to put it in a loop but I did run it both when the target sector is the same as the current one and when it isn't.

The set position portion works if the target position is in the same sector, but its still not putting it into a new sector.

[ external image ]

*Update*

I just tried it on a ship and it worked, I guess "put into environment" isn't supposed to work on a station?
Last edited by shanrak on Tue, 19. Apr 16, 22:52, edited 1 time in total.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Tue, 19. Apr 16, 22:49

You can't run that script command on [THIS]. Use an external script to run the command on the object.

shanrak
Posts: 651
Joined: Wed, 25. Feb 09, 05:54
x4

Post by shanrak » Tue, 19. Apr 16, 22:56

Litcube wrote:You can't run that script command on [THIS]. Use an external script to run the command on the object.
Are you referring to the put into environment command? It does seem to work when [THIS] is a ship though.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Tue, 19. Apr 16, 22:57

Oh, ok. Maybe I'm wrong.

No, it won't work on a station.

shanrak
Posts: 651
Joined: Wed, 25. Feb 09, 05:54
x4

Post by shanrak » Tue, 19. Apr 16, 23:00

Litcube wrote:Oh, ok. Maybe I'm wrong.

No, it won't work on a station.
Thanks, that's all I had to know :D

So the only way to 'move' a station is to destroy it and make a new one in the new sector.

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

Post by Cycrow » Tue, 19. Apr 16, 23:05

it does work on [THIS] however the command essentially clears the script stack, so if you run it on this, then that script will essentially be canceled, so nothing that comes after will work.

And in TC you couldn't use it on [PLAYERSHIP] although that was fixed in AP

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

Post by Joubarbe » Wed, 20. Apr 16, 09:38

Yep, sorry shanrak, I kind of forgot the "station" part of your question. Indeed, you cannot move a station. You need to destroy it and build another one. Two things to check when you do that : docked ships and station credits if it's owned by the player.

EDIT : and you should download X-Studio :)

shanrak
Posts: 651
Joined: Wed, 25. Feb 09, 05:54
x4

Post by shanrak » Thu, 21. Apr 16, 11:57

Joubarbe wrote:Yep, sorry shanrak, I kind of forgot the "station" part of your question. Indeed, you cannot move a station. You need to destroy it and build another one. Two things to check when you do that : docked ships and station credits if it's owned by the player.

EDIT : and you should download X-Studio :)
Do you have a link to a version?

The one in this thread seems to have died: http://forum.egosoft.com/viewtopic.php?t=301433

Thanks :)


radistmorse
Posts: 1
Joined: Fri, 9. Dec 16, 16:31

Wrong description for "read text from ... to ..."

Post by radistmorse » Fri, 9. Dec 16, 16:46

Sorry if I'm writing in the wrong place.

The description for the function "read text: page id=$i, from $j to $k to array" which can be found here

http://forum.egosoft.com/viewtopic.php?t=286539

is not accurate. The resulting array includes the line with the number $k (the "to ..." value) only if the "include empty =" is set to FALSE. Otherwise the last line is ignored. So short example:

Code: Select all

$test1 = read text: page id=1906, from 101 to 103 to array, include empty=[FALSE]
$test1 = size of array $test1

$test2 = read text: page id=1906, from 101 to 103 to array, include empty=[TRUE]
$test2 = size of array $test2

* Now $test1 == 3 and $test2 == 2
Correct the description please. I just spent 2 hours trying to find WTF is going on.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Fri, 9. Dec 16, 17:41

***Merged with MSCI Reference discussion thread***


Good find. While testing your findings, I noticed that the "include empty" option doesn't seem to do anything. Whether it is set to TRUE or FALSE, empty text ids will always be included. Therefore I feel what you found may be a bug with the command in general. I'll try to get an answer on that, before making changes to the command explanation in the MSCI Reference.
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!

Post Reply

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