Posts by red51

    Das liegt dan doch am ClassLoader, ich/mann kann keine Klasse erstellen

    Jap, das wird in der Tat am Classloader liegen :thinking: Der Teil hat sich generell geändert (da der System-Classloader seit Java 9 kein "URLClassLoader" mehr ist, die alte API aber auf einen URLClassLoader eingestellt war). Ich werde mir das nochmal genauer anschauen, das wird ein lösbares Problem sein ;)

    Hmm... eigentlich sollte das funktionieren :wat: Bekommst du denn ein "Plugin" Objekt zurück, wenn du einfach nur das Resultat von "getPluginByName()" ausgibst (also ohne zu casten, quasi einfach so: " System.out.println("Plugin: " + getPluginByName("ConfigManager"));), oder ist das null?


    Es scheint nämlich eher ein Problem beim Casten des Objektes vorzuliegen :thinking: Das könnte ggf. mit dem Classloader zusammenhängen... das müsste ich mir sonst nochmal genauer anschauen :monocle:

    Das ahbe ich mal gemacht:

    Das sieht eigentlich korrekt aus :thinking: Ich habe es bei mir mal mit deinem Code getestet (allerdings direkt ein Bild von der Festplatte verwendet) und es funktioniert soweit eigentlich... es könnte sonst höchstens am Laden aus der Jar liegen, möglicherweise funktioniert das sonst nicht richtig :wat:


    Probiere evtl. mal ein Bild von der Festplatte zu laden. Oder testweise von einer URL, zB TextureAsset ta = TextureAsset.loadFromURL("https://images.rising-world.net/media/update/api/plugin_api3.jpg");


    Funktioniert es dann?


    Und bild.style.borderTopColor.set(col.getRGB()); will auch nicht klappen :thinking:

    Es scheint in deinem Code, als wenn du das java.awt Color Object verwenden würdest ? Die "getRGB()" Funktion gibt leider keinen Alphawert zurück, daher wird die Border in deinem Fall wohl einfach unsichtbar sein ^^


    Verwende am besten das neue ColorRGBA Objekt (das kann auch direkt dem Styleproperty übergeben werden, ohne, dass du es zu einem int umwandeln musst) ;)

    It's indeed a bit tricky to get the names/paths of the built-in UI elements... for this reason we've added a small tool which can be enabled by typing uidebugger into console - it shows the path of the currently hovered element in the top left corner of the screen ;)

    While this tool is active, you can also rightclick on an element to copy the UI path to clipboard. To close the tool, just hit the X in the top left corner (if you can't hit it properly, press ESC and try to hit it again).


    This enables you to get the paths of most elements ^^ For instance, the path to the inventory background would look like this: InventoryLayer/inventoryContainer etc.


    Unfortunately you can't access all elements this way. To overcome this limitation, you could also type uidebugger <layername> into console - this prints the paths of all elements on a particular layer into console.


    But if there is a particular UI element you're looking for, just let me know and I can post the path here :)

    Der "Pointer" ist im Grunde die Memoryadresse, an der das native Event liegt (also das eigentliche Eventobjekt, von dem das Java Event sich lediglich die Daten holt) ^^


    Wenn du eigene Events erstellst, dann ist der Pointer eigentlich egal. Wenn du also direkt von "Event" ableitest kannst du da einfach eine 0 angeben. Vll bieten wir noch einen zweiten Konstruktor ohne Pointer an (der dann intern allerdings auch nur eine 0 zuweist)^^


    Problematisch wird es nur, wenn du von einem existierenden Event ableiten möchtest (zB von PlayerEvent) - das wird leider nicht funktionieren, daher dürfen eigene Events nur von der Basis "Event" Klasse abgeleitet werden ;)

    Du meinst bei der Java Version wahrscheinlich das "StaticModelLoader" Beispielplugin? Leider gibt es das für die neue Version noch nicht... zeitlich hatten wir keine Kapazitäten, die noch umzuschreiben (für manche der Beispielplugins fehlt aber auch generell noch etwas Funktionalität [zB Schilder], was erst mit dem nächsten Update erscheint).


    Momentan muss mal also ein eigenes Plugin schreiben, um Modelle zu laden. Der Support der API für eigene Modelle ist wesentlich umfangreicher und mächtiger als in der Java Version, aber es führt noch kein Weg um ein eigenes Plugin herum. Wir werden aber in absehbarer Zeit aktualisierte Beispielplugins bereitstellen (sodass man auch ohne Code Modelle laden kann) ^^

    Ich habe noch ein Fehler beim Laden der javadoc, ich benutze NetBeans 15 aber daran sollte es doch eigendlich nicht liegen

    Ich fürchte das liegt tatsächlich an NetBeans 15 :/ Wir haben die 15 zwar nicht direkt getestet, aber unter NetBeans 12 tritt genau derselbe Fehler beim Einbinden des Javadoc auf (generell hatte NetBeans 12 Kompatibilitätsprobleme mit Java 20)... mit NetBeans 17 kann ich das Javadoc hingegen korrekt einbinden :thinking:

    A small hotfix is available now btw! It fixes a bug with the creative mode F8 tool and also fixes the animal footsteps (which were too loud) :saint: This update is optional for multiplayer servers.


    Hotfix (2023-04-13):

    • [Change] Removed unnecessary (but harmless) API error message when starting a server
    • [Bugfix] Fixed crash when using the creative-mode F8 tools
    • [Bugfix] Fixed "edit texture" command not working correctly
    • [Bugfix] Fixed animal footstep sounds being too loud

    Ein kleiner Hotfix ist nun übrigens verfügbar, welcher vor allem Probleme mit dem F8 Tool im Creative-Modus behebt, und ebenso zu laute Schrittgeräusche von Tieren behebt :saint: Für Multiplayer-Server ist dieses Update optional.


    Hotfix (13.04.2023):

    • [Geändert] Unnötige (aber harmlose) Fehlermeldungen der API beim Starten des Servers entfernt
    • [Behoben] Crash beim Benutzen des Creative-Modus F8 Werkzeuges behoben
    • [Behoben] Den "edit texture" Konsolenbefehl korrigiert
    • [Behoben] Zu laute Schrittgeräusche von Tieren behoben

    Ich habe schon TextureAsset.loadFromPlugin gefunden, aber wie bekomme ich das in ein UIElement
    Geht das nur über .addStyleSheet(StyleSheetAsset.loadFromAssetBundle(bundle, path));

    Nee, die StyleSheets sind nur relevant wenn du USS Dateien in Unity erstellen möchtest und dann in die API laden willst ^^ Die kannst du ansonsten ignorieren, das ist ein rein optionales Ding.


    Um einfach nur eine Textur auf einem UIElement anzuzeigen, musst du das auf style.backgroundImage setzen, also zB so:


    Java
    //Load an image from a plugin resource
    TextureAsset image = TextureAsset.loadFromPlugin(this, ...);
    //Create new UI element and assign the image
    UIElement panel = new UIElement();
    panel.style.backgroundImage.set(image);
    //Add element to player screen
    player.addUIElement(panel);


    Generell werden in der neuen UI viele Dinge über das style eingestellt. Es gibt zwar ein paar Hilfsfunktionen (setPosition(), setSize(), setPivot() etc), aber unter der Haube rufen die auch nur style auf.


    Grundsätzlich ist das Style an Unitys IStyle Interface orientiert: https://docs.unity3d.com/Scrip…ce/UIElements.IStyle.html

    The standalone download should work now, but I'm glad to hear you already managed to fix the issue ^^


    Also, does the Plugin API have acces to the digging action?

    Does than mean you want to get notified if the player is digging, or do you want to modify the terrain through the API? If you want to get an event, the PlayerDestroyTerrainEvent is probably what you're looking for :)


    However, modifying the world through the API isn't possible yet, unfortunately that didn't make it into this update... but the World class will get some methods for that with one of the next updates ;)

    But with: import net.risingworld.api;


    I get a package net.risingworld does not exist?

    Hmm... does that mean the line in question is just import net.risingworld.api;? In Java it's always necessary to specify the class you want to import (e.g. import net.risingworld.api.Server;), otherwise it won't work unfortunately. If you want to import the whole package, it would be import net.risingworld.api.*; etc. ;)


    If that doesn't help, could you maybe share a screenshot of the error you're getting?


    On the screenshot it also looks like you're using an older version of netbeans, is that correct? I ran into issues using an older netbeans version after upgrading to JDK 20 (apparently my old netbeans version wasn't compatible with the latest JDK). Maybe it was specific to the version I was using, IDK, but if you run into any other issues, it may be necessary to upgrade to the latest netbeans version ^^

    Thanks for your feedback so far! :)


    Thank you for an epic update and nice working API :)

    [...]

    Thanks a lot, this looks amazing btw! :wow::thumbup:


    I cant update the standalone variant for the new update. whenever I enter the game, the version remains the same (0.6.0.3) even though I checked files. I even tried redownloading the game alltogether. What should I do?

    It looks like something is broken which prevents the standalone from downloading the update automatically (considering this already happened with the last update) :wat: I'm sorry about that, this shouldn't have happened, but thanks for bringing this to our attention! We'll fix this issue ASAP!


    The Steam version works as intended, the standalone version is the problem. If I copy the files from Steam to standalone, will it work?

    Yes, basically that should work, but it may be necessary to delete the "steam_api64.dll" in the "Data/Plugins" folder manually (otherwise the game may think it's a Steam version)^^

    leider fehlt mir das wichtigste in der API. Das Sign-Object. ;(

    Wann wird dies in der API sein?

    Naja, leider gibt es in der neuen Version noch keine Schilder, daher auch noch nichts in der API dazu :/ Die Schilder werden aber mit dem nächsten Update kommen, gleichzeitig wird das dann auch in der API exposed^^


    Wird es in der neuen API auf wieder möglich sein mit World.createNewStorage(int slots) eine neue imaginäre Truhe zu stellen?

    Die Storage API ist leider noch nicht ganz fertig, aber das wird auf jeden Fall wieder möglich sein ;)

    Darf man mal ganz zart nachfragen, in welchem Update Raubtiere wie Bären und Wölfe zu erwarten sind. Mir fehlt zu meinem vollkommenen Glück nur noch dieser kleine Hauch von Wildnis. :D

    Bären werden vermutlich mit dem übernächsten Update kommen. Wir wollen das nächste Update einigermaßen zeitnahe rausbringen, aber für aggressive Tiere wären noch ein paar Nahkampfwaffen und ggf. auch Pfeil & Bogen / Armbrust wichtig (das würde wohl fürs nächste Update zu knapp) ^^


    Wölfe hingegen werden wohl noch etwas länger auf sich warten lassen... wir wollen für Wölfe eigentlich gerne ein etwas komplexeres Verhalten einbauen (und sie nicht einfach zu stumpfen Gegnern degradieren) ;)

    Wird es denn auch die Silvesterrakete zurück ins Spiel finden? Sieht zumindest Toll aus der Effekt :P

    Hehe, du hast tatsächlich richtig erkannt, dass der Effekt auf dem 2. Bild das Feuerwerk ist, welches wir vor langer Zeit schonmal vorbereitet haben (welches es aber noch nicht ins Spiel geschafft hat) :D :saint:


    Aber ja, die Silvesterrakete wird auf jeden Fall wieder kommen ;) Wir haben es leider letztes Jahr nicht mehr zu Silvester geschafft, aber dieses Jahr wird sie hoffentlich rechtzeitig ihren Weg ins Spiel finden^^

    These errors are basically harmless, they're about API methods which haven't been implemented yet. You can ignore these errors for now, but we'll provide a minor update for that soon to remove these errors (as they're still confusing) :)