|

Atpaw's MPI code

Authenticate II - Simple modular 'authorisation' code for starship controls.

Mr Cloak - 'Morph'-style MPI program for starships.

 


Authenticate II

This is a much more modular, tidier and sleeker version of Authenticate, which was perhaps my first MPI 'program'. Authenticate was written for the CSA Raenne Corvidae, my first ship on FSM, to help prevent people from just walking on in and stealing the ship while people were offline. I never released the code for Authenticate because it was direly clunky and very inefficient - twenty if-thens one after the other. A few other features were added, too, such as announcing what ship the docking port was attached to, giving a random cabin temperature at around 295 degrees Kelvin, and a few other boring things.

Then one day a friend asked me if I could build a ship for him, and really really liked the idea of Authenticate.. and shortly thereafter his ship was fitted with the very first 'copy' of the now-fit-for-human-consumption authentication code.

Just a note - The docking-port code may not work at all on other MUCKs - in fact I'm quite certain it won't work, so if you're going to use this code elsewhere you may wish to the relevant bits, lest you receive many errors from a very confused MPI program.

Yeah, Authenticate II's not much, and I'm sure it could be improved upon - but it's relatively compact, simple, and very easy to maintain.. And that's all that matters to me.

 

--------------

Locking your 'fly' action:

@lock fly=locked:1 (This means the 'fly' action will be unlocked whenever the property 'locked' is set or stored to '1')

@set fly=locked:1 (To unlock it for the time being)

@fail fly=The computer beeps at you angrily. "The flight system is locked. Please authenticate your command over this ship" [authenticate]

@ofail fly=tries to activate the ship's systems, but a soft metallic voice informs %o, "The flight system is locked."

--------------

Installing the 'authenticate' action:

#AUTHENTICATE is the #DBREF of 'authenticate'.

@action authenticate=here

@link authenticate=$nothing

@succ authenticate=You ask the computer to authenticate your command.{if:{eq:authentic/_{name:me},{listprops:authentic,#AUTHENTICATE,_{name:me}}},{exec:authentic/_{name:me},#AUTHENTICATE},{exec:authentic/_badname}}

@osucc authenticate=asks the computer to authenticate %p command over the ship.

----------------

Example prop:

#DPORT is your docking port's #DBREF

#FLY is your fly action's #DBREF

NAME is a player-object's name. (ie: 'Atpaw')

@set #AUTHENTICATE=authentic/_Atpaw:{null:{delay:1,{lit:{otell:A synthetic voice says\, "Authenticating.... Authenticated. Welcome to the bridge\, Captain Atpaw Xavier. All systems are nominal\, and reactor temperatures are within acceptable limits\. Internal ship temperature is a moderate {add:293,{dice:5}} degrees Kelvin\, and we are currently docked to {if:{prop:~dock/ship,#DPORT},{name:#{prop:~dock/ship,#DPORT}},no vessels}}."}}}{null:{store:1,locked,#FLY}{null:{delay:2,{lit:{otell:The ship's control systems chirp\, to show they have unlocked.,#AUTHENTICATE}}}}}

 

If Atpaw then tries to Authenticate his command over the ship, the following will occur:

(Spoofed into the room he's standing in) A synthetic voice says, "Authenticating.... Authenticated. Welcome to the bridge, Captain Atpaw Xavier. All systems are nominal, and reactor temperatures are within acceptable limits. Internal ship temperature is a moderate 297 degrees Kelvin, and we are currently docked to no vessels."

The fly command is unlocked.

(Spoofed into the room he's standing in) The ship's control systems chirp, to show they have unlocked.

 

You will need greeting prop for each person you wish to be authorised to unlock the controls. So, one for Atpaw, one for Jayson, etc etc etc. Customise the general one (written below) and @set them all. This is very modular - if you want to add a new person, just add a new prop. If you want to remove a person, just @set #AUTHENTICATE =authentic/_NAME: (one space, then hit enter) and they will no longer be able to 'take command' and unlock the fly action.

@set #AUTHENTICATE=authentic/_NAME:{null:{delay:1,{lit:{otell:A synthetic voice says\, "Authenticating.... Authenticated. Welcome to the bridge\, INSERT RANK AND NAME HERE. All systems are nominal\, and reactor temperatures are within acceptable limits\. Internal ship temperature is a moderate {add:293,{dice:5}} degrees Kelvin\, and we are currently docked to {if:{prop:~dock/ship,#DPORT},{name:#{prop:~dock/ship,#DPORT}},no vessels}}."}}}{null:{store:1,locked,#FLY}{null:{delay:2,{lit:{otell:The ship's control systems chirp\, to show they have unlocked.,#AUTHENTICATE}}}}}

--------------

Failure:

@set #AUTHENTICATE=authentic/_badname:{null:{delay:1,{lit:{otell:A synthetic voice says "Authenticating.... Failure. You are not authorised to command this vessel.".,#AUTHENTICATE}}}}

Feel free to change the text there, just remember to put a backslash (\) after any commas you add. (See the other examples)

------------

Disabling:

@action disable=here

@link disable=$nothing

@succ disable=You disable the ship's systems.{store:locked,2,#FLY}

@osucc disable=disables the ship's systems.


Mr Cloak 6000 - for holocloak ships and general prop-swappin' action.


The name comes from a fine tradition in computer program names, such as Mr Scan and Mr Photo. And like its cousins, it does the job efficiently, albeit with a simple interface and no really impressive features. Mr Cloak was written as a simple way to automagically change a starship's desc, name, species and scanout with a single command, since Morph and starships do *not* get along in any way, shape or form on FSM. Curiously, one or two furs on FSM used a slightly tweaked version of Mr Cloak to change their character's descs and so on, since Morph didn't have the features they wanted. Freaky. :)

This code, like most of my stuff, revolves around three pieces of mpi: Store, Force, and Exec (execute). These are described in the MPI Docs of the MUCK (info mpidocs and info mpidocs2), so if you don't understand how those MPI commands work, a read through the appropriate sections in the mpidocs should help a little.

And without further adu, on with the show.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Setting your ship's description to work with the cloaking device.

@desc #12345={eval:{prop:{prop:_mrcloak/currentdesc}}}
@set #12345=_sensor/details:{eval:{prop:{prop:_mrcloak/scanout}}}

(Where #12345 is your ship's DBref)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Installing the 'cloak' action.
Standing inside your cockpit/bridge room:

@open cloak=$nothing
@succ cloak={exec:_mrcloak/{&arg},#12345}

(This will make the cloak action execute a property which matches the argument you give the 'cloak' command. Ie: 'cloak uncloak' will execute the 'uncloak' property on the starship)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Adding the 'cloak modes'.
Replace the capitalised parts with text of your own. :)

@set #12345=_mrcloak/uncloak:{null:{force:#12345,pose PUT DECLOAK MESSAGE HERE}{force:#12345,@name me=NORMAL STARSHIP NAME}{store:_mrcloak/uncloakdesc,_mrcloak/currentdesc,#12345}{store:_mrcloak/normalscan,_mrcloak/scanout,#12345}{store:NORMAL SPECIES,species,#12345}{store:NORMAL DRIVE OSUCC,_drive/osucc,#12345}{store:NORMAL DRIVE ODROP,_drive/odrop,#12345}}

@set #12345=_mrcloak/pirate:{null:{force:#12345,pose PUT PIRATE CLOAKING MESSAGE HERE}{force:#12345,@name me=PIRATE VESSEL NAME}{store:_mrcloak/piratedesc,_mrcloak/currentdesc,#12345}{store:_mrcloak/piratescan,_mrcloak/scanout,#12345}{store:PIRATE SPECIES,species,#12345}{store:PIRATE DRIVE OSUCC,_drive/osucc,#12345}{store:PIRATE DRIVE ODROP,_drive/odrop,#12345}}

@set #12345=_mrcloak/stealthed:{null:{force:#12345,pose PUT FULL-CLOAKING MESSAGE HERE}{force:#12345,@name me=NORMAL VESSEL NAME[cloaked]}{store:_mrcloak/stealthdesc,_mrcloak/currentdesc,#12345}{store:_mrcloak/stealthscan,_mrcloak/scanout,#12345}{store:none,species,#12345}{store:CLOAKED-SHIP DRIVE OSUCC,_drive/osucc,#12345}{store:CLOAKED-SHIP DRIVE ODROP,_drive/odrop,#12345}}

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Adding 'cloak' descs.

@set #12345=_mrcloak/uncloakdesc:{list:normaldesc}
@set #12345=_mrcloak/piratedesc:{list:piratedesc}
@set #12345=_mrcloak/cloakdesc:{list:cloakdesc}
@set #12345=_mrcloak/normalscan:{list:normalscanout}
@set #12345=_mrcloak/piratescan:{list:piratescanout}
@set #12345=_mrcloak/stealthscan:{list:stealthscanout}

Then:
lsedit #12345=normaldesc (And enter your ship's normal desc)
lsedit #12345=piratedesc (And enter your ship's 'pirate vessel' desc)
lsedit #12345=stealthdesc (And enter your ship's fully-cloaked desc)
lsedit #12345=normalscanout (And enter your ship's normal 'scanout')
lsedit #12345=piratescanout (And enter your ship's pirate 'scanout')
lsedit #12345=stealthscanout (And enter your ship's cloaked 'scanout')

-------------------------------
Addendum:
* To use the cloak, just type 'cloak' followed by the name of the prop you want to select. Eg: 'cloak uncloak' 'cloak pirate' 'cloak stealthed' in the examples given.

* Remember to roleplay the holocloak/sensor-spoofer properly.. Ie: A fighter might have difficulty tricking sensors into thinking that the ship is actually an 800metre capital-ship, and vice-versa. Similarly, if you've landed your ship somewhere, and dismount, it might look strange when you exit through what appears to be a solid wing. :)

* For a handy 'current mode' reminder, put this in your cockpit/bridge desc: Current cloakmode: {name:#12345}

* The code is reasonably 'modular'. To add more 'modes', just make a new prop with the name you want, similar to the props used above (eg: uncloak). It must be placed in the _mrcloak/ directory.

* To remove a 'mode', just @set #12345=_mrcloak/MODE-NAME: (hit enter after the colon) This will reset the prop called MODE-NAME and remove it from the object.

One last thing - Your ship won't display a desc (even the 'uncloaked' desc) until you use the cloak action.