β˜… IruMoto NPC Engine :: Xay Tomsen Creations β˜…

A scripted NPC guards the palace

OpenSimulator virtual worlds

The IruMoto NPC Engine is a scripted prim for use in OpenSimulator virtual worlds. It generates a single menu-powered NPC, and is copy/mod so you can rez as many units as you wish.

Generated NPCs have negligible effect on physics or region performance, and far less impact than a normal avatar. I have 40+ NPC Engines and their NPCs in operation on my region, Arius. They have virtually zero impact on game physics and generate no lag.

Note that the IruMoto NPC Engine is designed to create detailed and complex, story-driven NPCs, not as a spawner to fill regions with random clones. If you want basic, this is overkill. Try the OSSLNPC page.

You can see my NPC Engines in action by teleporting in-world. I haven't yet boxed them up for general sale as it's a massive project, however the scripts are available at the IruMoto Script Factory in-world.

If I've built a custom NPC Engine for you and you're looking to update to newer scripts, you'll find all the details and version notes below.

Teleport to IruMoto Script Factory

If you have a viewer installed, click the landmark below to teleport to IruMoto Script Factory. If you don't have a viewer and would like to check out virtual worlds, download the free Firestorm Viewer, and then join a grid. I recommend DigiWorldz where my avatar has lived happily since 2016. If you take this link to DigiWorldz, I do get a commission if you later decide to rent land. I appreciate your support. 😊

teleport to IruMoto Script Factory

IruMoto sign

Specifications

Functionality

Function

The IruMoto NPC Engine manages a single NPC (a.k.a. "bot"), over which you have absolute control.

The generated NPC 'sits' on the engine (except in Guest mode). The NPC can operate as its own individual entity, or collectively with other bots when controlled by an external script such as IruMoto NPC Master or IruMoto Time Generator.

Extremely customisable, NPC Engine's extensive list of variables allows your NPCs to be used as models at shops, staff performing regular tasks, residents to fill a resort, companions, lovers, entertainers etc.

NPCs can perform any animation sequences (priority 4 recommended) and also have 20 facial expressions courtesy of their inbuilt PUMP Expressions HUD.

Features

Features

Your NPC Engine:

  • Saves, stores, and generates a single NPC with up to 11 outfits and appearances.
  • Can save your own appearances or simply drag and drop existing outfit cards you've made or purchased. Outfits imported as .iar files from different grids appear to work flawlessly.
  • Populates your NPC's profile with its photo and bio.
  • Provides multiple mode options to declare how your NPC spawns, exists, and goes offline.
  • Gives your NPC a unique channel and powerful drop-down menu.
  • Listens on up to three separate channels, allowing your NPC to react to region-wide sensors, IruMoto NPC Masters, and IruMoto Time Generators.
  • Communicates with your NPC's body enhancements such as PUMP Strip and Pump Cock + HUD.
  • Piggy-backs off the ping feature in Time Generator to locate missing NPCs or their engines, anywhere on your region.
NPC Modes

NPC Modes

The mode you choose determines how your NPC spawns and dies, and also its capabilities.

  • SENSOR: An external sensor tells your Sensor NPC to spawn when an avatar arrives within a chose radius. Sensor NPCs automatically die when it senses there are no avatars in its defined proximity. Its actions and interactions are controlled by an NPC Master or Time Generator.
  • TIMEGEN: Your TimeGen NPC exists, acts, and dies in response to time updates from your region's Time Generator. TimeGen NPCs can perform up to 300 events every 24 hours. Each event can include animations, outfit changes, and relocation anywhere on your region.
  • TRIGGER: A Trigger NPC is spawned and dies in response to commands from IruMoto NPC Master, which in turn is controlled by an avatar. Ideal for story telling scenarios or lover sequences, Trigger NPCs can listen to multiple NPC Masters. All NPC modes can follow action commands from NPC Master, but only Trigger NPCs are spawned or killed by it. Like Sensor NPCs, Trigger NPCs automatically die if there are no avatars around.
  • ALWAYS: Always NPCs are always online, even when there are no avatars on your region. Always NPCs automatically refresh every hour and restart if your region reboots. Always NPCs can listen to commands from an NPC Master or external sensor but not from a Time Generator.
  • GUEST: A legacy mode largely superseded by Trigger NPCs, a Guest NPC is essentially an escort. Tenants of your region can teleport Guest NPCs to their parcel of land for sex or companionship via poseballs rezzed by MPA furniture.
Components

Components

Components of the IruMoto NPC Engine are:

Internal components:

  • .[npcAction] series script
  • .[npcEmotions] series script
  • .[npcExist] series script
  • 14 support notecards
  • all animations that you list in your .[npcAction] script

External support scripts:

  • .[npcActivateSensor] series script
  • IruMoto Time Generator - optional
  • IruMoto NPC Master - optional
Variables

Variables

Core variables such as name, gender, NPC mode, menu channel, TimeGen channel, and sensor channel are managed in the supporting .npcConfig notecard. Several other notecards control the NPC's appearance as well as profile information and pictures.

All scripts are designed to be 'set and forget' with the exception of .[npcAction] which listens for commands from an external script to determine each of the NPC's actions.

File Syntax

File Syntax

I use some basic syntax rules for the sake of order in my Contents windows. As per the sample below, scripts are always at the top, then notecards, then animations. It keeps things neat and simple.

  • All IruMoto scripts start with a period then a brace;
  • All notecards start with a period but no brace;
  • All animations start with a period then capital X.

Scripts

.[npcExist]

.[npcExist]

The .[npcExist500] script spawns and kills its NPC as per the parameters you set in the supporting .npcConfig notecard. The script's secondary but vital purpose is to generate your NPC's control menus (a.k.a. dialogs), as per the variables contained in the other supporting notecards. Unlike .[npcAction], you don't modify this script directly. Instead, edit the various notecards then reboot the script via its touch menu to update its variables.

2025

  • v604 251110 - lowered llSitTarget z axis by 1 metre. This makes NPC Engine sit at neck height so I can reduce its size. All anim z pos in npcAction have to be adjusted manually + 1 metre to compensate.
  • v603 251102 - in emotions menu, swapped afraid, kiss, bawl, and sleep for doze, climax, oops, and shock. Also added new menu Strip for hide/show enabled outfits. Also, in Emotions listens, changed chan to menuChan. It shouldn't have an impact because the if statement says if chan == menuChan, but untidy code since every other Dialog listen uses menuChan.
  • v602 251016 - changed llSameGroup section to make compatible with Y Engine. Also swapped out calls to llGetCreator for llGetOwner.

2023

  • v601 230824 - **** NOTE 251016 I'M PRETTY SURE I REVERTED THIS. TWO YEARS LATER, I VAGUELY REMEMBER THIS VERSION FAILED.Β in state ready, reduced llListen to a single all-encompassing 'chan' variable, while listen() determines which channel is which. See notes for similar changes for npcAction600 for full info.
  • v600 230326 - reverts to 11 outfits as any more is superfluous
  • also exacerbated load errors for Build Tools > Contents tab on var-regions
  • added link_message function for reverse comms from other scripts
  • now handles outfit changes as instructed by npcAction
  • changed references to 'outfit' to 'o'
  • removed unused legacy saveOutfit function and strings
  • replaced repetitious calls in Save Outfit messages with saveO function
  • .botOutfits500.2d notecard changes to .npcOutfits600
  • requires .npcConfig600 notecard

2021

  • v500.2e 211230 - added extra detail to ping response to specify botType.
  • v500.2d 211215 - increased outfits count from 11 to 20. Requires .[npcAction500.1r], .botOutfits500.2d, plus 9 extra .outfit notecards.
  • v500.2c 211206 - resetAll from prev update only resets npcAction.
  • Added llResetScript() to tgDeath so npcExist resets as well.
  • botlive = 0 removed as it gets picked up in the reset anyway.
  • v500.2b 211203 - for TIMEGEN bots, added empty else if statements to listen events for botLive states for tgBirth and tgDeath, also endAnim and resetAll to tgDeath (copied from TRIGGER).
  • v500.2a 211124 - NPCs began crashing. Cause turned out to be some of the || parameters in various functions from my tidying up code yesterday. Reverted, remembering that this happened a few years ago too. All good now.
  • v500.1z 211124 - added "ping" functionality, initiated by TimeGen 4.2. The purpose of this feature is to keep track of all IruMoto NPCs on the region. By touching the TimeGen, you are prompted to ping the NPCs, which then return IMs of their names and locations. Responses are staggered using the existing f_birthDelay. Required opening up tgChan listen to all botTypes in .npcExist but not in .npcAction. This keeps the functions of existence vs action distinct.
  • v500.1y 211124 - tidied up several if/else statements with || operators.
  • Cleaned up about 80 lines of code.
  • v500.1x 211123 re-jig scripts to allow new TimeGen4 to act as an NPC controller. Requires new notecard .npcConfig500.1x
  • v500.1w 210828 - since .1v, on initial startup, bots are getting stuck between stop sit anim and defA which is a sequence prob between this script and npcActions. Have combined initBot() and initDefaults() in order to rearrange sequence of stuff, and make a later call to botLive which then triggers npcAction.
  • v500.1v 210827 - moving llSetObjectDesc into initBot() so that this happens before the botLive call to other scripts, thus eliminating the need for llSleep() calls in .npcAction, which hopefully will eradicate the long-running and unpredictable off-world glitch on reset.

    v500.1u 210809 - commented out regionLock() as it's rarely used and can be added to the config card at some future point. regionLock was causing issues in local grid, as Arius is irrelevant. This script is the result and works offline.

  • v500.1t 210731 - Narrowed regionLock() to Arius.
  • Added notices() to streamline code including reword of message to user.
  • Added botSleep() to tidy code for suicide.
  • V500.1s 210721 - removing a lot of empty if statements, partic in regard to VENUE and GUEST bots. I can't see a need for VENUE bots anymore, which sit on a poseball the same as GUEST NPCs, but I don't think I'll ever use this function again and can always morph the GUEST code if I do, so am deleting it. Also adding a suffix to .botProfile500.1s and .npcConfig500.1s cards as I want them uniform.
  • v500.1r 210721 - implemented osNpcSetProfileAbout and osNpcSetProfileImage. Both contained in initBot(). Also required changes to botProfile notecard layout and how it is read.
  • v500.1q 210706 - in initBot, changed rez location to 1,1,1 to see if the cause of NPC rezzing in the region corner is due to the script sometimes failing to do the llGetPos call beforehand. The recent mod to .[npcAction500.1k] didn't fix the prob.
  • v500.1p 210109 - changed regionLock from Arius to Aboyo Beach. Also re-added ALWAYS functionality for prop NPCs. Latter required parallel update to .[npcAction500.1h].
  • v500.1o 210106 - approx line 378 added group ability to if/else llGetCreator statements so land owners can access secondary menu.

2019

  • v500.1n 190507 - changed default colours of VENUE & GUEST bots to white. Also removed hovertext.
  • v500.1m - 190504 - in initBot(), added decimals to pos vector to see if float syntax is the problem causing bots to crash approx every tenth time on startup. Possibly noteworthy is that older scripts e.g. v3.78 have the same issue. As far back as v2.03 also lack a decimal but I can't recall if this was ever an issue. Probably not as they weren't triggered by a sensor and I suspect there is some correlation there. NOTE 190507 NO DIFFERENCE. STILL CRASHES EVERY 10TH OR SO TIME.
  • v500.1k - 190206 - replaced saveO() function with 2 lines of code in Save Outfits menu (from v3.6) to re-add outfit description to chat as double check I hit the right button.
  • v500.1j - corrects a new (and never happened before) script warning with more than 512 characters in Emotions dialogue.
  • v500.1i - reverted to 2 kinds of lover NPC: VENUE and GUEST. Necessary for land permissions and possibly different menus later on. Also modified menus using llGetCreator instead of llGetOwner.
  • v500.1h - tidied up LOVER & ESCORT dialog, menu, instructions & textXXX() functions. IM upon use changed from llGetOwner to llGetCreator to track usage if/when I supply unit as a HUD. Combine LOVER & ESCORT bots into GUEST. Removed redundant code for ALWAYS bots.
  • v500.1g - added regionLock to stop people pinching the bot for their own region.
  • v500.1f - made menu automatically pop up after state proceed.
  • v500.1e - replaced SUCK emotion with CLEAR EMOS.
  • v500.1d - Replacing ALWAYS bots with ESCORT bots. Timer() seems to be preventing Emotions script working with ALWAYS bots, which is a function I want. Also having ALWAYS bots constantly on defeats the purpose of trying to prevent script crashes inherent with the old v3.04 series. Hence, added ESCORT botType which is a blend of TRIGGER to activate them, with LOVER functionality. redundant ALWAYS sections retained for legacy.

2018

  • v500.1c - corrected auto rebooting issues with ALWAYS bots - was 10 secs instead of botRevive, also added Timer() even to default to set it up.
  • v500.1b - added several ALWAYS functions and if statements.
  • v500.1a - fixed another multiple || issue which affected menus for LOVER bots.
  • v500.1 fixed an issue with Trigger bots responding like Sensor bots. Rearranged the order of if/else statements in listen() which is a problem that goes WAY back into the earlier codes but for some reason didn't play up. Hopefully all sorted now. The listen() also doesn't like multiple || in the if/else statements. Confuses it.
  • v500 - successfully combined the old 200, 300, and 400 series bots. One code set now does all so I've rebadged them all 500 onwards.
.[npcAction]

.[npcAction]

The purpose of .[npcAction] is to manage the transition of five variables for the NPC each time a new action sequence is called. These variables are animation, position, rotation, outfit, and facial expression. A sixth variable, "say" is plugged into the code (see sceneChange() function) but currently unused.

2025

  • v602 251125 - gave tgChan listen abilities to SENSOR mode NPCs in state_entry as experimenting with long-staggered Sensor NPCs on DreamGrid rather than waiting for TimeGen births to cycle through if I'm only online briefly.

2023

  • v601 230824 - optionally combines region-wide comms channels.
  • to upgrade from v600, replace state_entry, and remove llListenRemove as noted below. If changing to a single channel, in npcConfig600 card, make sensorChan same as tgChan and reboot.
  • in state_entry() added if/else statement to allow for using the same channel for TimeGen and Sensor NPCs.
  • combines the two channels with messages filtered by triggerWord variable.
  • overcomes issues with single-channel shower heads, props etc.
  • simplifies and reduces the number of listens on the region.
  • if/else statement allows for a separate channel for legacy sensor function if ever needed for shop models etc, though unlikely.
  • also removed llListenRemove(llListen(tgChan, "", NULL_KEY, "")) from listen event which was prompted to kill listen upon hearing triggerWord. Now that they are combined, we don't want that kill to happen, plus its effectiveness in the past was dubious anyway.
  • v600 230326 - requires .npcConfig600 notecard.
  • to upgrade from 500.1w, replace header down to and incl sceneChange().
  • no longer directly changes outfits
  • removes the need to load outfits notecard to free up memory.
  • instructs npcExist to change outfits via link_message same as npcEmotions.
  • added generic offline sequence with no emotion, delete online condition.
  • removed botLive check for emotions, instead added to npcEmotions600.
  • v500.1w 230318 - in sceneChange, added 'if (botLive ==1)' for newE.
  • removes unnecessary load from emote animations when NPC is offline.

2022

  • v500.1v 220126 - replaced section and added preamble to listen event.
  • allows temporary conversion of TG bots into TRIG,
  • eliminates the need for duplicating the same bot for different purposes.

2021

  • v500.1u 211229 - fixed error reading notecard line for "triggerWord".
  • v500.1t 211224 - changed loadSettings() to readCards(),
  • removed legacy sceneChangeTG() section,
  • removed legacy 'integer home' condition,
  • condensed overly complicated default sequence declaration,
  • created setValues() to establish default variables that used to be up in globals,
  • added detailed explanatory notes in-script re sceneChange() and patrol(),
  • shifted listen() to the very end of script to make it easier to edit events.
  • v500.1s 211223 - added .patrol() function loosely from .[Actor2.22],
  • kept alternative "plug-in" script .[npcPatrol] for possible future projects.
  • v500.1r 211215 - added extra lines around line 36 to read additional outfits implemented in .[npcExist500.2d]. If upgrading from .[npcAction500.1q], simply copy and paste the new outfit strings in globals, and loadSettings ().
  • v500.1q 211127 - added line to listens: if (msg == "tgDeath") { mainDefault(); } to return NPC Engine to default location when bot dies.
  • v500.1p 211123 - re-jigging scripts to allow new TimeGen4 to act as an NPC controller. Requires new notecard .npcConfig500.1x
  • v500.1o 210827 - removed llSleep() call previously needed before llGetObjectDesc(), from message_linked event, superseded by changes made in npcExist500.1v - this appears to have eliminated the sporadic offshore failed coms on bot startup/reset.
  • v500.1n 210826 - removed llSleep() calls from all actions.
  • v500.1m 210721 - updated to support .npcConfig500.1s
  • v500.1k 210621 - changed startup variables for float prevR and vector prevP (line 33 and 34) which I think are somehow causing some avatars to shoot offscreen or into sim corner at rez.
  • v500.1i 210114 - commented out if (timeGenActive == "NO") statement in state_entry. Unnecessary listen event.
  • v500.1h 210109 - adds "ALWAYS" option to main default.

2019

  • v500.1g 190107 - changed sceneChange to eliminate unnecessary script calls.
  • v500.1f - included clearEmos in endAnim. Added new/prevE strings for emotions, remove old clearEmos from mainDefault().
  • v500.1e - added CLEAREMOS to mainDefault() function.
  • v500.1d - reverted and renamed GUEST and VENUE.
  • v500.1c - added ESCORT botType. redundant ALWAYS sections retained for legacy.

2018

  • v500.1b - reverted to using function as too top heavy.
  • v500.1a - above didn't quite work. went deeper & modified state_entry & listen events instead.
  • v500.1 - modified if clauses in mainDefault function to exclude ALWAYS bots.
  • v500 - successfully combined the old 200, 300, and 400 series bots. One code set now does all so I've rebadged them all 500 onwards.
.[npcEmotions]

.[npcEmotions]

The .[npcEmotions] script provides facial expressions to the NPC via the parameters you set in each scene in the .[npcAction] script, and also via the blue menu generated by .[npcExist].

NPC Emotions enhances the mood of animation sequences instead of being limited to the standard null expression. It has no variables that need customising. The script receives commands from .[npcAction] and .[npcExist], and resets itself each time the NPC spawns or dies.

2025

  • v603 251102 - minor tweaks to support improved emotes list in .[npcExist603] menu.

2023

  • v601 230402 - fixed animation name error in Doze sequence
  • v600 230326 - removed llSleep() between endAnim and PlayAnim events
  • added Climax, Doze, Frown, Laugh, Lick, Rage, Shock, and Suck
  • new anims accessible from npcAction but not from npcExist menu.
  • added botLive check from npcAction.

IruMoto sign

If you have any questions, feel free to contact me via the contact form.

Have a brilliant day,
Andrew (Thommo) Thompson, a.k.a. Xay Tomsen

Andrew at Man Thing Follow Andrew Thompson on Instagram Follow Andrew Thompson on Pinterest Follow Andrew Thompson on Strava Follow Andrew Thompson on X Follow Andrew Thompson on Facebook Andrew Thompson on YouTube