Small Devlog UpdateConversion to V8The conversion to google V8 is making a lot of progress, we can now run the code pretty well.
Currently though I need to go through develop a way to give V8 access to the game, Mozilla Rhino had built in access but they did this as part of the parsing step, and since Its pretty stupid to
parse -> convert -> parse -> run
My plan is to scan the code for "Java." and attempt to find classes and packages following that keyword.
So to make a new java string you would do:
- Code: Select all
var test = new Java.Java.lang.String
or a new Widget
- Code: Select all
var test = new Java.Haven.Widget
While this does make Java.lang calls a bit longer, it does reduce the amount of steps my pre-parsing stage has to do, so that Prime doesnt slow down V8 by holding onto your script for too long
PrimeAPI 2.0PrimeAPI is undergoing a massive overhaul. A lot of confusion on how things work, is mainly due to the major inconsistencies in how Prime handles the player versus objects for example. The API is being split into objects, as it should have been the moment we switched to JavaScript.
for example:
- Code: Select all
getCoords();
Returns the players coords, but in the other areas of the API we have to get the object or Item and use the Coords field as part of that object. So we now have everything under specific objects.
- Code: Select all
player.coords;
item.coords;
object.coords;
tile.coords;
it becomes very clear what the returned coords are for. it becomes very obvious what everything is suppose to be doing.
I have also re-wrote a lot of API interactions. We now longer have isIntersecting(Tile, Tile); Inventory tiles now have a built in function where they compare themselves to a given Tile, this reduces the amount of global functions, and allows you to have your own isIntersect function outside of the inventory slot object.
In otherwords, Prime is going to be a whole new version, as such it will require some script re-working. I will however be adding more functions such as the new equiptment object that allows you to list, unequipt and equip items. We are also going to be given the ability to disable rendering, a long requested feature. This feature may not be released until 2.1 however as I still want to give script writers the ability to present you with a Interface, and feedback so I may create some kind of manager that allows you to launch bots and users from a console/launcher specifically designed for nonrendered botting. I debated this for a long time, and may simply not remove rendering. Your thoughts on this are very appreciated.
Finally,
PathFinding Update:
While the amber Pathfinding has not been updated to include some many bugfixes, (and I can't be bothered to figure out what is going on in the pathfinding code amber is using) I am working on a JavaScript API pathfinder. One that will scan your area, and attempt to move around ridges. I may attempt to look for ridges that the player can climb as well, but for an imediate fix you can expect the new pathfinder when it launches to have some kind of understanding that ridges exist. So if you have a base like mine, you can expect that tree above your cave, not be harvestable without lots of confusing run around code