Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Nexus Bits & Bobs

TysandrTysandr Posts: 275Member ✭✭✭ - Distinguished
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
Proof of Concepts: LogrSailing MapTrading
Simple Nexus things: jqol
"It's not rocket surgery."

SenaRekhyrTorinnKryptonNicolaJadysExelethrilBlujixapugTasuuMinifie

Comments

  • KryptonKrypton shi-KhurenaPosts: 2,377Member @@ - Legendary Achaean
    What font is that in your talisman list?
    (Mhaldor): Herenicus says, "Apologies, I am in-and-out of hold with Verizon wireless customer service."
  • NicolaNicola Posts: 610Administrator Achaean staff
    I've pinned this thread! Great work @Tysandr
    Dochitha
  • TysandrTysandr Posts: 275Member ✭✭✭ - Distinguished
    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).
    Proof of Concepts: LogrSailing MapTrading
    Simple Nexus things: jqol
    "It's not rocket surgery."

  • LaedhaLaedha Posts: 67Member ✭✭✭ - Distinguished
    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-KhurenaPosts: 2,377Member @@ - Legendary Achaean
    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.
    (Mhaldor): Herenicus says, "Apologies, I am in-and-out of hold with Verizon wireless customer service."
  • TysandrTysandr Posts: 275Member ✭✭✭ - Distinguished
    edited January 3
    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!)
    Proof of Concepts: LogrSailing MapTrading
    Simple Nexus things: jqol
    "It's not rocket surgery."

  • LaedhaLaedha Posts: 67Member ✭✭✭ - Distinguished
    Thank you very much! 
Sign In to Comment.