EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
What does it take to be a scripter?
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
bluenog143





Joined: 26 Oct 2011
Posts: 617 on topic

Thank you for registering your game
PostPosted: Fri, 13. Apr 12, 20:52    Post subject: What does it take to be a scripter? Reply with quote Print

So I've been thinking lately that I'd like to try my hand at scripting, but I have no idea what to do. Do I need to learn a programming language, or try to search up and do as many tutorials as possible or both or am I missing the whole point here?


_________________


^Both sigs are the same with the same link, they just have different colors.
SinisterDeath wrote:
This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Back to top
View user's profile Send private message
jack775544





Joined: 13 Dec 2011
Posts: 771 on topic
Location: On the bridge of a Xenon CPU ship (Australia)
Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 00:55    Post subject: Reply with quote Print

This is a must have guide for anyone interested in scripting.


_________________
SDS: Ship Diagnostics Software
"The greatest trick the devil ever pulled was convincing the world he doesn't exist" - Charles Baudelaire
Back to top
View user's profile Send private message
Orfevs





Joined: 23 Jan 2009
Posts: 125 on topic

Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 01:25    Post subject: Reply with quote Print

With an inquisitive mind, check what other scripters has done in their scripts.
Then there's the Online MSCI index as well.

An external editor could be useful: Exscriptor

Perhaps most important of all is that you need something to aim for.


_________________
There's always time to learn something new
TCAN TC/AP Artificial Life, Menudriven and Fully Automated Ship/Station Namer
Back to top
View user's profile Send private message
Teleth





Joined: 31 Mar 2012



PostPosted: Sat, 14. Apr 12, 05:45    Post subject: Re: What does it take to be a scripter? Reply with quote Print

bluenog143 wrote:
So I've been thinking lately that I'd like to try my hand at scripting, but I have no idea what to do. Do I need to learn a programming language, or try to search up and do as many tutorials as possible or both or am I missing the whole point here?

It doesn't take much, the only requirement is enthusiasm.

You don't need to know a programming language, X3 has it's own language to learn after all, and it is a basic one.

You can start with tutorials if you have the enthusiasm, or you can start out by modifying existing scripts.
I did the latter, but I am a long time programmer.

X3 script is using pretty plain syntax, so looking through the editor yourself you should be able to work out what many things do. If you can't make a wink out of anything, then you will need tutorials or research into basic programming concepts.

Accessing the script in-game takes as little as:
Enable script editor by renaming your pilot 'Thereshallbewings' once.
Opening your ship command panel and press S.
Mash enter to pass the weird intro.
From there you can browse and edit all the scripts currently running in your game.

Unlike most programming languages, you don't have to set up complex compilers or anything like that. You'll see changes to script that you save as soon as you reload a save game.


_________________
Phanon Corporation updated for XRM+AP
G19 Applet for X3
Back to top
View user's profile Send private message
Jack08





Joined: 25 Dec 2005
Posts: 2234 on topic
Location: Australia
Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 05:52    Post subject: Reply with quote Print

Quote:
You'll see changes to script that you save as soon as you reload the game.


Well there are many diffrent scenarios here, it all depends on the type of script your editing, and how that script was written.

If its a ship or object logic script, then you may see the changes immediately if the script itself checks if its version number has changed and restarts itself (requires you to change the version number at the top of the MSCI), or you may see it after some time when a new ship is spawned with a new instance of that script/task

If its an AL plugin, then you will see the changes next AL loop.

If its a signal script, you will not see the changes unless the signal script is unregistered, and re-registered, in most cases, local signals are never updated on existing objects, in case of a global signal, most scripts have the un-register and re-register in the setup script, so a reload will refresh it

The best way i found to get around the local signal script caching issue is to create a signal script that calls another script and nothing else, that way only the script call is cached, and the calling script can be updated in real time.


_________________
Back to top
View user's profile Send private message Visit poster's website
DrBullwinkle





Joined: 17 Dec 2011
Posts: 3352 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 06:20    Post subject: Reply with quote Print

All good answers.

+1 to Jack775544 for linking the MCSI Programmer's Handbook, which explains most of the other answers. It is easy to read, thorough, and written in such a way that you do not need to have any experience to learn from it (but also has enough depth that experienced programmers might learn a trick or two).

Few programmer's documents are written so well.

Jack08 wrote:
The best way i found to get around the local signal script caching issue is to create a signal script that calls another script and nothing else, that way only the script call is cached, and the calling script can be updated in real time.


I got a little confused about which script in the chain has an issue, and which one you update. Could you give us a quick example?


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software (DCS) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
Jack08





Joined: 25 Dec 2005
Posts: 2234 on topic
Location: Australia
Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 06:27    Post subject: Reply with quote Print

Quote:
I got a little confused about which script in the chain has an issue, and which one you update. Could you give us a quick example?


test.signal.register
Code:

* Register the signal killed to call test.signal.killed
[THIS] -> add secondary signal: signal={SIGNAL_KILLED}, script='test.signal.killed', prio=0, name='test.signal.killed'


test.signal.killed:
Code:

= [THIS]-> call script 'test.signal.killed.impl' : Killer=$Arg1
return null
* Changes made to this script will not reflect in game until re-registered


test.signal.killed.impl
Code:

* Do the actual handling of this signal
* Any changes made here will be reflected in game regardless of the caching of test.signal.killed
[THIS]->set name to 'YAY IM DEAD!'
return null


Wink


_________________
Back to top
View user's profile Send private message Visit poster's website
DrBullwinkle





Joined: 17 Dec 2011
Posts: 3352 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 06:34    Post subject: Reply with quote Print

Thanks.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software (DCS) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
dillpickle



MEDALMEDAL

Joined: 03 Nov 2008
Posts: 1043 on topic

Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 07:06    Post subject: Reply with quote Print

There are in fact two scripting 'disciplines' in X3TC/AP:
  • The script editor - as can be seen lots of documentation/information and plenty of people who understand it.
  • The Mission Director - which has very little documentation and only a handful of people who use/understand it.


My advice would be to pick something that interests you, it's about doing something because you want to do it, not because you have to do it.

Start small - it's easy to get discouraged trying to write that 'epic' script you have an idea for, before getting a grasp of the basics.

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





Joined: 17 Dec 2011
Posts: 3352 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 07:15    Post subject: Reply with quote Print

dillpickle wrote:
The Mission Director - which has very little documentation and only a handful of people who use/understand it.


Lemme see... there is Xenon_Slayer, Ketraar, and dillpickle. That's like three people on the planet who have much depth in the Mission Director. Wink

Somehow, that has to improve if the long-term plan is for the Mission Director to replace the Script Editor.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software (DCS) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
bluenog143





Joined: 26 Oct 2011
Posts: 617 on topic

Thank you for registering your game
PostPosted: Sat, 14. Apr 12, 16:31    Post subject: Reply with quote Print

This is some good info I'm going to see what i can do.

EDIT: I think I'll start out with the handbook and some tutorials/references.


_________________


^Both sigs are the same with the same link, they just have different colors.
SinisterDeath wrote:
This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Back to top
View user's profile Send private message
jack775544





Joined: 13 Dec 2011
Posts: 771 on topic
Location: On the bridge of a Xenon CPU ship (Australia)
Thank you for registering your game
PostPosted: Sun, 15. Apr 12, 01:46    Post subject: Reply with quote Print

DrBullwinkle wrote:
dillpickle wrote:
The Mission Director - which has very little documentation and only a handful of people who use/understand it.


Lemme see... there is Xenon_Slayer, Ketraar, and dillpickle. That's like three people on the planet who have much depth in the Mission Director. Wink

Somehow, that has to improve if the long-term plan is for the Mission Director to replace the Script Editor.


You forgot Jens Ka, eldyranx3, Argonaught and Alex Vanderbilt.
Probably a couple of others but there will be no more then 10 in total.


_________________
SDS: Ship Diagnostics Software
"The greatest trick the devil ever pulled was convincing the world he doesn't exist" - Charles Baudelaire
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
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, 22. May 13, 16:10

All times are GMT + 2 Hours


Board Security

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