Random Equipment Version 2!

Freeform discussion about anything related to modding Transcendence.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Most likely outside the changes caused by this mod. This touches no stations or weapon types- if it had come from a ship, then I could say it was likely due to the random selector being set to grab anything- but you bought it, and so I have no idea why that's happening.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Periculi, as a proof of concept code, i was thinking a way to create the level string used in the itmCreateRandom, so that, when you call the intSetWeaponConfig you don't have a long list of cases for the switch, but a short iterating code that build the string and then use it:

Code: Select all

(setq intSetWeaponConfig (lambda (levelChoice)
	(block (choiceWeapon levelString)
		
		(setq levelString Nil)
		(for i 1 (add levelChoice 1)
				
		(block Nil		
			(switch
				(eq (subtract levelchoice 1) i)
					(block Nil
					(setq levelString (cat levelString "v"))
					)
				(eq levelChoice i)
					(block Nil
					(setq levelString (cat levelString "c"))
					)
				(eq (add levelchoice 1) i)
					(block Nil
					(setq levelString (cat levelString "v"))
					)
				(setq levelString (cat levelString "-"))
			)	
		)
		)
(setq choiceWeapon (itmCreateRandom "w,-m" levelString))

(if choiceWeapon
	(block Nil
		(objAddItem gSource choiceWeapon)
		(shpInstallDevice gSource choiceWeapon)
			)
			)			
)))
dashes after the last letter are not needed, so there is no need to create them.
"c" <-- this for example should work fine for generating level 1 weapons.

This code is not tested at all, it was just an idea I wanted to share.

Even if the code works, there is a flaw, it doesn't create the necessary spaces for grouping the letters and dashes five by five "-c--- -----"
The code to add the spaces without loosing track of the levels is out of my coding capabilities. :) I can think of it using more than one for iteration, but then it wouldn't be shorter than the original code.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Ok. It's an interesting idea. And I know that it isn't a complete idea, still-

Here's my pitch for the switch:

Even though it seems bulky, it is only bulky there in one spot. The nice thing is that the switch can be easily understood by less code savvy modders and changed down the line, and it can handle a larger variety of controls just fine. If I wanted to throw together a whole new faction-based set of specific modifiers for the filter to use I could add them there and use them easily- not to mention seeing exactly what it is that is being called up.

At first glance, your code is lacking in a method to distinguish between sets for the same level, such as is being done with my current [1a or 1b] style. It is also generalizing the item modifiers portion. I didn't set up any fancy modifiers yet, but I do have plans to do so. Using just "w, -m" was me being lazy and not wanting to think about a more precise control of the filter.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

good point. :) I agree, the use of the switch function makes everything easily upgradable and readable.
I wanted also to build the string with the modifiers, but I still don't know how to do that. (if it's possible :lol: )

BTW, i already started collecting most of the ships ingame, and I will soon release a new version of the weapons extended mod with even more modifiers, in order to handle the weapons as easy as possible.

I wonder if I should add more sovereign modifiers: for example, adding "Ranx" to all the weapons used by ranx sovereign.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

BTW, i already started collecting most of the ships ingame, and I will soon release a new version of the weapons extended mod with even more modifiers, in order to handle the weapons as easy as possible.
Will the ships be using the new ammo tables in the next version, and if so, should I place the same into the REquip2 ships? Or should we combine a mod for that perhaps?
I wonder if I should add more sovereign modifiers: for example, adding "Ranx" to all the weapons used by ranx sovereign.
Can we ever have too many modifiers? Originally I was thinking of adding more modifiers based around tech type, but sovereigns might be a good idea.

You know, it is possible to make this mod configure for difficulty level. We could throw together some degrees of configuration and make a mod station that allowed people to switch the way the equip was being loaded.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

I just added:

LIST OF MODIFIERS USED:
Main modifiers
EnergyWeapon = Normally ion, laser, particle or positron weapons (exceptions in the Vanilla version are retained)
MajorItem =all weapons are majoritem, needed for random loot tables
Consumable and Missile have to be modifiers for ammo itemtypes, in order to be handled correctly by the random loot tables.

Modifiers by damage
Cannon = kinetic weapon
Laser = laser weapon
Particle
BlastCannon
Ion
ThermoCannon
Positron
Plasma
Antimatter

Special Modifiers
Radiation= radioactive weapons, aminly the actinide waste cannon and some missiles.
Specialty
Military = used for the Military ID
Illegal = Illegal weapons in commonwealth
omniweapon =omnidirectional weapon
Launcher= weapons installed as launchers
lightWeapon=used on all lighter versions (and not anymore only the light recoilless cannon)
NotForSale

Modifiers by manifacturer
Bushido
Rasiermesser
NAMI
EIC = Earth Industries Conglomerate
Makayev
Alien

Modifiers by Sovereign
Urak
Dwarg
Heliotrope
Kobol
Ventari
Sung
Ferian
Ares

Just say "When" :D

---

About the ships: I just added them to your randequip mod without modifications, I just wanted 1 xml with most of the ships ingame.
I can upload it to xelerus if you want.
Here:
http://xelerus.de/index.php?s=mod&id=111

EDIT: About the ammo tables: now I know how the objAddRandomItems works, I need to change the values of the ammos in the tables and then reupload weapons extended to xelerus. Give me some time to recover balanced numbers for each ammo, so that we won't come up with ships with 3 missiles (not good) or 3000 missiles. (not good too)
Last edited by digdug on Fri Mar 28, 2008 11:12 pm, edited 1 time in total.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

...too much to digest~!

ok, well, I will check out the mod you posted (as "partially not working"?!)

At any rate- seems like you made plenty of modifiers for what I was looking for, now we might benefit from creating some models for the various factions to select from and placing the filter set into the list of selectors. :)
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

"partially not working", well, no it's working, I just wrote it to prevent people to download it, put in the extensions folder, try to play with it and then post in the forum that it does nothing more than the original randEquip2 mod.
:)
Post Reply