Nexus Bits & Bobs

Wrote a bunch of stuff for Nexus as stress relief.


[Accents]:
. Developed a while back, I wrote this to capture the variation in people's emotions throughout the day. It is hard to imagine always talking in the same purring voice at all times.

. What does it do?
. Using emotes, this thing randomizes your speech pattern but not in a equal distribution for all your options.



. In this sample, I have entered the same command repeatedly: ''Speech impediments are troublesome.
. The type of speech pattern that has the highest expectation (most frequent) is In quiet tones. In fact, Narrowing his eyes has a less than 1 in 50  chance of appearing (but is in this sample).
. Note that after I dragonform, I gain an additional speech pattern: The air hums with electric tension
. Not shown is the speech pattern I have associated with city Hashan: In mellifluent timbre (did not fire)
. Also not shown here is the chance of firing 'With a quizzical look, ' when asking a question, with a high firing chance (the highest).



. Other un-coded potentials are such as speech patterns with outdoors, indoors, underground, injury, affliction count. Think 'The crickets threaten to overpower $me's voice as' when talking on road room, obviously at a low firing frequency.


[Fonts]:
. Allows cdn use of Google/other fonts:







. Yes that font is horrible.
. As simple as calling `f fontstyle.


[Gradients]:
. Taken from Sylphas from Lusternia, including a loop back option.




[Player DB, pdb]:
. A player DB for Nexus users, usage:
 honors player for creation
 .hl to turn on highlighting
 .uhl to turn off highlighting
 .hl player color to specify a color for a specific player
 .hl player to return to city defaults
pdb also creates .vars and .affs as objects to interact with.
. Unfortunately, given restrictions on cross-origin requests, loading a local file is out of the question. Saving a local file is possible and readily done on my personal client.
. Therefore, the pdb uses window.localStorage that is local to the browser - this means that transitioning between computers means different states.
pdb also flattens the object structure when saving, so it will store many things beyond city, class, history of professions, and race, unfortunately.







. Sorry Mindshell, you were conveniently there.
. Too lazy to add in API access, but maybe in the future.


[CSS Transitions]:
. Designed for Mudlet initially a couple of years ago, and re-written for Nexus.
. One of the things that happen during extended hours of play for me is eye fatigue. Part of that feels like it could be the static colours on a dark background that I stare at. Also, when not doing too much, the world can feel fairly static.
. One design thought was to create a dynamic sense of change even if the adventurer did not move.
. This lead to designing dynamic colors. In the following (very grainy) gif, you see a transition of css colors as the Achaean day progresses from day to night to day again (artificially sped up).
. In Mudlet, the colors are statically typed so you cannot affect already printed colors, just the new ones; Nexus and Javascript allow you to affect already printed lines so the color change affects the entire buffer. My preference is the Mudlet experience as you see a true transition over the course of the Achaean day in clantells, surroundings, etc. Unfortunately, to replicate that in Nexus has a larger number of gaps and may cause unexpected errors; not impossible though. I have gone with the simpler option.




. A few of the transitions over the course of the Achaean day on testing.
. Quite rough but a bit of native code overwriting required:
 // A bit of vodoo
 if (typeof linechunkUpgraded === 'undefined' || linechunkUpgraded === null) {
  // save only ONE copy of old linechunk_color (IRE's version), otherwise, just overwrite every time
  linechunk_color_old = linechunk_color
  linechunkUpgraded = true }
 
 linechunk_color = function(fg, bg) {
   var chunk = linechunk_color_old(fg, bg)
   // post-hoc formatting
   //  console.log(chunk)
   chunk.formatted = function(chunks) {
     if (this._fg === 'reset') {
       var res = chunks.suffix
       chunks.suffix = ''
       return res
     }
     var classr = ''
     var style = ''
     var usecase = 'style'
     // figure out if style is within our table, if it is, we use CLASS rather than STYLE
     //   only managing foreground at this stage...
     if (this._fg != null) {
       // some post-hoc modification to expand the capture pool
       if (this._fg == '#ff00ff') { this._fg = 'magenta' }
       if (this._fg == '#800080') { this._fg = 'magenta' }
       if (this._fg == '#808000') { this._fg = 'brown' }
       if (this._fg == '#00b300') { this._fg = 'green' }
       if (this._fg == '#008080') { this._fg = 'turquoise' }
       // if (this._fg == 'magenta') { console.log(ref); console.log(ref[this._fg]) } // debugging
       if (!ref[this._fg]) {
        style += 'color: ' + this._fg + '; '  
       } else { 
        classr += this._fg
       }
     }
     if (this._bg != null) {
       style += 'background-color: ' + this._bg + ' '
     }
     chunks.suffix += '</span>'
     return '<span class="' + classr + '" style="' + style + '">'
   }
   return chunk
 }


[Talismans]:
. Quintessential



[Miscellaneous]:
. Cumulative gold required, and some CFS manipulation.




Tried fixing the no-display on favicon, but didn't work out well.

All ported interspersed over 3 days. Hope it is a bit of fun to poke around.

JQOL
"All we have to decide is what to do with the time that is given to us."

Comments

  • KryptonKrypton shi-Khurena
    What font is that in your talisman list?
  • I've pinned this thread! Great work @Tysandr
  • Krypton said:
    What font is that in your talisman list?
    It's the default monospaced font for Nexus printed at 9pt using ow_Write (Nexus function).
    "All we have to decide is what to do with the time that is given to us."

  • I'm kind of a dunce for all things related to coding. I love your talisman organizer thing but I can't figure out how to get it? Is there a nexus package file somewhere or do you copy and paste it in somewhere? I'm really impressed, these are great!
  • KryptonKrypton shi-Khurena
    You can right-click Save the JQOL link at the end of the post, and upload it as a Nexus package.

    But the individual functions - like the talisman organiser, or wares multiplier - are all built into the package, which will also do other things you might not want, like change your text display colours.
  • edited January 2018
    I split it out:

    Right click and SAVE AS

    Should be able to import as a .nxs package into Nexus' drag-drop box.

    You will want to find 'tls.separator' and set that to your in-game separator.

    Also wrote some code commentary if you want to try and figure out some stuff and modify it by yourself (try changing the colors!)
    "All we have to decide is what to do with the time that is given to us."

  • Thank you very much! 
  • When trying to import this, I get a message that says, "This does not seem to be a valid settings file." I did Right Click > Save as 'tsl.nxs'. What should I do?
  • So, I think you're trying to import it as a settings file rather than a reflex package.

    If you click the 'Reflex Packages' tab and its 'Click here or drop a file with a reflex package to load it', that should work.

    If not, hit me up IG. It is 4 triggers/2 aliases and a bit of function writing, shouldn't be hard to replicate manually.
    "All we have to decide is what to do with the time that is given to us."

  • Tysandr said:
    So, I think you're trying to import it as a settings file rather than a reflex package.

    If you click the 'Reflex Packages' tab and its 'Click here or drop a file with a reflex package to load it', that should work.

    If not, hit me up IG. It is 4 triggers/2 aliases and a bit of function writing, shouldn't be hard to replicate manually.
    That was apparently exactly what I was doing. Got it sorted now. Thank you.
  • Not working for me and throws a bunch of errors.

    It seems (maybe?) somehow Nexus only partially import the package.

    The 'Reflexes' Tab of the setting looks nowhere like yours.
    Example,
    My Accent Alias only have 3 lines of code (see attached picture). The same goes for the other aliases etc.


  • The bulk of the code resides in the onLoad function. What are the errors that are being reported?
    "All we have to decide is what to do with the time that is given to us."

  • @Tysandr

    The onLoad only have 13 lines in mine.


  • edited April 2018
    Not sure why that is the case.

    I separated out Accents as a separate .nxs file: clicky. Right click, save as. Install. Type 'acc' to initiate it.

    Removed original from my Nexus and reimported to new Chrome instance after downloading from Github. Works without problems.

    Added in new conditions including exclamations, low health, low mana, high affliction count, environment type, flying status.

    Wish Achaea would natively highlight quotations with that nice cyan.









    Current list:


    Will probably split out the rest as time permits.

    "All we have to decide is what to do with the time that is given to us."

  • Who said you can't automate RP. :(
    "All we have to decide is what to do with the time that is given to us."

  • Don't know why it didn't work before, but the split out accent package worked perfectly.

    Thanks @Tysandr
  • Tysandr said:
    Who said you can't automate RP. :(
    Nobodies actually played the game in years. Just a buncha Autobots.
  • Download links appear to be broken does anybody have a version of this I can take a look at?  Lot of cool features described that I would like to build upon.
Sign In or Register to comment.