Modding superconductiog coils (NEED HELP)

Freeform discussion about anything related to modding Transcendence.
Post Reply
Novak 67
Miner
Miner
Posts: 40
Joined: Wed Mar 11, 2015 1:46 pm
Location: Training himself to create better mods

Well, the purpose of this thing is that I have no idea of create special events for items.

currently, I want the superconducting coils comparable with two things instead of one but it ALWAYS SAY THAT YOU NEED BOTH! I need this because I am creating a mod that contains a modified version of the superconducting coils and I want the superconducting coils to be conpatable on both original and light superconducting shields.

Well, I am completely new to these so I actually expect that to happen. (a bit)

NOTE:
If you are bothered to help, the UNID for light superconducting shields is itLightSuperconductingShields;
Novak 67
Miner
Miner
Posts: 40
Joined: Wed Mar 11, 2015 1:46 pm
Location: Training himself to create better mods

I think I can help you a little, here is the code for the super conducting shields

Code: Select all

<!-- Superconducting Shields -->

	<ItemType UNID="&itSuperconductingShields;"
			name=				"superconducting shield generator"
			level=				"5"
			value=				"8000"
			mass=				"1600"
			frequency=			"rare"
			attributes=			"commonwealth, kartal, majorItem, specialty"

			description=		"This generator uses an array of superconducting coils. Individual coils must be replaced to restore the field after damage is taken."
			>

		<Image imageID="&rsItems1;" imageX="192" imageY="0" imageWidth="96" imageHeight="96"/>

		<Shields
				hitPoints=		"200"
				hpBonus=		"+200,+200, +50, +50"
				regen=			"0"
				depletionDelay=	"0"
				powerUse=		"50"
				/>

	</ItemType>
	
	<!-- Superconducting coil  -->

	<ItemType UNID="&itSuperconductingCoil;"
			name=				"superconducting coil"
			level=				"4"
			value=				"50"
			mass=				"100"
			frequency=			"uncommon"
			numberAppearing=	"1d6+1"
			attributes=			"commonwealth, consumable, kartal"

			description=		"This is a special type of coil used to repair superconducting shield generators."
			>

		<Image imageID="&rsItems1;" imageX="288" imageY="480" imageWidth="96" imageHeight="96"/>

		<Invoke key="L">
			(switch
				; Does the ship have a superconducting shield? If not
				; then we can't do anything.
				(not (eq (shpGetShieldItemUNID gSource) &itSuperconductingShields;))
					(objSendMessage gSource Nil "Superconducting shields required")

				; Are the shields fully charged? If they are, then this
				; won't do anything.
				(eq (shpGetShieldDamage gSource) 0)
					(objSendMessage gSource Nil "Superconducting shields already fully charged")

				; Charge the shields
				(block Nil
					(shpRechargeShield gSource (random 40 60))
					(objRemoveItem gSource gItem 1)
					(objSendMessage gSource Nil "Superconducting shields recharged")
					)
				)
		</Invoke>
	</ItemType>
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1215
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 You’ll have to overwrite the superconducting coil to make it work, but it should only need a minor change to the <Invoke> code. Try this:

Code: Select all

<!-- Superconducting coil  -->

   <ItemType UNID="&itSuperconductingCoil;"
         name=            "superconducting coil"
         level=            "4"
         value=            "50"
         mass=            "100"
         frequency=         "uncommon"
         numberAppearing=   "1d6+1"
         attributes=         "commonwealth, consumable, kartal"

         description=      "This is a special type of coil used to repair superconducting shield generators."
         >

      <Image imageID="&rsItems1;" imageX="288" imageY="480" imageWidth="96" imageHeight="96"/>

      <Invoke key="L">
         (switch
            ; Does the ship have a superconducting shield? If not
            ; then we can't do anything.
            (and
               (not (eq (shpGetShieldItemUNID gSource) &itSuperconductingShields;))
               (not (eq (shpGetShieldItemUNID gSource) &itLightSuperconductingShields;))
               )
               (objSendMessage gSource Nil "Superconducting shields required")

            ; Are the shields fully charged? If they are, then this
            ; won't do anything.
            (eq (shpGetShieldDamage gSource) 0)
               (objSendMessage gSource Nil "Superconducting shields already fully charged")

            ; Charge the shields
            (block Nil
               (shpRechargeShield gSource (random 40 60))
               (objRemoveItem gSource gItem 1)
               (objSendMessage gSource Nil "Superconducting shields recharged")
               )
            )
      </Invoke>
   </ItemType
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!)
Novak 67
Miner
Miner
Posts: 40
Joined: Wed Mar 11, 2015 1:46 pm
Location: Training himself to create better mods

Thanks, AssumedPseudonym, I never thought the answer is THAT simple.
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1215
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 Oh, I’m sure there are plenty of other ways to handle it that are a lot more complicated than this. I can try to come up with one for you if you really want, but it’ll probably take me a bit longer. ^.~
 …Seriously, though, no problem. It’s surprising sometimes how much you can accomplish with, like, two or three extra lines of code.
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!)
Novak 67
Miner
Miner
Posts: 40
Joined: Wed Mar 11, 2015 1:46 pm
Location: Training himself to create better mods

I hope there will be a demo for these type of coding. So I do not need to ask frequently because I do not want to really to the community to be like a genie of coding, that creates mods for you all the time.

One more thing, I created a armour mod. Called "Unique armours." Currently, the armours are not really unique because of my limited coding skills, so I want to do coding like that above.

Due to the lack of coding skills I cannot create my massive imagination into reality in mods, such as retaliation armour, collects energy from a energy projectile and use it to shoot back. Retribution or vengeance plate, has a 1% chance to completely regenerate your armour and shields when hit. Avenger's rage (device) harnesses the hard radiation in an explosion of a friendly ship that is 25 light seconds away, it that makes you 5% stronger than normal for 10 seconds, (damage percentage stacks when more friendlies are killed within 25 LS (light seconds)).

I also have an idea to combine all of my mods (unique armours,( future releases: unique weapons, unique devices, unique shields) into one mod (if I finished all of my mentioned mods. As said in my location, "Somewhere in the ungoverned territories starting a company" I am actually creating a company if I complete on what is mentioned before. The company's name will be_______ .(I am yet to decide since it is too early)

But now, I am just getting started, exploring the powerful tools of coding, and the wonderful world of modern Transcendence.
Novak 67
Miner
Miner
Posts: 40
Joined: Wed Mar 11, 2015 1:46 pm
Location: Training himself to create better mods

I also want to add more ideas to my previous post, I also want to include Overdrive(drive enhancer), doubles your speed for 10 seconds, (good for intercepting fast ships you cannot catch up. Survivor's gift (device) regenerate's 25% of your armour and shields in 5 seconds.
Post Reply