Tuesday, April 22, 2014

Release 0.97



Version 0.97 is ready. What new:

In game engine:
- Changed version of MVEL2 library and managed to get it working on the Java 8 JRE. But this is done by switching off some optimization so on Java 6 or 7 it probably will work faster then on Java 8 (java version will be detected by game engine and selected suitable mode for MVEL lib automatically.)

- Basic version control for patching (save loaded form the previous versions can be detected much more easy now)

- Reports about error in script processing is more detailed now, and they also written in the file "session_errors.log". This file is cleared automatically at the game start, so if you need this error report - copy this file elsewhere before you restart game. File is plain text, can be opened with notepad.

- Support for the List and Map native java collections. To use them in the script you need to create objects of this type first. Use construction like this:
mylist =  NewList();
mymap = NewMap();
After it you can work with created object by the native java methods. Documentation:

Take note, in the MVEL2 you not need strict type following, but all variables still have type. So, for example, if you get from list or map object of Creature type (game characters) but try to use it as something other there can be errors in the executing scripts.  

- Global universal storage for objects. Technically it's Map-like object saved in the game save with other data. Access to it can be done through this functions in any scripts:
Object AddObject(String key, Object obj) - added object obj with key, if matching key already exists - replacing object and returns previous object with this key. If matching key not present returns null.
boolean IsObjectExists(String key) - return true if matching key present in storage.
Object GetObject(String key) - returns object with matching key or null if key not present.
Object RemoveObject(String key) - removing object with matched key, return removed object or null if key not found.
As you see - it's quite like normal native Map, but with restriction - keys for it can be only Strings. But you are free to store in the storage you own normal Map's created by NewMap(); functions - they not have this limitation. Storage will be saved and loaded (in the game saves) normally with all hierarchy of nested objects.

- Scripted effects that loaded from a file by the .loadEffect("effect_name") method will be updating  scripts automatically after loading a saved game now (if scripts in these effects files is changed). Values of these effects will be not affected - only scripts.


In game content:

- Adaptation for the new version of the MVEL2 lib. If some custom content show errors now, it will mainly about this issue:
<% ctv=proxy; Include("cview/full_description");%> - construction like these, with using Include right after setting variables to use in them is illegal now. You need to split this script in two:
<% ctv=proxy; "";%><%Include("cview/full_description");%> - "" in first part here used to suppress unwanted output ("last variable/value shown" rule).

- Some minor fixes and additions.


Saved games should be fully compatible.

pass: fmaster

3 comments:

  1. +++ Game time: Day: 909, 8:00
    ===============================================
    Compiled script error! Look in script:
    GetFoetusGeneText (c, 0, "generic.race") == "t_beast";
    -----------------------------------------------
    [Error: GetFoetusGeneText (c, 0, "generic.race") == "t_beast";]
    [Near : {... GetFoetusGeneText (c, 0, "gene ....}]
    ^
    [Line: 1, Column: 1]
    -----------------------------------------------
    Current variables context: 2b5b32e2-bffb-435c-bbdb-78414bd48523 Used: 52 time(s).
    -----------------------------------------------
    {player=Player, age 0y.o., GeometryCalc=class fetishmaster.utils.GeometryCalc, activePartner=Daisuke, age 29y.o., self=null, calc=class fetishmaster.utils.Calc, its=null, debug=class fetishmaster.utils.Debug, workers=[Daisuke, age 29y.o., Ruka, age 26y.o., Chiasa, age 20y.o., Misaki, age 31y.o.], consumer=null, This=null, interCalc=class fetishmaster.interaction.InteractionCalc, icalc=class fetishmaster.interaction.InteractionCalc, proxy=Daisuke, age 29y.o., map=class java.util.HashMap, Geometry=class fetishmaster.utils.GeometryCalc, GeneProcessor=class fetishmaster.bio.GeneProcessor, enemy=null, iTarget=null, c=Vicky, age 24y.o., creature=class fetishmaster.bio.Creature, status=class fetishmaster.engine.scripts.Status, clock=fetishmaster.components.GameClock@104a0e8, agency=class fetishmaster.engine.scripts.Agency, list=class java.util.ArrayList, game=class fetishmaster.engine.GameEngine, selectedWorker=Daisuke, age 29y.o., CreatureProcessor=class fetishmaster.bio.CreatureProcessor, Calc=class fetishmaster.utils.Calc, geometry=class fetishmaster.utils.GeometryCalc, Creature=class fetishmaster.bio.Creature, item=class fetishmaster.items.ItemProcessor, world=class fetishmaster.engine.scripts.WorldScripts, characters=[Daisuke, age 29y.o., Kiana, age 20y.o., Vicky, age 24y.o., Belanika, age 28y.o., Mira, age 21y.o., Romul, age 31y.o., Ruka, age 26y.o., Chiasa, age 20y.o., Misaki, age 31y.o., Merril, age 20y.o., Nanami, age 24y.o.], Agency=class fetishmaster.engine.scripts.Agency}
    ===============================================

    ReplyDelete
    Replies
    1. Okay, I can see what exactly caused error, but I still can't guess how you managed to get it. :)
      Please tell me what you done before seeing it, and if you have a saved game that can be used to replicate error it will be useful too.

      Also full session_error.log will be more useful then just single report from it too.

      Delete
    2. Oh, maybe I'm found possible cause. I'll creating a patch now.

      Delete