The Almighty Wrench! (v1.0)

Freeform discussion about anything related to modding Transcendence.
Post Reply
The Wicked Flea
Miner
Miner
Posts: 25
Joined: Tue Jul 24, 2007 8:24 pm

So many things are broken or damaged in Transcendence that a wrench becomes a handy tool. But beware, repairing some things can be risky! You can fail so badly that you break the very item you wanted to fix, or even kill yourself.

This can be very funny, but please do remember the risk involved in repairing weapons and don't blame me for the RNG. :P

Things to remember:
  • The techlevel of the item is important! Your base skill begins at level 1, and all items above that give a small penalty. You cannot learn and increase your skill without repairing these items however. If your level is above that of the item you are repairing you cannot learn anything, but your chances to fail critically are minimal.
  • Armor cannot be repaired with a wrench!
  • Shields are sensitive, and thus are harder to fix and easier to fail critically upon.
  • Weapons, normal and launchers, are more dangerous to repair and are more likely to discharge accidentally and kill you.
  • The reactor is dangerous and very hard to fix! Only attempt a repair in extremely bad situations. Should you fail it is quite easy to do so critically and is easy to kill yourself with.
Future plans:
  • Script rewrite to include a better difficulty/challenge system.
  • The ability to break any device, except a reactor, down into spare parts.
  • The ability to use spare parts to repair something more easily.
  • The chance to (on a critical fail) recover some spare parts from the device instead of completely breaking it.
  • Spare parts will not be saleable and will have no value.
Available at Xelerus: http://xelerus.unrealcrystal.com/index.php?s=mod&id=13
The Wicked Flea
Miner
Miner
Posts: 25
Joined: Tue Jul 24, 2007 8:24 pm

Bugfix update; I misspelled a function call and didn't test it. Now I have tested it and it works like a charm again.
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Totally awesome! A very creative item.

One question: I really like the part where your wrench skills improve, but I don't see any place where the wrench skill gets saved back to the player object. Am I missing something?

Nice work!
The Wicked Flea
Miner
Miner
Posts: 25
Joined: Tue Jul 24, 2007 8:24 pm

Hey George, thanks for the praise. :)

You are completely right, I called the wrong function and the player's level will never actually increase at the moment. Or, at least not more than a short time between fixing things.

On a side note I've noticed another error through playtesting (itmMatchse instead of itmMatches). I already fixed this yesterday afternoon but had no time to post, but now I'll finish off and fix the player's learning ability.

Then it is off to improvements. Partly to make it easier to read, and partly to make it more interesting to use.

Edit: New version uploaded. Remember folks that these are script changes so it won't impact save games, but just how the item behaves.

Edit2: I found the bug preventing learning (at all times) so there is now version 1.04 uploaded in which learning works correctly.
Elvarg
Anarchist
Anarchist
Posts: 5
Joined: Thu Sep 06, 2007 7:16 pm

OK, so I installed the Wrench (copied .xml files into the Extensions dir), how do I actually use it now?

- Do I have to start a new game?
- How do I access the Wrench? Do I need to buy it? Find it? If it's always there, what keys do I press to access the wrench interface? So far I have no indication whatsoever of it's presence in the game.
Bokasha
Anarchist
Anarchist
Posts: 23
Joined: Sun Jul 15, 2007 10:13 pm

You have to buy it.
User avatar
Felekar
Anarchist
Anarchist
Posts: 15
Joined: Sat Oct 06, 2007 6:44 am

I've been lurking around for a bit, and have played around with this mod. I have to say, I rather like it.
Though, I found a couple little problems, just as a way to familiarize myself more with the XML format, and what not.

Normally after a repair attempt you are ejected from the repair screen. This got quite tedious, so I fixed that. Now it should cycle back to the repair selection after a failure.
Next, I saw that you seemed simply unable to level, at least at any reasonable rate. After a bit of pondering, I've thought of the following leveling scheme:

Skill mod = Wrench Skill / 10 / (Shield [2] or Reactor [3])

-In order to repair with the least amount of risk, you must have a skill mod equal to the item's level.
-If the repair is a success, gain +1 to wrench skill.

Example:
In order to repair a level 2 shield with little risk you would need a wrench skill of 40. ( 40 Wrench skill / 10 / 2 Shield = 2 )

I'm interested if any of these changes might be useful to you. ^^

Code: Select all

<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
  [
  <!ENTITY unidWrenchMod    "0xD4660001">
  <!ENTITY rsWrench         "0xD466F002">
  <!ENTITY dsUseWrench      "0xD466A001">
  <!ENTITY itAlmightyWrench "0xD4664011">
]>
<TranscendenceExtension UNID="&unidWrenchMod;" version="0.98">

<!--
    MODIFICATION BY THE WICKED FLEA
    Version 1.0
    
    Image is a standard wrench in the public domain. ;-)
  -->

  <Image UNID="&rsWrench;"  bitmap="wrench.jpg"    bitmask="wrenchMask.bmp"/>

  <!-- The dockscreen for our specialty wrench: -->
  <DockScreen UNID="&dsUseWrench;"
      name=       "Ship's Cargo Hold"
      type=       "itemPicker"
      backgroundID=   "&rsItemListScreen;"
      >

    <ListOptions
      dataFrom= "player"
      list=   "wvsrlD"
      />

    <Panes>
      <Default
          desc= "What item do you wish to repair?">

        <Initialize>
          (block (theOdds)
            (setq gItem (scrGetItem gScreen))
            (if gItem
              (block Nil
                (setq thisItem (itmGetUNID gItem))
                (setq itemName (itmGetName gItem 32))
                (setq wrenchSkill (objGetGlobalData gPlayerShip "WrenchSkill"))
                (if (or (leq wrenchSkill 0) (not wrenchSkill))
                  (block Nil
                    (objSetGlobalData gPlayerShip "WrenchSkill" 1)
                    (setq wrenchSkill 1)
                    )
                  )
                (setq wrenchGoBetween ( divide wrenchSkill 10 ))
                
                (setq skillMod (subtract wrenchGoBetween (itmGetLevel gItem)))
                (switch
                  (itmMatches gItem "s") ; Shields are just harder in the first place
                    (setq skillMod (divide skillMod 2))
                  (itmMatches gItem "r") ; Reactors are nearly lethal
                    (setq skillMod (divide skillMod 3))
                  )

                (if (geq skillMod 0)
                  (setq gDesc (cat "The \"" itemName "\" can be repaired with almost no risk. \"" WrenchSkill "\" is Current Skill level. "))
                  (setq gDesc (cat "Repairing the \"" itemName "\" could be risky. \"" WrenchSkill "\" is Current Skill level. Do you wish to attempt a repair?"))
                  )
                (scrSetDesc gScreen gDesc)
                )
              (scrSetDesc gScreen "There are no items to repair.")
              )
              (scrEnableAction gScreen 0 gItem)
            )
        </Initialize>

        <Actions>
          <Action name="Repair this item" imageID="&rsItemListScreen;" imageIndex="1" default="1" key="R">
            (block (cursor failure criticalFail criticalDeath)
              (setq cursor (scrGetItemListCursor gScreen))
              (setq dRoll (rollDice 3 6 0))

              (setq failure (ls (add 8 skillMod) dRoll))
              (setq criticalFail (leq (add dRoll skillMod) 4)) ; Risk does make a critical failure easier...
              (switch
                (itmMatches gItem "w")
                  (setq criticalDeath (and criticalFail (leq (rollDice 2 6 0) 4)) )
                (itmMatches gItem "l")
                  (setq criticalDeath (and criticalFail (leq (rollDice 2 6 0) 5)) )
                (itmMatches gItem "r")
                  (setq criticalDeath (and criticalFail (leq (rollDice 2 6 0) 10)) )
                (block Nil
                  (setq criticalDeath (and criticalFail (eq (rollDice 2 6 0) 2)) )
                  )
                )

              (if (not (or failure criticalFail criticalDeath)) ; If we haven't failed or died then assume that it has been repaired.
                (block Nil
                  (setq gTitle (cat "After banging around on the " itemName " you manage to successfully repair it."))
			(objSetGlobalData gPlayerShip "WrenchSkill" (add wrenchSkill 1))
                  (shpRepairItem gPlayerShip cursor)
                  (scrShowPane gScreen "Used")
                  )
                (switch
                  failure
                    (block Nil
                      (setq gTitle (cat "After banging around on the " itemName " for awhile you give up.  The effort was completely fruitless."))
                      (scrShowPane gScreen "Failed")
                      )
                  criticalFail
                    (block Nil
                      (if (itmIsInstalled gItem)
                        (shpRemoveDevice gPlayerShip gItem)
                        )
                      (objRemoveItem gPlayerShip gItem 1)
                      (setq gTitle (cat "With stunning ease you bash the " itemName " and the device shatters."))
                      (scrShowPane gScreen "Broke")
                      )
                  criticalDeath
                    (block Nil
                      (switch
                        (or (itmMatches gItem "w") (itmMatches gItem "l"))
                          (block Nil
                            (setq gTitle "Smooth move, \"Einstein\", you managed to blow yourself to smitherines with the very weapon you were attempting to repair.")
                            (setq gDeath "vaporized by a damaged ship-class weapon")
                            )
                        (itmMatches gItem "s")
                          (block Nil
                            (setq gTitle "In a very complex maneuver you touch a wrong wire and the shield generator turns you into a wisp of ash.")
                            (setq gDeath "incinerated by a damaged shield generator")
                            )
                        (itmMatches gItem "v")
                          (block Nil
                            (setq gTitle "You managed to fix the drive but it was still connected to the generator, and you left the blast shields open.")
                            (setq gDeath "died of third degree burns caused by a damaged stardrive")
                            )
                        (itmMatches gItem "r")
                          (block Nil
                            (setq gTitle "You accidentally put on a biohazard suit instead of your radiation suit while trying to fix the reactor. Needless to say you liquified rather quickly.")
                            (setq gDeath "melted by a reactor")
                            )
                        (block Nil
                          (setq gTitle (cat "Somewhere you feel like someone has been mocking you.  Somehow while repairing the " itemName " you managed to kill yourself."))
                          (setq gDeath (cat "killed by attempting to repair the " itemName))
                          )
                        )
                      (scrShowPane gScreen "KilledByStupidity")
                      )
                  )
                )
              )
          </Action>

          <Action name="Cancel" imageID="&rsItemListScreen;" imageIndex="0" cancel="1" key="C">
            <Exit/>
          </Action>

        </Actions>

      </Default>

      <KilledByStupidity
          desc="=gTitle"
          noListNavigation="true"
          >
          <Initialize>
            (plyDestroyed gPlayer gDeath)
          </Initialize>

          <Actions>
            <Action name="Exit" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="X">
              <Exit/>
            </Action>
          </Actions>
      </KilledByStupidity>

      <Failed
          desc="=gTitle"
          noListNavigation="true"
          >
          <Actions>
            <Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="C">
              (scrShowPane gScreen "Default")
            </Action>
          </Actions>
      </Failed>

      <Broke
          desc="=gTitle"
          noListNavigation="true"
          >
          <Actions>
            <Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="C">
              <Exit/>
            </Action>
          </Actions>
      </Broke>

      <Used
          desc="=gTitle"
          noListNavigation="true"
          >
          <Actions>
            <Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" default="1" cancel="1" key="C">
              <Exit/>
            </Action>
          </Actions>
      </Used>
    </Panes>

  </DockScreen>
  <!-- The almighty wrench!! -->
  <ItemType UNID="&itAlmightyWrench;"
      name=            "Almighty Wrench"
      level=           "1"
      value=           "25"
      mass=            "1"
      frequency=       "common"
      numberAppearing= "1"
      modifiers=       "MinorItem"
      showReference=   "true"
      esPlural=        "true"
      useScreen= "&dsUseWrench;"

      description=     "Even in space things get damaged.  This wrench is the one and only wrench, made to fix those things that break!  Of course, when working with things that are tougher or just don't work with wrenches, this can be tough."

      sortName=        "almighty wrench"
      >

    <Image imageID="&rsWrench;" imageX="0" imageY="0" imageWidth="96" imageHeight="96"/>
  </ItemType>

</TranscendenceExtension>
Edit 9/28
Seems I had made an error before submitting the changes. It should be fixed now.
Last edited by Felekar on Fri Sep 28, 2007 10:57 am, edited 4 times in total.
Post Reply