Request a modding tutorial

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Lokasenna
Miner
Miner
Posts: 32
Joined: Sun Mar 06, 2011 6:33 pm

(There might be something covering this somewhere, but I haven't had any luck)

I'd like to see an introduction to working with events. A run-through of some simple task to give newbs like me a basic idea of things are done. As a suggestion, perhaps a mod for the Longbow that fires, waits a second, and then splits into two Stilettos. (If that's actually really complicated, something else would obviously be fine)

Also, where's the best place to go for documentation on the various events and things that can be done within them?
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

There is a page on the wiki about events.

http://wiki.neurohack.com/transcendence/wiki/events

Also, note the two link in the top of the wiki page that point to pages with more detailed information.
matix
Militia Lieutenant
Militia Lieutenant
Posts: 198
Joined: Sun Apr 17, 2011 2:29 pm

Good thing this is stickied, this is a really old thread.... Anyways, I'd like to request any tutorials on tLisp :mrgreen:
Matix's Revolutionary Repair Items! Get it here !
Stronger Centauri! Download it here
Matix's Weapon Pack!: Find it here!
Preview: Momentum Cannons! Get it here!

IRC (Love it! :D):
[10:54] * matix pokes Guest33555
[10:55] * matix thinks its dead....
[10:55] * Katami shoots Guest33555 in the foot
[10:55] <matix> O.o
[10:55] <Hatsya> don't worry, it's a water gun
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Specify please?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
matix
Militia Lieutenant
Militia Lieutenant
Posts: 198
Joined: Sun Apr 17, 2011 2:29 pm

Anything at all :D
Matix's Revolutionary Repair Items! Get it here !
Stronger Centauri! Download it here
Matix's Weapon Pack!: Find it here!
Preview: Momentum Cannons! Get it here!

IRC (Love it! :D):
[10:54] * matix pokes Guest33555
[10:55] * matix thinks its dead....
[10:55] * Katami shoots Guest33555 in the foot
[10:55] <matix> O.o
[10:55] <Hatsya> don't worry, it's a water gun
matix
Militia Lieutenant
Militia Lieutenant
Posts: 198
Joined: Sun Apr 17, 2011 2:29 pm

I didnt realize that TLisp was topology and systems and such. I already know that stuff, so nevermind :lol:
Matix's Revolutionary Repair Items! Get it here !
Stronger Centauri! Download it here
Matix's Weapon Pack!: Find it here!
Preview: Momentum Cannons! Get it here!

IRC (Love it! :D):
[10:54] * matix pokes Guest33555
[10:55] * matix thinks its dead....
[10:55] * Katami shoots Guest33555 in the foot
[10:55] <matix> O.o
[10:55] <Hatsya> don't worry, it's a water gun
andrewpen
Commonwealth Pilot
Commonwealth Pilot
Posts: 97
Joined: Thu May 31, 2012 12:35 pm
Location: In my lab

Can someone make a tutorial on the objAddItem and shpInstallDevice functions. objSetDevicePos and objSetDeviceFireArc. objSetDeviceLinkedFireOptions it would realy help me with my cruiser
I
when life throws you a curve ball catch it and throw it back.
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

1. Creating factions. Adding new ships to a Pre existing faction.
2. Spawning a ship/station in a predefined system.
3. Spawn rates, tactics, AI stuff. And those encounter tables.
4. Creating a unique encounter.
5. Adding new elements into existing encounters (Kronosaur, Antarctica, and Stuff)
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

1. https://forums.kronosaur.com/viewtopic.php?f=8&t=7731
I don't know what you mean by adding ships to an existing faction, but if you want to include them in traffic you can check out Civilian Crafts.
2. https://forums.kronosaur.com/viewtopic.php?f=8&t=7732
3. Frequency can be found here:
http://wiki.kronosaur.com/modding/funct ... #frequency
Transcendence doesn't have tactics besides "run directly at enemy, gun, and turn around" or "go in a circle and take potshots" or "stay far away and pelt enemies and back off when they get close".
Explanation of the frequency strings used in encounter tables:

Code: Select all

		levels:
		12345 6789(10) <--- system level
		----c uucc -   <--- how much shows up per level
		
		LEGEND for strings:
		string	number amount
		-		won't show up in that level
		c		* Common: 20	
		u		* Uncommon: 10	
		r		* Rare: 4		
		v		* VeryRare: 1	
4. If you want a unique station encounter, just add maxAppearing= "1". If you want something more specific please ask though.

Code: Select all

	<StationType UNID="&stCSCAntarcticaEncounter;"
			name=				"(CSC Antarctica)"
			sovereign=			"&svCSCAntarctica;"
			shipEncounter=		"true"
			scale=				"ship"

			level=				"9"
			attributes=			"fleet,friendly,primary,envAir,envEarth,envFire,envWater"
			maxAppearing=		"1"
			>

		<Ships>
			<Ship	count="1"	class="&scCSCAntarctica;" orders="hold">
				<Names definiteArticle="true">CSC Antarctica</Names>
				
				<InitialData>
					<CSC>"antarctica"</CSC>
				</InitialData>
			</Ship>
		</Ships>

	</StationType>
5. You might have to inject code using TypCreate during OnGlobalTypesInit. I wrote a tutorial about it.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1452
Joined: Tue Aug 19, 2014 10:17 pm

I believe the tutorial in my sig covers A and B fairly well, though I'm always accepting ideas for improvements.

Can I request a tutorial on modeling ships that look like those used in the vanilla game, preferably using either Blender or the code - based software employed by George?
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Yeah I still need to look at PBL >.<

Let me ask around IRC because I'm not that well versed in graphics and can only produce boxes :P
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1452
Joined: Tue Aug 19, 2014 10:17 pm

RPC wrote: Let me ask around IRC because I'm not that well versed in graphics and can only produce boxes :P
Thanks! For (C), if you're referring to the 'random' of vanilla Transcendence rather than the 'random' of, say, BTM, it's fairly simple. The mechanism is actually very similar to the one used to choose which stations to spawn in Eridani. I've written a tutorial below that covers pretty much everything you'd need for that, organized by depth.

As an example, in HumanSpaceMap.xml, the New Beyond topology is described as such:

Code: Select all

<NodeGroup ID="NewBeyondMainline">
			<Stargate from="SE:Outbound"	to="C1:Inbound"/>
			<Stargate from="C1:Outbound"	to="C3:Inbound"/>
			<Stargate from="C3:Outbound"	to="C3A:Inbound"/>
			<Stargate from="C3A:Outbound"	to="BA:Inbound"/>
			<Stargate from="BA:Outbound"	to="C4:Inbound"/>
			<StargateTable>
				<Group chance="50">
					<Stargate from="C4:Outbound" to="C4A:Inbound"/>
					<Stargate from="C4A:Outbound" to="CP:Inbound"/>
				</Group>
				<Stargate chance="50" from="C4:Outbound" to="CP:Inbound"/>
			</StargateTable>
		</NodeGroup>
The section at the end, within the 'StargateTable' tags, indicates that there ought to be a 50% chance of adding the node 'C4A' between node 'C4' and node 'CP'. 'C4' and 'C4A' are both random nodes, and 'CP' is always the Charon system.

Node 'C4' is randomly selected from five possible procedurally generated systems, specified entirely in the below code block:

Code: Select all

<Node ID="C4" x="266" y="-172">
			<System
					level=			"3"
					attributes=		"humanSpace, mainline, newBeyond"
					>
				<Table>
					<System chance="17" name="Van Maanen"	UNID="&ssEarthSpaceStandard;"/>
					<System chance="8"  name="Moren-Lin"	UNID="&ssEarthSpaceBinary;"/>
					<System chance="25" name="Jotunheim"	UNID="&ssEarthSpaceRedDwarf;"/>
					<System chance="25" name="Hena's Star"	UNID="&ssEarthSpaceAsteroids;"/>
					<System chance="25" name="Ankaa"		UNID="&ssEarthSpaceDesert;"/>
				</Table>
			</System>
		</Node>
This code means that the system indicated by node 'C4' has a 17% chance of being a randomly generated standard system by the name of Van Maanen, an 8% chance of being a binary system by the name of Moren-Lin, and so on. It will always have the attributes 'humanSpace', 'mainline', and 'newBeyond', and will always be a level 3 system, regardless of which name and type is selected by the RNG. 'C4A' is specified similarly.

Node 'CP' is not an entirely procedurally generated system, and thus is specified with a link to a specific system UNID.

Code: Select all

<Node ID="CP" x="267" y="-40">
			<System
					name="Charon"
					level=			"3"
					attributes=		"humanSpace, mainline, newBeyond"
					>
				<System UNID="&ssCharonPirateFortress;"/>
			</System>

			<MapEffect>
				<Group xOffset="-172" yOffset="-58">
					<Text text=				"Charon Pirates" 
							font=			"SubTitle"
							primaryColor=	"0xff, 0xff, 0xff"
							opacity=		"20"
							/>
				</Group>
			</MapEffect>
		</Node>
The MapEffect block creates a label on the galactic map reading "Charon Pirates" placed 172px above and 58px to the left of the Charon System's point. It has no effect on the topology itself.

While I have not seen this done yet, it might be fun to mix and match handmade systems with procedurally generated systems within a single Table block. This would cause players to rely less on being guaranteed a certain set of systems while still providing interesting, custom made systems to players, and allowing for the implementation of missions that require absolute control over the system that they are carried out in. This would likely be the ideal setup for most of the systems being created in this month's mod jam, which are neither completely computer - generated nor essential components in the game's plot.

Now, I'm sure that anyone reading this is wondering what, exactly, is being referenced whenever a modder enters "&ssCharonPirateFortress;" or "&ssEarthSpaceRedDwarf;". The former is a hand - coded system specified in CharonFortress.xml, and further data on building those is specified in this month's MMJ's template, so, to avoid duplication of work, I won't cover it unless asked. The latter is specified in StdSystems.xml. Both are covered more practically in PBL, but I'll give a cursory explanation of the latter anyways.

Code: Select all

<SystemType UNID="&ssEarthSpaceRedDwarf;"
				attributes=			"envAir"
				backgroundID=		"&rsRedDwarfSpace;"
				>
		<SystemGroup>
			<Lookup table="RedDwarfSystem"/>

			<!-- Place the two stargates -->

			<Lookup table="HumanSpaceStargates"/>

			<!-- Primary Station -->

			<RandomLocation probability="60" locationCriteria="++lifeZone; *planet">
				<RandomStation stationCriteria="*friendly; *primary; +envAir; -envAvoidsAir"/>
			</RandomLocation>

			<!-- Random Stations -->

			<FillLocations
					percentFull=		"80" 
					stationCriteria=	"!primary; !debris; +envAir; -envAvoidsAir" 
					percentEnemies=		"75"
					separateEnemies=	"true"
					/>

			<!-- Random Debris -->

			<RandomLocation probability="50" locationCriteria="++outerSystem; ++asteroids">
				<Orbitals count="1d6" distance="1d8+6" angle="random">
					<RandomStation stationCriteria="*debris"/>
				</Orbitals>
			</RandomLocation>

			<FillLocations
					percentFull=		"50"
					stationCriteria=	"*debris"
					/>

			<!-- Void Encounters -->

			<Orbitals count="1d12" distance="3d200+240" angle="random" exclusionRadius="100">
				<Table>
					<RandomStation chance="80" stationCriteria="*debris"/>
					<RandomStation chance="18" stationCriteria="*enemy; +envAir; -envAvoidsAir" locationAttribs="void"/>
					<RandomStation chance="2"  stationCriteria="*friendly; !debris; !primary; +envAir; -envAvoidsAir" locationAttribs="void"/>
				</Table>
			</Orbitals>
		</SystemGroup>
	</SystemType>
What this somewhat daunting code block does is fairly simple. First, it adds "envAir" to the set of attributes initially specified. This ensures that the stations it spawns will be biased in favor of those that thrive in 'Air' type environments. It also grabs the resources image that corresponds to this system type, to use as a background when moving around the system and on the system map. It then populates the system with planets, stars, and asteroids from the RedDwarfSystem table.

After that, it picks a random station with the attributes 'friendly' and 'primary', biasing the search in favor of the attribute 'envAir', and against the attribute 'envAvoidsAir'. This has a 60 percent chance of occuring, will always occur in a planet's orbit, and almost certainly target the 'lifezone' of the system, which is the optimal distance from the star required for humans to thrive. It then fills the rest of the system with other stations(the criteria in that block is fairly self - explanatory.) After this, it has a 50% chance of spawning a group of wrecks somewhere in the system, made up of 1d8 + 6 items with the criteria "debris". After this, it populates the system with random bits of debris.

Finally, it adds various encounters to the void(the parts of the system without planets, asteroids, or other objects). There's an 80 percent chance that a random bit of debris will be spawned somewhere in the system, an 18 percent chance that an enemy station will be spawned in the void, and a 2 percent chance that a friendly station that isn't debris or a primary station will be spawned in the void.

Finally, here's the code for RedDwarfSystem, which was called in the previous section to add the planetary bodies to Jotunheim if it is selected as our C4:

Code: Select all

<RedDwarfSystem>
			<Group>
				<Code>
					(trnCreateStarAndZones aOrbit (random (list &stStarClassM8; &stStarClassM5; &stStarClassM0;)) {
						metallicComp:	'(20 20 10)
						organicComp:	'(10 10 20)
						rockyComp:		'(65 50 40)
						waterComp:		'( 5 20 30)
						})
				</Code>
				
				<AddAttribute attributes="redDwarfSystem"/>
				
				<!-- Worlds -->

				<Orbitals count="4-5" BodeDistanceStart="1d12+70" BodeDistanceEnd="1d100+740" angle="random">
					<Variants>
						<Table maxRadius="290">
							<Lookup chance="10" table="DesertPrimary"/>
							<Lookup chance="60" table="RockyPrimary"/>
							<Lookup chance="30" table="IcePrimary"/>
						</Table>
						<Table maxRadius="480">
							<Lookup chance="20" table="RockyPrimary"/>
							<Lookup chance="40" table="IcePrimary"/>
							<Lookup chance="40" table="GasGiantPrimary"/>
						</Table>
						<Table maxRadius="2000">
							<Lookup chance="30" table="IcePrimary"/>
							<Lookup chance="40" table="MethaneGasGiantPrimary"/>
							<Lookup chance="5"  table="AsteroidBelt12"/>
							<Lookup chance="15" table="AsteroidBelt25"/>
							<Lookup chance="10" table="AsteroidBelt50"/>
						</Table>
					</Variants>
				</Orbitals>

				<!-- Comets -->

				<Orbitals count="1d4-1" scale="light-minute" distance="1d8+8" angle="random" eccentricity="1d20+70" rotation="random" exclusionRadius="100">
					<Lookup table="IceComet"/>
				</Orbitals>
				
				<!-- Create ore deposits -->
			
				<Code>
					(trnCreateOreDeposits (random (list 0 0 0 1 1 1 1 2)))
				</Code>
			</Group>
		</RedDwarfSystem>
The first section is inlined "real" code(as opposed to the markup style typically used in Tlisp, which is reminiscent of HTML) that creates a random red dwarf star(the code to create a "star" is fully covered in PBL, and will thus not be discussed here) and then generates the 'zones' of the system(like the life zone I described earlier). It then adds the attribute "redDwarfSystem" to the system being populated, followed by adding four to five planets around the system's star at distances between 1d12 + 70 and 1d100 + 740. The Variants block specifies which planets will be spawned, with maxRadius indicating that a Table block will not be accessed beyond a certain radius. Effectively, the first block will be used for planets in the inner system, the second for the midsection of the system, and the third for the outer system. In the outer system, asteroid belts may be spawned instead of planets, as you've probably already figured out.

Next, a bunch of orbitals are created with ice asteroids on them, to simulate comets in the system. Finally, another bit of code is inlined, calling a method to populate the system's asteroids with ore.
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1452
Joined: Tue Aug 19, 2014 10:17 pm

https://www.twitch.tv/kronosaurproductions/v/66070409

Here's something that may be relevant to my request. I'd still like more info on Truespace or Blender, and a more in - depth text tutorial for using it as well as George does but seeing how he does it is definitely helpful, and I thought I'd post it here for anyone in the future who might read my request and want the same thing.
Last edited by JohnBWatson on Sat May 21, 2016 7:49 pm, edited 1 time in total.
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Another reference for making images.
*Technically* you can use my disgustingly formatted graphics tutorial but it's missing how to make textures and I heard from xephyr you can stitch frames using GIMP instead of Photoscape:
https://forums.kronosaur.com/viewtopic.php?f=8&t=5695
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1452
Joined: Tue Aug 19, 2014 10:17 pm

RPC wrote:Another reference for making images.
*Technically* you can use my disgustingly formatted graphics tutorial but it's missing how to make textures and I heard from xephyr you can stitch frames using GIMP instead of Photoscape:
https://forums.kronosaur.com/viewtopic.php?f=8&t=5695
That's definitely useful, but I'm still stuck on the part that involves creating a good model to begin with.
Post Reply