Jay2Jay's Modding Questions Thread

Freeform discussion about anything related to modding Transcendence.
Post Reply
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

Because I know that I will be asking lots of questions on modding while working on TCE (can't even remember what it stands for anymore, but it sounds cool so I'll stick with it) and any other mods I work on, I am going to try to ask most of them on this particular thread to keep the forums a bit more tidy. Unless of course, it is a very unique question that will require lots of examples and its own discussion.

Question One: How do I limit the size of reactor that you can install on your ship? This is one of the main concepts I will be using to rebalance the game. This way, your playstyle is limited by what ship you use as your weaponry will be different. (Just because its higher level won't mean that it draws a heck of a lot of power)

Question Two: How do you dynamically check a device's stats, then make a list of parts based on those stats? This would be so that I don't have to assign the materials you would get back from disassembling weapons and to make for better mod compatibility.

Question Three: How can I dynamically generate a map that separates the systems based on level and their location relative to key systems? I want to be able to establish a "region" of systems that is filled more heavily with a specific faction until it reaches a system where there are no friendly stations in the system or there are nothing but friendlies in the system.

Question Four: How do I randomly assign enemy or friend status to a specific station and all the ships it spawns? This would be for some more "generic" independent stations and randomly corrupt AI that are randomly enemies, randomly friendly, and randomly neutral.

Question Five: How do I dynamically generate a stock market and economy based on supply/demand and enemy to friendly ratio?

That is all for now. Thanks for the help! :mrgreen:

Note: This is all mainly to begin the creation of Chaotic Systems, the foundation of TCE.
Last edited by Jay2Jay on Sat Mar 29, 2014 3:22 pm, edited 1 time in total.
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1190
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 I can help with Question One. …Sorta. I’m not sure how to go about restricting it by output or capacity, but I can throw a few other ways of limiting reactors at you:

Code: Select all

    <Events>
      <CanInstallItem>
        (block nil
          (if
            (and
              (eq (itmGetCategory gItem) 64) ; This specifies reactors,
              (or
                (geq (itmGetFrequency gItem) 20) ; This restricts a ship from installing veryrare reactors.
                (geq (itemGetLevel gItem) 7) ; This limits a ship to reactors of Level 6 and under.
                (geq (itemGetMass gItem) 5001) ; This limits a ship to reactors weighing five tons or less.
                (eq (itmHasAttribute gItem) "Military") ; This limits a ship to non-military reactors.
              )
            )
            (setq return "This reactor is incompatible with this ship.")
            (setq return True)
          )
        )
        return
      </CanInstallItem>
    </Events>
That should be more or less right, I think, if I didn’t botch anything too badly. It may need tweaked a bit — I’m running entirely off extrapolations from code in one of my own mods and haven’t actually tested this. As you’re dealing with balanced reactors, that should give you adequate options on how to limit what reactor you’re putting on.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

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!)
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

#1. Add field maxReactorPower within your ship class. For example, maxReactorPower="1000" will prevent installation of reactors bigger than 100 MW.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Jay2Jay wrote:Question Three: How can I dynamically generate a map that separates the systems based on level and their location relative to key systems? I want to be able to establish a "region" of systems that is filled more heavily with a specific faction until it reaches a system where there are no friendly stations in the system or there are nothing but friendlies in the system.
Assuming you refer here to the layout/drawing of the star-system map, you've touched what they call graph-theory in computer science. While the problem is not that difficult for a small set of nodes (star-system), the computational complexity rapidly increases: O(n^2) complexity.

In my mod 'beyond the mainline' I spend the fast majority of my time in trying to get a working algorithm for drawing the star-map nicely, while not making the player wait more than 10 minutes before the game instance is created.

If you are interested in it, I can send you two algorithms (one of which, in optimized form, is used in the mod) that both attempt to create a nice layout, each using a different theoretic approach.

If you are not interested in the layout of the map, but just the connectivity of systems, you should be able to find most of what you are looking for in the source of the mod.

Cheers,
Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

AssumedPseudonym wrote: I can help with Question One.
Thank you AssumedPseudonym! That is exactly what I wanted!

PM wrote:#1. Add field maxReactorPower within your ship class. For example, maxReactorPower="1000" will prevent installation of reactors bigger than 100 MW.
Sorry but I need to limit reactor size based on weight. I really should have defined exactly how I wanted to limit the reactor size :oops:. But thank you for the simpler answer. What defines true genius is not if you can answer a question or not, but how simple the answer is.
pixelfck wrote: Assuming you refer here to the layout/drawing of the star-system map, you've touched what they call graph-theory in computer science. While the problem is not that difficult for a small set of nodes (star-system), the computational complexity rapidly increases: O(n^2) complexity.

If you are interested in it, I can send you two algorithms (one of which, in optimized form, is used in the mod) that both attempt to create a nice layout, each using a different theoretic approach. [/qoute]
That would be very helpful. So thank you!
pixelfck wrote: If you are not interested in the layout of the map, but just the connectivity of systems, you should be able to find most of what you are looking for in the source of the mod.

Cheers,
Pixelfck
I am actually interested in the layout of the map, but both are extremely important. Either way, I'll take a peek at your mod's source and at graph-theory. [notbeingserious] If I can learn Blender in a day, then I'm sure graph-theory can't be that hard! [/notbeingserious]
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

AssumedPseudonym wrote: I can help with Question One.
Thank you AssumedPseudonym! That is exactly what I wanted!

PM wrote:#1. Add field maxReactorPower within your ship class. For example, maxReactorPower="1000" will prevent installation of reactors bigger than 100 MW.
Sorry but I need to limit reactor size based on weight. I really should have defined exactly how I wanted to limit the reactor size :oops:. But thank you for the simpler answer. What defines true genius is not if you can answer a question or not, but how simple the answer is.
pixelfck wrote: Assuming you refer here to the layout/drawing of the star-system map, you've touched what they call graph-theory in computer science. While the problem is not that difficult for a small set of nodes (star-system), the computational complexity rapidly increases: O(n^2) complexity.

If you are interested in it, I can send you two algorithms (one of which, in optimized form, is used in the mod) that both attempt to create a nice layout, each using a different theoretic approach.
That would be very helpful. So thank you!
pixelfck wrote: If you are not interested in the layout of the map, but just the connectivity of systems, you should be able to find most of what you are looking for in the source of the mod.

Cheers,
Pixelfck
I am actually interested in the layout of the map, but both are extremely important. Either way, I'll take a peek at your mod's source and at graph-theory. [notbeingserious] If I can learn Blender in a day, then I'm sure graph-theory can't be that hard! [/notbeingserious]
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Jay2Jay wrote:I am actually interested in the layout of the map, but both are extremely important. Either way, I'll take a peek at your mod's source and at graph-theory. [notbeingserious] If I can learn Blender in a day, then I'm sure graph-theory can't be that hard! [/notbeingserious]
I like the subject, so feel free to ask questions (if you have any : )).

~Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

Question 6: Can I give a weapon more than one damage type, and if so how? This is mainly for explosive weapons that would deal no small amount of kinetic damage when they hit their target.

Question 7: How do I make a borging shield? If there is a mod for that, then I will happily look at the source.

EDIT: Question 8: can you modify the color of the thruster effects?

Thanks for your continued help! :mrgreen:
Last edited by Jay2Jay on Sat Mar 29, 2014 5:17 pm, edited 1 time in total.
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

#6. Yes, depends what you want. If you want a missile that explodes into fragments, just look at the standard M2 Vulcan/M5 Nemesis missiles. They explode into a thermo radius attack (stats shown) plus blast fragments (stats hidden). If you want a weapon that fires multiple shots with different properties like damage types, that can be via (sysCreateWeaponFire ...) during <OnFireWeapon> event, but the stats shown onscreen will not show deviations done by that event. (This is a double-edged sword.)

#7. Borging? Do you mean shields that gain or change resistance types when struck? This is possible, though depending how it is done, may cause unwanted side-effects. (Change item mod? Previous unenhanced shield is worth a lot of money now that it has resist X, or shield with +100% hp lost it for resist X. Swap items? Harder and messy, but doable.)

#8. No, but you can create custom new thruster effects for your ships to use.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

PM wrote:#6. Yes, depends what you want. If you want a missile that explodes into fragments, just look at the standard M2 Vulcan/M5 Nemesis missiles. They explode into a thermo radius attack (stats shown) plus blast fragments (stats hidden). If you want a weapon that fires multiple shots with different properties like damage types, that can be via (sysCreateWeaponFire ...) during <OnFireWeapon> event, but the stats shown onscreen will not show deviations done by that event. (This is a double-edged sword.)
I would like a projectile that deals kinetic damage and an explosion that deals blast damage.
PM wrote: #7. Borging? Do you mean shields that gain or change resistance types when struck? This is possible, though depending how it is done, may cause unwanted side-effects. (Change item mod? Previous unenhanced shield is worth a lot of money now that it has resist X, or shield with +100% hp lost it for resist X. Swap items? Harder and messy, but doable.)
[/quote]

A shield that changes damage resistance based on the damage type that hits it. The more it is hit with a particular damage type the more it resists that damage type and the less it resists others. You could also manually change the resistance to whatever damage type through a dock screen accessed by sing the shield.

Also Too bad about #8

EDIT: Question 9: Can I make the missiles accelerate until they 'run out of fuel'?

Question 10: Can I make it so that rockets exit the launcher at a random angle? This is so that I can make a rapid fire high-damage weapon that would be effective vs stations, large groups of enemies, and large targets while also being balanced.

Question 11: Can I make a weapon (including specific rockets and missiles) that take penalty to shield damage? Also, could the explosion/shockwave of a weapon take a penalty/bonus independently of the projectile itself?
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

Making new thruster effects is no harder than other entities such as weapons.

#9. Yes. See the Quantum Disintegrator in Iocrym.xml.

#10. Yes. See various weapons (such as Moskva 33 or ion flame cannon) in StdWeapons.xml. Make your copy and change the angle to 0-359 or 1d360-1. If you want your missiles to originate from the center of your ship than at your nose, you will need to reposition it via events when you install it.

Code: Select all

<OnInstall>
    ; Set launcher at the center of the ship.
    (objSetDevicePos gSource gItem 0 0)
</OnInstall>
#11a. Yes. An easier way is to give the weapon low damage then add armor-penetrator for more damage to armor.

#11b. Projectile damage and fragment damage are separate. In fact, if a projectile fragments, its damage is completely ignored, and only the damage caused by fragments is done. For example, KM110 Starburst missiles and 800F hexagene mags cause blast damage on direct hit or kinetic damage from its fragments, but never both from a single missile.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
FourFire
Militia Captain
Militia Captain
Posts: 567
Joined: Sun Aug 12, 2012 5:56 pm

For question #2 you can look at how http://xelerus.de/index.php?s=mod&id=1092 does it.

Trancendence Community Edition was a decent name for your collab modding project.
(func(Admin Response)= true){
if(admin func(amiable) = true)
Create func(Helpful Posts)
else func(Keep Calm and Post derisive topics)}
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Code: Select all

(objSetDevicePos gSource gItem 0 0)
may I suggest to use:

Code: Select all

(objSetItemProperty gSource gItem 'pos '(0 0 0))
objSetDevicePos is already deprecated in the latest APIversions :/
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

Hey is everything above me still right for 1.6? Also, how the hell do you change the color of the freaking projectiles nowadays. Darn you George, actually updating things in a reasonable time scale changes modding stuff too much! *Shakes fist angrily at the sky*
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2801
Joined: Mon Aug 17, 2009 4:27 am

Most of that seems to still be accurate.

For projectile alterations, you can either use the same old code, or you can re-write the effect code (where the weapon calls a seperate effect, which with George-code usually means a bunch of damage-scaled stuff).
Mischievous local moderator. She/Her pronouns.
Post Reply