Regurgi's Illegal Weapons

A place to discuss mods in development and concepts for new mods.
regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Regurgi's Illegal Weapons

Post by regurgi » Tue Jan 05, 2016 7:14 pm

Way-o, long time player, first-time forum member.

I got back into transcendence, (again), and I notice there's still a lack of illegal weapons. (Note that I've not yet bought Eternity Port or Corporate Command, since I don't have a job at the moment and therefore I'm stopping myself from spending money)
So lately I've been working on a mod to fix that, and just ran through my first (cheating) game with them to test balance. (And there's almost nowhere to install them, so I learned nothing! :D)

So far I've got two lines of illegal weapons: the counterfeits, and the 'ommidrectionals'.

Counterfeit weapons, ("K22 Morningstar Laser", "Luminous Particle Canon", "Dual Recoilless Thermos Striker", etc.), are chinese-knockoff style weapons, (none of which are the damage type their names would suggest). On installation, they roll 6d500, and 1500 or less is a timer on shots fired until they blow up, leaving you blind & with depleted shields, (and damaging the weapon).
My balance scheme right now is to price them a tech level lower, and give them a tech level higher damage (and energy usage), to make them tempting enough to use.
Fluff & graphics, they use fireworks to appear to be different damage types, which often involves me playing around with the graphics until I get something that looks silly. Lasers headed by a pellet and leaving a smoke trail, a particle beam with an explosion at its tip, etc.


The 'ommidrectionals' don't try to violate trademark, they just shoot in every direction. Not like an omnidirectional weapon. But like 6 kinetic canons glued together mounted on the bottom of a ship. ("Normal particle weapons are linear accelerators directed at the enemy. This is a ring accelerator which appears to have 'weapon ports' hacked into it with a knife").
They're also linked-fire.
They have the same timer as the counterfeits, but only damage themselves afterwards.
When I've cheat put them on a starter ship, they felt pretty useful for clearing out swarms of sandstorms, or coming in close to a enemy station and clearing out all the small stuff.
I know their damage & cost is off, but not having found anywhere to install them, it's hard for me to judge whether to make it go up or down. 6/8/12 shots normally would 1/6th, 1/8th, 1/12th the damage, but because the shots are all around the ship and all firing within a random 1/xth of a circle, it's impossible to aim at one ship with all shots, and very hard to aim at any particular ship with any shots. Currently I have it set at 1/3rd, 1/4th, and 1/6th tech level damage, to make up for the random chance of breaking.

Currently, I also haven't put the work into making my timer variables unique per install, so each weapontype shares the same timer. So 3 installed omnidrectional kinetic cannons, for example, would all run down the same timer 3x as fast and all break at once. (This also means you can try to game it by frequently uninstalling and reinstalling any of my illegal weapons. Which makes fluff sense, readjusting the weapon and whatnot). I'm not too concerned about making unique timers because I can't seem to find how to make variables persist across saving/loading anyways.


Now, I'm obviously going to have to expand my mod to include places to install illegal weapons and devices, so I have three things in mind I want to add while I'm at it:

1) Counterfeit Luxury Items
Direct copies of things in the game, but with the 'counterfeit' tag on them, which will operate much like the illegal tag with respect to seizing and whatnot, (if it's easy to make that happen), but can be sold, at the normal price of the items they clone, to commodities exchanges. (Instead of the maintainence shop, or victorian nightclub). Provided one has a smuggler's hold.

2) Counterfeiting Manufactories
I haven't decided yet whether these will be moving ships you can dock at, (probably use the graphics from the salvager nomad), but they'll be much like the existing manufacturing stations. They'll only sell counterfeit goods, primarily the luxuries, will be able to install illegal weapons and devices, and will need a black market ID chip. I haven't even so much as thought to look at it yet, but I'll need to figure out how stations make things vary in price and how cheaply I can get them to sell the counterfeit goods.
I'll probably have them buy stuff like radioactive waste, hydrocarbons, and other suspicious stuff to need to be making 'terran eggs' and the like. I might have to make a few extra normally unsaleable items, just to be disgusting.

3) A 3rd weapon line
My original idea for counterfeit weapons was literally two or more ordinary weapons jammed together, but I couldn't figure out how to make one weapon shoot multiple types of shots. Now that I've found and successfully used the sysCreateWeaponFire function, I think I just need a counter in <OnFireWeapon> events to run through two or three different sysCreateWeaponFire's. I'm not totally sure how to cut off the normal weapon fire if I want them to alternate, but for the most part I'll be wanting the weapons to fire at the same time anyways.
I think the timer damage for this one will simply be causing it to stop firing after some time, (until reinstall) . . . it doesn't make fluff sense that perfectly safe weapons made by reasonable manufacturers wouldn't have safety features to stop firing before being damaged or damaging the ship they're on.
I don't have a balance scheme for this yet, because I'm not sure how having multiple weapon types from one weapon will be yet. I usually pilot an EI500, so it sounds amazing to me. ("I can have one weapon that very few things will be completely strong against?!"), but other ships like the Wolfen might be more 'meh' towards it.
Since I'll be drawing from existing vanilla-transcendence weapons, I'll also be wanting to apply bonuses from devices and such, and I haven't looked in that yet.

That's . . . already quite a bit, so I'm putting my other ideas to the side for now, but I also want to expand on illegal shields & illegal devices sometime in the future. I have no ideas yet on those could possibly be reasonably illegal, but I'm sure I'll come up with something.

(And somewhere down the line, I want to take advantage of the fact that the amount of stuff in your hold effects how fast your thrust can move you, making a light ship with barely any thrust, a high top-speed, and a lot of cargo room. So as you fill up your cargo, it becomes increasingly difficult to maneuver. Of course it wouldn't be able to install any engines least of all the ineratialess drive. And sometime else down the line, I want to work on side & rear facing weapons, which could have interesting balancing difficulties, as that would allow you to fire while fleeing or while circling respectively)

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Mon Jan 11, 2016 5:49 pm

I have a few questions for anyone who wants to answer them:

1) It seems to be that to make an encounter occur in the base game, all I need to do is make a station that spawns ships and can occur in whatever systems I want it to occur in? I don't need to modify or overwrite any base game things at all? I tried this a couple of times, and I'm not sure if I haven't seen things because I missed them, because of an error in my mod, because you need more than that, because they just happened not to randomly occur, or what. (I also haven't seen any of my illegal items pop up anywhere, (not that I expect them to show up too many places), although I have seen my illegal weapons. It's a head-scratcher so far)

2) If that is the way you add stations, does that add more stations to the game, or does it occur instead of stuff that would occur otherwise? If I add 500 stations to human space, does human space become jam-packed with stations, or is it that the chance of me seeing any particular station drops to 0?

3) Lore-wise, and I know this doesn't matter because I'm making a mod, what are the state of nano-weapons? I'm thinking about high-level black market stuff now, to rival military weapons, and a line of nano weapons dispersed in clouds seems to be the easiest way to visit obvious drawbacks on the player, matching the rest of my illegal weapons.

4) Are there any popular mods that implement illegal weapons and depend on only being able to install them at black market shipyards? Been thinking about adding a manufacturer tag to my weapons & stations so that it would impact less, but I'm also generally sour on stations that only install their own stuff.

5) I never did figure out if it was possible to make a counterfeit tag that lets things get confiscated like the illegal tag, without modifying the base game. I think it shouldn't be possible because stations explicitly look for items with the illegal tag. Anyone got any ideas I could look into? It's not too bad if you can only sell them at illegal buying places anyways, but it wasn't the idea.

User avatar
Shrike
Fleet Admiral
Fleet Admiral
Posts: 2649
Joined: Mon Aug 17, 2009 4:27 am
Location: Scouting the borders of sanity (there's a lovely view of the abyss).

Re: Regurgi's Illegal Weapons

Post by Shrike » Mon Jan 11, 2016 7:01 pm

In order:

1. Pretty much, yes. Note that the station doesn't have to be a "station" station: it can be an asteroid or a cargo crate (which is how vanilla does it a lot for missions). Or a 1x1 black dot.

2. It adds more stations to the pool that the engine draws from during system generation. The number that's generated will largely depend on the system topography that the game creates...although it might increase the number as well. I don't think anyone's done tests on that.

3. Lore-wise, Nano weapons aren't currently a thing in human space. This isn't to say that they don't exist in human space, but they don't exist yet in the canon that's been written and released, that I know of. There may be a few in registered extensions but I'm not sure. This is mostly because it's quite a high damage type: it's the matter equivalent of an antimatter weapon (which is counted as an energy weapon because....um....just roll with it). That being said (and this is me, not lore), crude nanites (like the degen and regen nanos) do exist and could theoretically be weaponised fairly easily...they just wouldn't be very fantastic weapons. I'd suggest balancing as for an exotic weapon (See: Chimeric weapons, the Penitent peashooter, etc), with severe disadvantages and reduced damage/WMD to make up for the improved damage type (note that vanilla tends not to do this very well). Especially if you give it any special status effects it can inflict.

4. Not that I'm aware of, although I've done a few experiments along those lines and was planning on adding more illegals into my own work.

5. It's possible to make the tag, but you'd need to override some vanilla stuff to make it work. If you only want it to apply to commonwealth stations, you'll need to override the dsCommonwealthConfiscate dockscreen with a custom version. You can find the original at line 2421 of Commonwealth.xml in the source code for the main game (I assume you've decompiled the source already, if not then look into TransData for getting it decompiled). This is a fairly minor override, but if you want to avoid it you can put the fact that it's counterfeit in the item description, and just use the "Illegal" tag (which is what I've done for my own counterfeit item, which I put into SM&M++ as a joke).
Your friendly local genderqueer weapons designer & forum moderator. My pronoun is "They".

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Mon Jan 11, 2016 8:25 pm

Merci, merci!

What I particularly want to do with the counterfeit tag is have those items be confiscated if you don't have a smugglers hold, but sellable as normal luxuries at Starton's and colonies if you do. Which the illegal tag doesn't let, I would need to overwrite many more elements of the base game, and I don't want to do that.

What I *might* do, is make a special colony that spawns my counterfeitters ships, that does let you sell illegal goods. (But is otherwise identical). The other option is creating a mechanics' outpost, and they're not illegal, they just install whatever and repair items upto a certain level. (limited to -notforsale items, so you can't repair QACs or Pentitant cannons there, but that wouldn't be the only balance issue . . .)

Good to hear there isn't any nano-lore I'm not already aware of. My weapons will probably be exactly degenerating nanos or the like that attack enemies by applying 'decaying' or similar to their armour, but otherwise do below-level damage at very close range. I want an entire line though, not one weapon, so I'll have to be more creative :p

For now I won't add a tag then. I really dislike that mechanic. I hate carrying a gun around for 4 or 5 systems until I finally find a place to install it and . . . it's outdated.

And I guess I'll keep debugging, since I have encounters done correctly, and I haven't run into my stations yet :|
And I guess I will experiment with stations. I'll write me a quick script to actually create 5000 or so of them, and see what happens to station frequency.

So yes, thank you.

User avatar
AssumedPseudonym
Militia Captain
Militia Captain
Posts: 927
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Re: Regurgi's Illegal Weapons

Post by AssumedPseudonym » Mon Jan 11, 2016 9:10 pm

 Actually, it would not require any overrides to implement a counterfeit tag. It would require a new dockscreen to handle it with an <OnGlobalPaneInit> event to handle looking for counterfeit goods as opposed to normal contraband, however. You can probably look at how Commonwealth stations handle confiscation of illegal stuff and base your contraband tag on that.
Image

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Mon Jan 11, 2016 9:44 pm

Ah, that might work. It'd be a little kludgey.

I would only have to copy and modify this:

Code: Select all

(block (desc itemToRemove itemsToConfiscate)
					
						; If we don't have a smuggler's cargo hold, then we confiscate
						; all illegal items.
						(if (not (objGetItems gPlayerShip "*I+SmugglersHold"))
							(setq itemsToConfiscate 
								(objGetItems gPlayerShip "*U +Illegal; -ID;")
								)
							)
							
						; If we don't have a military ID, then confiscate military items
						(if (not (objGetItems gPlayerShip "*+MilitaryID"))
							(setq itemsToConfiscate (append itemsToConfiscate
								(objGetItems gPlayerShip "*U +Military; -ID;")
								))
							)
					
						; Remove items
						(enum itemsToConfiscate itemToRemove
							(objRemoveItem gPlayerShip itemToRemove)
							)

						; Compose text
						(setq desc "Commonwealth Customs has inspected your ship's cargo hold and confiscated ")
						(if (eq (count itemsToConfiscate) 1)
							(scrSetDesc gScreen (cat desc (itmGetName (item itemsToConfiscate 0) 8) "."))
							(block (i)
								(for i 0 (subtract (count itemsToConfiscate) 3)
									(setq desc (cat desc (itmGetName (item ItemsToConfiscate i) 8) ", "))
									)
								(setq desc (cat desc (itmGetName (item ItemsToConfiscate (subtract (count itemsToConfiscate) 2)) 8) " and "))
								(setq desc (cat desc (itmGetName (item ItemsToConfiscate (subtract (count itemsToConfiscate) 1)) 8) "."))
								(scrSetDesc gScreen desc)
								)
							)
						)

Correct me if I'm wrong, I would need to also include a bit specifying that the playership is docked at any station that normally confiscates items, correct? Otherwise I could dock with a wreck and have them confiscate my items.

I don't think anyone besides the commonwealth confiscates, so I'd only have to target one tag(?), so it would be relatively robust across updates to the core game.

Hmmm, I might just consider that method. Thank you!

User avatar
AssumedPseudonym
Militia Captain
Militia Captain
Posts: 927
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Re: Regurgi's Illegal Weapons

Post by AssumedPseudonym » Mon Jan 11, 2016 10:08 pm

regurgi wrote:Ah, that might work. It'd be a little kludgey.
 Welcome to modding, heh. ^.~
regurgi wrote:Correct me if I'm wrong, I would need to also include a bit specifying that the playership is docked at any station that normally confiscates items, correct? Otherwise I could dock with a wreck and have them confiscate my items.

I don't think anyone besides the commonwealth confiscates, so I'd only have to target one tag(?), so it would be relatively robust across updates to the core game.
 Yup. Or as far as that goes, you could have the Commonwealth not give a rat’s ass about counterfeit goods and have corporate stations confiscate them — just look for corporateCustoms instead of commonwealthCustoms. Or have both confiscate them. It wouldn’t take much more code one way or another.
Image

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Tue Jan 12, 2016 12:18 am

Heh, did you think this was my first rodeo? :) My first time with Transcendence, true, but I cut my teeth on a hardcode earthbound hack a dozen years ago ;)

I'm just more cautious with living games, because I don't want to run into odd problems where the CSC Europa confiscates counterfeit items, or some tags get juggled around, or having to chase down every tag that belongs to the people that I want to confiscate stuff every time an update rolls around . . . and then finding out from a player 3 months afterwards that the new corporate residence doesn't confiscate when it should.

Hell, I thought I broke resurrection earlier today when I didn't come back irradiated. Apparently I've been honouring permadeath for no reason.

This approach looks pretty promising, though. I haven't tried anything with it yet due to *still* not getting my stations to show up. I bet I committed another "<effects> inside of the <weapon> block" style error again.

Edit: *grumbles about one letter typos in UNIDs*

So I got stations working.

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Tue Jan 12, 2016 4:44 am

Got 4000 stations working.

Popping quickly over to the 2nd system & buying a system map rom saw only 12 of my stations in the system, (16 stations in total).
Seeing as I had 4000 of them set to 'common', and not requiring any planetary placements or anything, I think that makes a clear statement.

More stations in mods may slightly increase the number of stations you see overall, but are more likely to take the place of a station that otherwise would have spawned.

So, lots of extra stations in mods should be avoided.


New question: Would there be any way to make a mod-station tell the game to immediately make another random station? I'm guessing no, that it'd have to be a specific station, like how Anarchist gatherings call 'gathering satellites' that are almost clones.

User avatar
AssumedPseudonym
Militia Captain
Militia Captain
Posts: 927
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Re: Regurgi's Illegal Weapons

Post by AssumedPseudonym » Tue Jan 12, 2016 10:41 am

 Nah, I had a feeling you had either done previous modding or programming work. You seemed to be skipping a lot of steps that a lot of rank novices had to go through and yes, I remember going through most of them myself when I first started modding Transcendence. I just meant that kludging is part of the job.
regurgi wrote:New question: Would there be any way to make a mod-station tell the game to immediately make another random station? I'm guessing no, that it'd have to be a specific station, like how Anarchist gatherings call 'gathering satellites' that are almost clones.
 I haven’t looked into it, but my first thought would be to look at Korolov for that one. There is always a Charon stronghold associated with their stations, except for the one in the Charon system itself which is handled entirely differently.
Image

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Tue Jan 12, 2016 6:06 pm

Now that's an interesting one. I hadn't looked into it before because that would still only be a specific station, but why not look?

So I've looked about for the code that makes them occur together, and I'm not sure I can find it.

My best guess right now is this:

Code: Select all

<OnCreate>
				(block (charonStronghold)
					; Register a recurring event
					(sysAddObjRecurringTimerEvent 240 gSource "OnTrafficControl")
					(objSetData gSource "freightersInFlight" 0)
					(objSetData gSource "missionCount" 0)

					; Every station is overseen by a different AD
					(objSetData gSource "assistantDirector"
						(item (random (objGetStaticData gSource "assistantDirectorTable")) 0)
						)

					; Find the primary Charon stronghold in the system
					(setq charonStronghold (chrGetPrimaryStronghold gSource))
					(objSetObjRefData gSource "charonStronghold" charonStronghold)
					(objRegisterForEvents gSource charonStronghold)
					)
			</OnCreate>

If chrGetPrimaryStronghold creates a stronghold if there isn't one, that could be the answer. Korolov shipping has 'ccc--' and charon strongholds have '-rur-', so it's not even that they normally occur together.

The creation of the stronghold can't occur later than this, as that would screw up the eventing.

And I can't find it occurring elsewhere, as the only files that the term 'stronghold' occurs in are:
./PointJuno.xml -wrong type of stronghold
./Antarctica.xml -wrong type of stronghold
./CharonFortress.xml -charon system
./EncountersVol01.xml -marauders
./KorolovShipping.xml
./HumanSpaceVol01.xml -UNIDs
./CharonPirates.xml
./CentauriWarlords.xml -wrong type of stronghold

("grep -lir "stronghold" ./", btw)

And charon pirates doesn't spawn Korolov, so it can't be that strongholds spawn shipping companies.

It might be even more hardcoded than I thought.


I wonder if I could pull up the pool of stations and set them as satellites of a particular station. I think the only reason satellites are defined separately, I could be wrong, is so that they don't recursively call each other and make infinite stations. Low probability should sort that out.


. . . this is all wondering too far into the future. I should finish my existing 3-step goal and *then* expand.

User avatar
AssumedPseudonym
Militia Captain
Militia Captain
Posts: 927
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Re: Regurgi's Illegal Weapons

Post by AssumedPseudonym » Tue Jan 12, 2016 7:25 pm

chrGetPrimaryStronghold is a lambda defined in CharonPirates.xml:

Code: Select all

			(setq chrGetPrimaryStronghold (lambda (sourceObj)
				(block (primaryObj)
					; See if the stronghold exists already
					(setq primaryObj (sysFindObject sourceObj "TN +charonPirates; +primaryStronghold;"))

					; If it does not exist, create one
					(if (not primaryObj)
						(block (bestDist bestPlanet primaryPos primaryType)
							; Find the most distant planet in the system
							(setq bestDist 0)
							(enum (sysFindObject sourceObj "t +isPlanet:true;") theObj
								(block (theDist)
									(setq theDist (sysVectorDistance (objGetPos theObj)))
									(if (gr theDist bestDist)
										(setq bestDist theDist)
										)
									)
								)
							(if (ls bestDist 480)
								(setq bestDist (random 480 600))
								(setq bestDist (add bestDist (random 120 240)))
								)

							; Compute the position of the primary stronghold. It must be
							; in the outer system far from anything else
							(setq primaryPos (sysVectorRandom Nil bestDist 180 "T"))

							; Create a different stronghold depending on the system level
							(switch
								(eq (sysGetLevel) 1)
									(setq primaryType &stCharonPrimaryStronghold1;)

								(eq (sysGetLevel) 2)
									(setq primaryType &stCharonPrimaryStronghold2;)

								(setq primaryType &stCharonPrimaryStronghold3;)
								)

							; Create the stronghold
							(setq primaryObj (sysCreateStation primaryType primaryPos))
							)
						)

					primaryObj
					)
				))
 You can might could poke at it and adapt it to your needs as necessary.
Image

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Tue Jan 12, 2016 7:43 pm

Huh. I wonder how I missed that with ctrl-f 'stronghold'. Thanks!

edit: oh, duh, because I didn't search CharonPirates.xml for stronghold, I searched it for korolov. Well, I did guess correctly what the function did, so there exists evidence my brain exists :)

relanat
Militia Commander
Militia Commander
Posts: 380
Joined: Tue Nov 05, 2013 9:56 am

Re: Regurgi's Illegal Weapons

Post by relanat » Wed Jan 20, 2016 7:25 am

For general reference, there is a wiki page, http://wiki.kronosaur.com/modding/xml/stationtype, that covers <StationType> and a great topic on the forum by Periculi in Modding Reference called 'Controlling Stations in Systems' http://forums.kronosaur.com/viewtopic.php?f=8&t=1908. They have info on stations and making them appear. There is more info on the wiki but its hard to find and get at.
Also robotarozum's topic in Shipyards: Adding Station to Vanilla - Workaround. http://forums.kronosaur.com/viewtopic.php?f=5&t=6348
Last edited by relanat on Wed Jan 27, 2016 2:15 am, edited 1 time in total.

regurgi
Miner
Miner
Posts: 28
Joined: Thu Dec 24, 2015 6:39 pm

Re: Regurgi's Illegal Weapons

Post by regurgi » Thu Jan 21, 2016 3:43 am

I was hoping to run across it by now, or come up with a good method myself, but I haven't:
Variables in the scope of an item instance?

I can use objsetdata to create variables in the scope of space objects, which is great if I need only one.

Currently, I have weapons that uninstall themselves from OnFireWeapon, which is actually done through OnUpdate because 1)timed events don't seem to work to deinstall things and 2)uninstalling in OnFireWeapon leaves the game with no data to read when trying to animate, crashing the game, and exiting 'on fire weapon' with status 'true' doesn't stop it from crashing.

I currently have it implemented by checking a variable set in objsetdata, which is great if you only have one weapon of that type installed, but can and often does uninstall the wrong one of that weapon. Which is important because it doesn't interrupt firing, and because weapons can have different enhancements.

In any case, item-scope variables would be real neato to have

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest