Huge target for "Use the search function".

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
Dyrewulfe
Anarchist
Anarchist
Posts: 11
Joined: Sun Jul 18, 2010 9:01 am

I've got this nasty thing bugging me after browsing the xml sources and the like... I'm not quite understanding the difference between the "tscript" I've seen referred to, and the xml.

From what I see, there's a "block" statement used to execute script code...

Code: Select all

(block (foo)

	(stuff)	

)
1. Where exactly can I apply this?
2. What exactly is "foo" in the above? A function name, a parameter, a... ???

Basically, I need a simple, straight-forward, tscript syntax primer. As the topic says, a bullseye for "Use the search function" but... Things like this are terrible to search for. Most the terms are too commonly used, or what I'd use myself is too obscure. NOt asking anyone to spend a day teaching me to code or anything, I'm just hoping someone can spare a few minutes to save me some hours trying to figure out this thing in my way. Basically, I don't know how or where to utilize scripts so I can take advantage of the functionality. I've been browsing the wiki, that hasn't helped much.

So, any words of explanation, or pointers to a good resource, would be very much appreciated. I'm a(WARNING! Arrogant boasting at 12' o'clock!) rather clever coder and hack, and I've got some things I'd love to implement and share, that seem to be possible(ship stats screen, weapon hotkeys, and customized active devices arrays, to name a few.)

Also, this is one hell of a game. Something I'd been trying to find for quite a while. I'd put a game of this nature on my possible TO-DO list for a game project of my own, since I hadn't found anything like it. Thank you, George.

(P.S. - What's Transcendence written in? C, C++, Delphi, ???, BASIC(Heheh... Yeah, right.) If it's anything close to C or C++, I'm gonna die a little inside as a result of it not being open-source. I'd pour my heart into this. I'd already started something similar.)
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Hi Grey,

First of all, welcome to the forums. Nice of you to start with a post in Script Reference. Always like those who start by digging in to the deep end :D

tscript uses a lisp like syntax, so for a primer on what all those parentheses are, look a bit at some lisp tutorials. There are some syntax highlighting modes written for jedit and vim, so if you use either editor that might make things nicer.

For searching information about tscript itself, there is the function list on xelerus which is searchable, and the function part of the wiki

Transcendence is written in C++. I too would love to see it open-source, but alas, we have to be happy with the face that George is an extremely attentive overlord :D The community really has and have had an impact on this game.

As for the best way to learn tscript, just playing around and studying mods and the vanilla source is the best way. If you are really serious about this I'd love to give you a thorough introduction, so come on IRC one day and shout at me.

Have fun .]
Dyrewulfe
Anarchist
Anarchist
Posts: 11
Joined: Sun Jul 18, 2010 9:01 am

Thank you for the prompt response. This wasn't actually my first post, though. But, scripting is generally where I dwell in anything of this nature. I'm an interface and gameplay hacker, for the most part.

The reference to lisp is quite handy, gives me a good idea of what I'll be working with on syntax.(And, I don't use either of those editors, but mine does have lisp profiles, as well as 80 or so languages I've never heard of. :) )

I guess the only thing I'm missing is how the two mesh together. Something about the combining between the tscript blocks and xml is eluding me. Can I simply pop a block in anywhere?

(And, I'll take that advice on hopping on to IRC. I've got some time tonight, but the next few days are rather... Iffy. Getting ready to move.)
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Gray wrote: This wasn't actually my first post, though.
Well, it was close enough to count :)
Gray wrote:I guess the only thing I'm missing is how the two mesh together.[/quote

tscript can be embedded inside the xml at certain locations. There is no clear rule as to where though. There are however a lot of known locations.

* between the individual events in an <Events> element.
* in the <Globals> element
* in a few xml attributes, using the syntax attr="=(script)"
* in several elements in dockscreens (most of them)
* in communication elements
* umm, probably also a lot of places i missed :)

In general, the source if your blueprint for this. And lots of testing.

.]
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Inside an <invoke>

that is also a pretty good place to start, for it's semplicity
for examples, besides the sources, have a look at mods containing usable items, most of them use invokable tscripts
Post Reply