Posts by paulevs

    Only the size here bothers me a little. I would wish for something more subtle; something to look at to check conditions

    I want to make a config later, so I can add the size of different UI elements into it together with other parameters (for example ability to have built-in icons instead of custom or ability to toggle different bars)

    Good day, I'm interested how lights created with plugin API (especially with prefabs) will be handled by the game. If I'm understanding correctly the game controls amount of active light on the scene, so will lights from prefabs also be included in that counter? Or they will be separate and creating too much prefabs with lights will cause massive lags?


    Another question is about light shadows, due to light behaviour from some objects I can suppose that shadows are not recalculated per frame, but when neighbour objects are updated. Will this behaviour be applied to prefab lights?


    And the third question - is it possible to make light and control it programmatically from plugin side? I saw some methods that are probably related to it (that adds components to game object), but looks like they are not finished


    Hmm... which elements do you mean exactly? And which style change do they ignore specifically?

    Thirst and stamina ignores visibility, opacity, width and height:

    • HudLayer/hudContainer/statusContainer/rightContainer/statusIconContainer/thirstIcon
    • HudLayer/hudContainer/statusContainer/rightContainer/statusIconContainer/thirstIcon/thirstLabel
    • HudLayer/hudContainer/statusContainer/rightContainer/statusIconContainer/hungerIcon
    • HudLayer/hudContainer/statusContainer/rightContainer/statusIconContainer/hungerIcon/hungerLabel

    But their parent element - not, so hiding statusIconContainer will hide them too


    Bar container also ignore same style changes: HudLayer/hudContainer/statusContainer/statusBarContainer/barContainer

    So, I solved its visibility simpler - I just moved it far away, so it ignores tags above but it accepts position changes


    Another small question - how does the game handle when player heal broken bones status? I noticed that game changes it to another icon visually, but there is no any player data that store that information. I tried to handle that myself with rules like "when player had break bone, and now not, and his HP is not max then display fixed bones icon", but this is potentially incorrect logic. Probably I will just display built-in icons, but they also don't accept same style changes as above so it is hard to configure them

    This plugin will change status bars and icons for the player. The goal is to make player GUI more comfortable and informative.



    What plugin adds:

    • Bars for health, stamina, hunger and thirst
    • Custom icons for broken bones, bleeding and healed bones
    • Possibility to have built-in elements instead of custom (configurable for element type)
    • Customisation for custom elements (size, colors, etc)

    What is planned:

    • Bars for oxygen and armor
    • Icons for temperature and other effect


    Sources (MIT LIcense)


    Downloads:

    How to Install:

    Unzip archive into Rising World plugins directory (RisingWorld\_New Version\Plugins)


    How to update:

    Remove old plugin jar from the plugin folder and apply installation as usual (but with file override)

    Until that's implemented, you could try to use moveToLocalPosition() (which moves the element smoothly). It's still far from perfect, but it may be sufficient in certain cases (e.g. when moving lights)^^

    That works, thank you, but since it is hard to calculate speed for interpolation that looks like player is under attack of ball lightning :)


    If speed is too large all movements will be very "sharp", if too slow the light will require some time to reach the player. This can actually be a good way to create some flying companions that follow the player. I think I will try to calculate required speed based on previous point


    I'm working on my own Status UI plugin, so updating some player stats is important for it.


    I also have another question - how do make elements behave similar to built-in during screenshot capture? I mean that built-in can be hidden during screenshot and I'm not sure how to reach same behaviour


    Thank you, now I know all required paths :)


    I noticed one thing - some elements will ignore style changes, is this related to overriding style by the game itself during player value updates (like hunger)?


    Another thing that I notices is that stamina value in player is not updated correctly on server side, it is always 100 and if you will spend a lot can instantly change to 20 or other number, and then back to 100. Default player UI shows it correctly. Is it possible to get correct player stamina?

    I made a template for new API plugins, you can use it to quickly setup project and start making your plugins: https://github.com/paulevsGitch/RisingWorldPluginTemplate


    How to use:

    1. You need JDK 20 since Rising World uses same Java version for plugins.
    2. You need installed Rising World (Steam Version)
    3. Clone this repo (with git clone or with downloading as .zip).
    4. Change pathToRisingWorld variable in build.gradle to your Rising World root path (Unity version)
    5. Change group variable in build.gradle if necessary, it should be equal to your main package name.
    6. In settings.gradle change the name to your project label.
    7. Edit plugin.yml and add your credits. You can change main class path (don't forget to create/move main class if you will do this)
    8. Import project into your favourite IDE (IntelliJ Idea, Eclipse, Netbeans, etc.) and start making code


    Building plugin:


    If you are using IDE that has gradle integration you can just launch build task. If your IDE don't have such features open a terminal or cmd utility and use command /gradlew build.

    Your plugin will appear in /build/libs folder with same name as specified in settings.gradle.

    s it possible to destroy them or that they consists of different materials?

    Objects behave very similar to Java version, but in much more complex way. Basically in API you are working with GameObjects, which are technically Unity GameObjects, so they have hierarchy, different Unity components, colliders and materials. Objects can have different materials in submeshes or childrens and can be attached to each other.


    Objects can be added and removed for individual players, there are player.addGameObject and player.removeGameObject methods for that.


    You can load object from Unity Bundle, from external resource or from plugin itself. I'm not sure about the last two, but importing from bundle is very simple. You just need to make a bundle in Unity using this tutorial, load it inside you plugin with AssetBundle.loadFromFile method and use any prefab with loadFromAssetBundle method:


    Java
    private void createCrystalObject(Player player) {
    Prefab prefab = new Prefab();
    prefab.setPrefab(PrefabAsset.loadFromAssetBundle(bundle, "crystal_object"));
    prefab.setLocalPosition(player.getPosition());
    prefab.setLocalRotation(new Quaternion().fromAngles(0, random.nextFloat() * 6, 0));
    float scale = random.nextFloat() + 0.5F;
    prefab.setLocalScale(scale, scale, scale);
    player.addGameObject(prefab);
    player.sendTextMessage("Crystal summoned!");
    }

    Object collider is visible for entities and other things:

    Could they be available inside the crafting menu or as building

    Looks like no at this moment, but if we will get ability to register default types of objects (like plants and furniture) with definitions it will be possible. Right now you will need a custom GUI, key, command or another way to create them. For example for my tests I used chat messages:

    Hi, I wan to change some internals style for player GUI elements with overwriteUIStyle, but looks like there is no list of default game GUI element names. I tried to find something, but failed. What are the names for default elements?

    Light that moves together with player. The movement is a bit weird since object get updates with PlayerChangePositionEvent.


    So, I have a suggestion for the API: access to the camera GameObject, this will allow to attach an object to player and object movement will be smooth, or the object will have fixed position related to the camera - it will be very useful for custom skyboxes or other similar effects


    Den onEnable Event bekomme ich [Java] Hallo
    Aber die anderen beiden Events bleiben Still, mache ich was falch bei der Inizialiesierung?

    You need to add listener during onEnable:

    Java
    @Override
    public void onEnable() {
    System.out.println("Enabled!");
    registerEventListener(this); // That one
    }

    Terrain is stored inside voxel grid aligned to main axises, due to that any blueprint that contains terrain can be rotated only on 90 degrees