|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
bluenog143
Joined: 26 Oct 2011 Posts: 617 on topic

|
Posted: Fri, 13. Apr 12, 20:52 Post subject: What does it take to be a scripter? |
|
|
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 |
|
|
|
 |
|
|
|
|
|
jack775544

Joined: 13 Dec 2011 Posts: 771 on topic Location: On the bridge of a Xenon CPU ship (Australia)

|
Posted: Sat, 14. Apr 12, 00:55 Post subject: |
|
|
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 |
|
|
|
 |
|
|
|
|
|
Orfevs
Joined: 23 Jan 2009 Posts: 125 on topic

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Teleth
Joined: 31 Mar 2012
|
Posted: Sat, 14. Apr 12, 05:45 Post subject: Re: What does it take to be a scripter? |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
Jack08

Joined: 25 Dec 2005 Posts: 2234 on topic Location: Australia

|
Posted: Sat, 14. Apr 12, 05:52 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
DrBullwinkle

Joined: 17 Dec 2011 Posts: 3352 on topic Location: Boston, USA

|
Posted: Sat, 14. Apr 12, 06:20 Post subject: |
|
|
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 |
|
|
|
 |
|
|
|
|
|
Jack08

Joined: 25 Dec 2005 Posts: 2234 on topic Location: Australia

|
Posted: Sat, 14. Apr 12, 06:27 Post subject: |
|
|
| 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
|

_________________
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
DrBullwinkle

Joined: 17 Dec 2011 Posts: 3352 on topic Location: Boston, USA

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
dillpickle

Joined: 03 Nov 2008 Posts: 1043 on topic

|
Posted: Sat, 14. Apr 12, 07:06 Post subject: |
|
|
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 |
|
|
|
 |
|
|
|
|
|
DrBullwinkle

Joined: 17 Dec 2011 Posts: 3352 on topic Location: Boston, USA

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
bluenog143
Joined: 26 Oct 2011 Posts: 617 on topic

|
Posted: Sat, 14. Apr 12, 16:31 Post subject: |
|
|
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 |
|
|
|
 |
|
|
|
|
|
jack775544

Joined: 13 Dec 2011 Posts: 771 on topic Location: On the bridge of a Xenon CPU ship (Australia)

|
Posted: Sun, 15. Apr 12, 01:46 Post subject: |
|
|
| 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.
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 |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
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
|
 |
|
|
|
|
|