EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[DISCUSSION+REGISTRATION] - MSCI Reference
Post new topic Reply to topic Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
View previous topic :: View next topic
Author Message
apricotslice





Joined: 16 May 2004
Posts: 13628 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Sat, 19. May 12, 08:22    Post subject: Reply with quote Print

Its long overdue for those learning scripting.

Alas, the times I've tried to use it, the command I wanted info on hadnt been done yet.

@Argonaught, Rebirth wont use scripting in its current form, but apparently will have scripting in a more generic xml form. With luck, converting between them wont be difficult or someone will write a converter pretty quickly.

Likely the new script will have the same sort of functionality, just a different syntax.

And yes, its also way past time when the MD got the same treatment. I'd venture to say that this forum could be used as well for the MD to have it all in one place, just needs its own top threads.


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Logain Abler





Joined: 31 Oct 2005
Posts: 2253 on topic
Location: Norwich, UK
Thank you for registering your game
PostPosted: Sun, 17. Jun 12, 19:04    Post subject: Reply with quote Print

Under Trade:
[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> add <Var/Number> units of <Var/Ware>

<RetVar/IF> = If the command is to 'return' information. If a variable is used, This command will return TRUE on success, FALSE on failure.

When using on HQ class stations the command always returns 0.


LA


_________________
Freight Distribution Network|Strategic Sector Defence Network|Production Modules|Capital Ship Energy Cell Generator
Back to top
View user's profile Send private message Send e-mail
mr.bear





Joined: 11 Dec 2010
Posts: 427 on topic
Location: UK
Thank you for registering your game
PostPosted: Sat, 18. Aug 12, 12:02    Post subject: Reply with quote Print

if you want to search the msci pages quickly, just use google. you can set it up to search only a specific site, then set that page as a favorite.

i have a button on my toolbar that links to:

https://www.google.co.uk/search?as_sitesearch=forum.egosoft.com

i just click the button and type in a command name. plus you get any related forum posts.

mr bear


_________________
Rapunzel, Rapunzel, let down your bear...
Back to top
View user's profile Send private message Visit poster's website
mark_a_condren





Joined: 03 Aug 2005
Posts: 1385 on topic
Location: Newcastle - Australia
Thank you for registering your game
PostPosted: Fri, 24. Aug 12, 10:15    Post subject: Reply with quote Print

Logain Abler wrote:
Under Trade:
[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> add <Var/Number> units of <Var/Ware>

<RetVar/IF> = If the command is to 'return' information. If a variable is used, This command will return TRUE on success, FALSE on failure.

When using on HQ class stations the command always returns 0.


LA

Done.

The English artical has been updated with the above info. Just needs a German translator to fix the German translation.

MarCon


_________________
MarCon Ind - S.O.C.S.I : | Game Start Sector Reveal : | Asteroid Fusion : | TC Stock Exchange | MarCon Utilities / Demos | Universal Banking | Ingame DevChat GUI
Back to top
View user's profile Send private message Send e-mail
shanrak





Joined: 25 Feb 2009
Posts: 587 on topic

Thank you for registering your game
PostPosted: Mon, 18. Apr 16, 23:12    Post subject: Reply with quote Print

Can someone please help with the put into environment command?

I'm trying to write a script to move a ship/station:

Code:

Argument 1: target Var/Ship/Station, 'target'
Argument 2: pos, Var/Sector Position, 'position'

$x = $pos[0]
$y = $pos[1]
$z = $pos[2]
$sec = pos[3]
write to player logbook: printf: fmt='Moving %s to %s (%s, %s, %s)', $target, $sec, $x, $y, $z
$target -> put into environment: $sec ->
$target -> set position: x=$x y=$y z=$z


It will print the right target, sector, and positions to the logbook.

So the object does move to the position I specify, but it doesn't change sectors. What am I doing wrong?

The put into environment entry in the MSCI Reference seems to be missing Rolling Eyes

Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20453 on topic
Location: London
Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 10:30    Post subject: Reply with quote Print

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


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
shanrak





Joined: 25 Feb 2009
Posts: 587 on topic

Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 11:37    Post subject: Reply with quote Print

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.

Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 2566 on topic
Location: France
Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 11:49    Post subject: Reply with quote Print

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".


_________________
Mayhem - Satellites Monitoring - Internal Distribution Network - ADS (Joubarbian Edition) - Bounty Board - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
shanrak





Joined: 25 Feb 2009
Posts: 587 on topic

Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 12:02    Post subject: Reply with quote Print

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 Confused

Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 2566 on topic
Location: France
Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 17:59    Post subject: Reply with quote Print

The following work fine for me :

Code:

$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.


_________________
Mayhem - Satellites Monitoring - Internal Distribution Network - ADS (Joubarbian Edition) - Bounty Board - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
shanrak





Joined: 25 Feb 2009
Posts: 587 on topic

Thank you for registering your game
modified
PostPosted: Tue, 19. Apr 16, 22:43    Post subject: Reply with quote Print

Joubarbe wrote:
The following work fine for me :

Code:

$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.



*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
Back to top
View user's profile Send private message
Litcube





Joined: 20 Oct 2006
Posts: 4167 on topic
Location: Canada
Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 22:49    Post subject: Reply with quote Print

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


_________________


Litcube's Universe Wiki
Back to top
View user's profile Send private message
shanrak





Joined: 25 Feb 2009
Posts: 587 on topic

Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 22:56    Post subject: Reply with quote Print

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.

Back to top
View user's profile Send private message
Litcube





Joined: 20 Oct 2006
Posts: 4167 on topic
Location: Canada
Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 22:57    Post subject: Reply with quote Print

Oh, ok. Maybe I'm wrong.

No, it won't work on a station.


_________________


Litcube's Universe Wiki
Back to top
View user's profile Send private message
shanrak





Joined: 25 Feb 2009
Posts: 587 on topic

Thank you for registering your game
PostPosted: Tue, 19. Apr 16, 23:00    Post subject: Reply with quote Print

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

No, it won't work on a station.


Thanks, that's all I had to know Very Happy

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

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Wed, 20. Sep 17, 07:30

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.47818 seconds, sql queries = 29