Showing posts with label sci fi moo. Show all posts
Showing posts with label sci fi moo. Show all posts

Sunday, October 16, 2016

Tutorial: Exporting JSON from Hellcore for use with jquery Datatables

* Step 1: HTML or PHP template page

 You will need jquery and datatables, which can be downloaded to your local folders. These will be included in our PHP pages later. Let's say we want to display all weapons, here is the template (HTML or PHP). You must replace $weapons_db with the actual OBJNUM of your weapons database:

<html> <head><title>Weapons Table</title> <script src="/lib/jquery-3.1.1.min.js" type="text/javascript"></script> <script src="/lib/datatables.min.js" type="text/javascript"></script> <link href="/lib/datatables.min.css" rel="sylesheet" type="text/css"></link> <script type="text/javascript"> $(document).ready(function() { $('#weapons').DataTable( { "ajax": "http://yourdomain.com/query.php?objid=$weapons_db" } ); } ); </script> </head> <body> <table class="display" id="weapons"> <thead> <tr> <th>ID</th> <th>Name</th> </tr> </thead> </table> </body> </html> * Step 2: PHP ajax page

 Query.php is a PHP file that queries the MOO server on port 8080. This is already setup by default in hellcore, but you need some modifications, firstly to $json_utils:_www
$json_utils:"_www _html"       this none this
     try
       wargs = $su:explode(args[1], "/");
       if (length(wargs) > 1)
         item = toobj(wargs[2]);
         if (gamevalid(item))
           data = item:_json();
           return {data};
         endif
       endif
     except e (ANY)
       $rpg:report_error(e);
       return pass(@args);
     endtry
   return pass(@args);
This changes the $json_utils:_www verb to accept an additional objects. Now let's make query.php: You must replace $json_utils in the code above with the actual object number of your JSON utils object. The code above means that we call json_utils, and we pass it an additional argument in the form of: yourdomain.com:8080/$json_utils/desired_objectnumber

 * Step 3:
Now - our desired_objectnumber must have _json verb, and it must return formatted json (not HTML). Note that the data is structed very specifically to comply with jquery datatables. Example:
$weapons:_json
w = $ou:fertile_branches($weapon);
data = [];
data = ["data" -> {}];
for x in (w)
  id = tostr(x)[2..$];
  d = data["data"];
  d = setadd(d, {id, x:name()});
  data["data"] = d;
  yield;
endfor
return $json_utils:encode(data);

* Step 4: Getting JSON from our MOO server
http://yourdomain.com:8080/query.php?objid=$weapons
Will now return JSON output, something like this (partial): {"data":[["13477","generic melee weapon"],["14111","shock baton"], This has hopefully given you some hints for exporting this data. Modifying it, in MOO, on the fly, is also possible, with callbacks in datatables, but is more advanced. If you get the basics working, you'll see something like an auto paginating page like this:



*Step 5: Security
Use iptables to ONLY allow requests to query.php, and yourdomain.com:8080 from your own domain. Google this!
Questions? Comments?
Post them below!

Wednesday, September 9, 2015

The return of bat-wing scanjets

Another Hellmoo/Wayfar crossover promo!  Write a review on any MUD site or blog for Wayfar, negative or positive, and receive neat rewards in both games!



This early item has finally been modernized and updated.

New gadget display:

Monday, July 28, 2014

7/28/14 Updates

- Assorted buffs to harvesting tools.
- Adjustments to civilian collection behavior and sanity checks, etc.
- Chop shops got buffed and their reference to acceptable chopping targets is now on a $worldgen property list and not a hard-coded one. You can now chop armor, weapons and gadgets for their constituent goodies (if they have any).
- Foods got restructured and a few new food items were added.
- Various pirate loot containers got buffed and a few new ones added, the newer armor/weapons are now included in the drop lists.
- Small escort vehicles (The 8T-RL escort vehicle) now come with a heavy machine gun mounted by default, it's not as powerful as the autocannon equivilent using the same ammunition but it'll do in a pinch.
- The 8T-RL escort vehicle now has a child vehicle the 8T-BL fast attack vehicle which is slightly slower but has greater integrity and fuel capacity.
- A bunch of minor changes to properties and descriptions for balance purposes and the removal of typos, etc.

On top of all that, I've recently been mucking around with the Unity3D engine, favoring the 2D side. I'm just getting to grips with all the important classes and getting used to the C# language (MOOcode handles public/private status and classes in another fashion) but I'm making fairly decent progress with a little 2D shooter platformer thing as a testbed.


Thursday, March 6, 2014

03/06/13 Updates

Aphteroid here, some pretty important development has been going on recently and some of the things produced have opened up large areas of possibility for the game. If you think the game has already got a lot of depth, think again- we're only just getting started.

Here come the updates:
- Major restructuring of how planets and npcs are hibernated, planets are now hibernated per-sector which allows for just small areas on each planet to be active at one time which cuts down on unnecessary simulation. $heart was also modified to reduce unnecessary calls to :creature_heartbeat, both of these changes have resulted in massive improvements of CPU usage and we now run less than 10 $heart queues rather than the 80+ we were running previously, I doubt more than 20% of all NPCs will be active at any one time between each 15-minute hibernation run. Kudos to ASM for these changes, I wouldn't have been able to sort out the mess of hibernation I'd made.

- Experimental pirate pilot AI has been developed, a fitting mechanism to spawn pirates has yet to be formulated but the relatively simple AI module has displayed capability of finding, chasing and then attacking a target in space using their ship. Given the way the module works, it could easily allow a robot to perform these tasks in future.
- Starships that explode in space now leave debris that can be collected with an asteroid miner, they contain various materials including minor components of the former starship.
- Asteroid mining has received an update which allows for resources which aren't raw materials to be mined, and the quality of said items is based off the random quality range of the constituent materials weighted towards the percentage of complexity they provide.
- A new building decay/abandonment mechanic is now in place which abandons your buildings if you haven't connected for over a year, this is to clean up unused objects. Players will receive in-game mail to warn them if their stuff is going to be abandoned soon to give them time to respond.
- Maximum health is now determined via a :health_max verb on players to stop problems arising from changing the player's .health_max property such as permanent modification of maximum health.
 - The status and gear readouts have both had work done on them to make them more informative and provide clearer information.
- Item drops can now be formatted as a set of mutually exclusive items (such as a scavenger rat dropping either a wild hide OR a fur hide) dropped in the same roll, pirates have now had their drops condensed into many of such sets and have had their inventory drop chances nerfed.
- Travelling traders now respect the true value of items they sell, this includes respecting the value of contents inside any containers they are selling.
- Civilians will now wear any gadgets you give them and judge new equipment you give them more intelligently (they still need a longer and more precise routine to compare and decide between two pieces of armor though).

- NPC factions no longer build sector centers and thusly no longer have civilians as members of their faction, this is partially due to hatred cascades where the civilians would end up fighting (and losing to) the faction units for some reason. This also reduces the number of (perhaps unnecessary) civilians chewing up CPU.
- Weapon modules are now available on blueprint chips, these provide fixed bonuses to the weapon they are installed to and all of them have had descriptions set before release (thanks to Endre for the descriptions). It is likely crafted weapon modules will increase in usefulness with higher quality later.
- Tractor beams can now manipulate virtually any ship, and will take differing numbers of stages depending on the size of the ship involved.
- Robots now have a remote inventory command which will tell you what they are carrying.
- Many new implants are now available from black market stores, some are bonus implants and others dispense a useful drug.
- Radiation sickness and rad-shield drugs in the works to make radiation more interesting. (Finished as of 03/07/13).
- You can now load starships into a solar carrier whilst it is landed, useful for scooping up stolen asteroid miners for chopping.
- Datapads for recording notes are now much more stable, you can write, read, list and delete notes on it to your leisure.
- Updates to fuel cells to make them keep any charges left over if the starship is full of fuel when they are used.

Development is continuing at a steady pace, I imagine there's some good things in store for the next few months. Keep tuned folks.

Tuesday, November 27, 2012

Updates 11/27/12

* bug fixes, ideas implemented, and general cleanup:

* main weapon room for large ships:
Intruders can hack this room to halt or dissipate the main weapon charge.  The main weapon can be recharged by crew or players with the starship engineering skill.  The more engineers present the faster the main gun will recharge.
 * More guides added to the website
 * Cleaned up indoor map display and spruced up the dreadnought interior:

 * ranger background's hunting skill is now useful:

Tuesday, October 9, 2012

Updates 10/9/12

* web integration fixed!
* regen chamber for vehicles and starships, allowing players to register for their next respawn at the chamber's location:

* Snap shot as biomes continue to develop:

Tuesday, September 18, 2012

Changelog 9/18/12

* Starship hulks!
* Respawn terminals for returning to starships, moons, etc
* Supply Expert skill command - REQ (allows the player to requisition items in the field):

* Quality control skill command - INSPECT (allows the player to view blueprints a material or component is used in):

Thursday, August 30, 2012

Updates 8/30/12

* moved to a new server for half the cost with double the RAM
* added airlock doors to some starship interiors, allowing you to vent anything in the airlock into space
* added ship intercoms
* a multitude of spawner improvements, mainly to support & implement a full 3d on demand spawning for digging and climbing.  Which does work at last:

* a variety of other random fixes
* digging in it's most basic form:

* new job for linking solar systems with a warp gate
* added two new solar systems
* security cameras are now available on the electronics processor tool:


* new starship for constructing space deployables:

Monday, July 30, 2012

Changelog 7/30/12

* new shot of the on demand status, which has been running quite nicely for the last month or so.  Next up is making it three-D to handle the underground.  Altitude simulation is in as well!

* added vehicle painting customization:

* added the first pvp claimable - a fusion bomb (yes i did get this idea from the dark knight rises).  After a 12 hour delay it scours the land nearby.  A good way to get rid of buildings:












* Aphtonites implemented air support for npc invaders and buffed up SCUDs, among other internal changes.
* Death taunts - now on laffnet!


Tuesday, July 24, 2012

Update update for 7/23/12

Most of these updates are courtesy of Aphtonites - here are the two I've been working on when I catch a break from real work and going under the dentist's knife.  In addition Adminski has done some excellent work on immersive descriptions and even a little sane community building 8)
* new server configured
* some progress on implementing CheechLizard's much cooler website design

Aphtonites updates:
* New discoverables, including tier 1.5 materials
* A slew of new weapons and armor
* New starships, starship weapons, and tanks (~!)
* vehicle dealers!
* salvaging!
* upgrades to attacks, landings, and various space actions
* NPC factions that build and expand on their own
* Space upgrades of all kinds

* Massive upgrades to the economy, full trade system, fully operational bulk buy/sell options:
* Sniping!



Monday, July 2, 2012

Changelog 7/2/12

* Aphteroid asked me to post some of his changes in the dev blog too. I was going to, but there were so many it would take too long.  Several dozen fixes and additions: for flyers, new explosives and gas masks, bandages, dropped loot, more.
* Apht fixed cockpit view for instance:

* re-implemented HellMOO $decal objects and added the first decal, which of course is a nice scorch mark from your drop pod
* a whole lot of improvements and bug fixes to the spawner:







* weather revamp:
two cloud fronts with rain in the middle

northern clouds / weather shift after update

clouds to the southwest, rainfall off the coast
forest in the middle of the clouds on FROG-1322



Wednesday, June 27, 2012

Changelog 6/27/12

* flyers vehicles and most normal things now work perfectly on the new on demand planets
* new look for flyer cockpits:
* Some larger planets, too big for screenshots: CT-732 Planet Map, IT-1067 Planet Map, WY-1444 Planet Map
* a double (21 x 21) sized minimap for running around in the wilderness:

Tuesday, June 26, 2012

Updates 6/26/12

* multiple bug fixes to shops, wilderness, and creatures
* Aphtonites implemented a loan terminal for takin out those loans for new tri-d screens that you don't really need
* implemented inferno pistol on the equipment tool
* implemented maxi-melter ranged weapon with ammo


* new ammo supplier job
* completed the $api.claimable, $api.claimable.implementation, $actions.claim, and $actions.abandon to implement a non hacking based PVP claiming mechanic.  The air scanner pictured below is the prototype:



* uploaded rough draft of $api.claimable to: modular-moocode @ google code
* rough draft of the $ods/on demand spawn system for dynamically spawning rooms: