Posts by red51

A small new update is available now!

    Please use the code tag for posting any source code, otherwise the indentings get lost, which makes the code difficult to read:


    When writing a plugin, it's also helpful to have a look at the output console, since it will print errors in case something goes wrong. On a server, just check the server output, on the client (when playing singleplayer), you can set "game_debug_console" in the config.properties file to true.


    In this case the INSERT statement throws an SQL exception, since no column "text" was found. The first CREATE statement does not create a column "text" (it neither creates a column "read")

    How to install a plugin


    This is the default way to load a plugin.


    Usually all plugins belong into the plugins folder in your Rising World directory (if this folder does not exist, simply create it). If you're running the Steam version of the game, you can find the Rising World directory in "Steam/steamapps/common/RisingWorld". If you're running a multiplayer server (i.e. a dedicated Rising World server), find (or create) the "plugins" folder in your server directory accordingly.


    Every plugin requires a separate subfolder which contains the necessary plugin files (at least a ".jar" file and maybe some other optional files). Example:

    Code
    Rising World
    |
    |____plugins
    | |____MyPlugin1
    | | |____myplugin.jar
    | |
    | |____MyPlugin2
    | |____myplugin2.jar
    | |____someexamplefile

    Now if you load a world (or start a server), it should load all your plugins in the plugins folder.


    Information for developers: You can reload your plugins without having to restart the game or the server by typing "reloadplugins" (or "rp") into console (or send it as an input to the server), this unloads and reloads all plugins (i.e. the onDisable() and onEnable() methods will be called, in addition the "PlayerConnectEvent" and "PlayerSpawnEvent" will be triggered again for every player who is currently online). Please keep in mind that this is only intended for testing purposes!



    Optional: Compile a plugin by the game/server automatically
    Highly recommendable for developers


    It is possible that the game/server compiles your plugin "on the fly". This is an easy way to test your plugins without the need to compile it and move the files manually. All you have to do is to create an empty subfolder in the plugins folder (with the name of your plugin) and put a "projectinfo.txt" file there, this file contains a field name (the name of your plugin), path (the path to the "src" folder in your plugin project directory, or more precisely, the path to your source files) and optionally assets (the path to your assets [models, images etc], if you use any assets). Example:

    Code
    name: MyPlugin
    path: C:/Projects/RW-MyPlugin/src
    assets: C:/Projects/RW-MyPlugin/assets

    Additionally you have to set up the path to your JDK in the config.properties file, or server.properties when running a server ("plugins_jdk_path"). Keep in mind that you have to escape colons and backslashes, e.g. plugins_jdk_path=C\:\\\\Program Files\\Java\\jdk1.8.0_91


    Make sure there is no .jar file in your plugin subfolder, otherwise the .jar will be loaded instead.



    Optional: Load class files


    It is also possible to load separate class files instead. Again you just have to set up an empty subfolder in your plugins folder (with the name of your plugin) and move all your class files there. Now also put a "classinfo.txt" file there, which only requires the name of your plugin (e.g. name: MyPlugin).

    Mit "getTerrainID()" erhälst du im Grunde die "Block ID", also die ID des Materials (Stein, Erde, Kohle etc). Das ist noch kein explizites Item. Generell gibt es nur einen einzigen Itemtyp, der mit der TerrainID was anfangen kann, nämlich das "Ore" Item (über die Textur wird dann festgelegt, ob es sich um ein Erz, um Stein, um Erde etc handelt).
    Wenn du nun also ein Item Erz Objekt erhalten möchtest, benötigst du erstmal die ItemID des "Ore" Items. Das könntest du über Item.getItemDefinition("ore") machen (alternativ bereiten wir noch eine Liste mit IDs vor). Der Einfachheithalber kann ich dir die ItemID auch nennen, das ist nämlich die ID 100


    Um nun ein Item zu spawnen kommt es darauf an, ob du ein Item in der Welt spawnen möchtest, oder ins Inventar des Spielers. Das Spielerinventar bietet die Funktion insertNewItem(), ansonsten für ein Weltitem, bietet das World object die Funktion spawnItem()

    Im Update von Montag gab es tatsächlich diesen Bug, also dass man nicht mehr respawnen konnte. Das wurde allerdings mit dem letzte Update bereits behoben. Besteht das Problem immernoch? Verwendest du als Spielversion die 0.7.3.1?

    Das Teleportationsproblem ist seit der letzten Version behoben, allerdings betraf das ohnehin nur Situationen, wenn man sich irgendwo hin teleportiert hat, bzw. wenn man auf einem Server (aber auch nur, wenn viel gebaut war) respawnt ist (der erstmalige Spawn nach dem Connecten war davon nicht betroffen).
    Ansonsten ein generelles in der Luft spawnen deutet darauf hin, dass der Spawnpunkt offenbar auf diesen Punkt gesetzt ist. Hier kann es hilfreich sein, einmal in einem Bett, Zelt oder Unterschlupf zu schlafen, um den Spawnpunkt zu aktualisieren ;)

    this should be bundled in the Rising World game download so we can reference the latest released version as its updated. Then we can simply point our IDE to the library and javadoc and not have to worry about downloading jars.

    Good idea. Actually the plugin API is in the game folder (in data/jiw/plugin-api.jar), just the javadoc is missing. Guess we will add it with the next update (or maybe put it into a separate folder in the game directory, we'll see) ;)

    1) Is there an 'official' (or suggested) place in these fora where to put user-contributed plug-ins for the other to download?

    We set up a new section for that :) Didn't even expect a plugin so quickly :D


    2) Are there guide lines for suggested / preferred / requested physical details of distribution? Like: one single archive, please OR multiple files are also ok; for archives, please stick to .zip (or whatever) OR .tar.gz is fine too. And so on.

    Basically it's up to you, depending on your plugin. Only exception: No .exe file or something like that (so most preferably a zip), but we will set up some guidelines for that.


    3) Is a specific form of licensing (or a range of roughly similar equivalent licences) suggested / required? Is the publication of sources a requirement or the simple .jar is already enough (as long as it works, of course)?

    That's also up to you, it's your work. Only restriction: Users and servers should be allowed to use your plugin for free ;) About the source files: You don't have to publish them necessarily, so the jar file is sufficient.

    About compiling a plugin during runtime: It's possible now to set the path to the JDK ("plugins_jdk_path") in the config.properties file (or when running a server, in the server.properties file accordingly). Keep in mind that you have to escape colons and backslashes, e.g. plugins_jdk_path=C\:\\\\Program Files\\Java\\jdk1.8.0_91

    I was Informed by Yahgiggle that is Possible to make Your own Vehicle with the api?? all you have to do is lock to your screen. that sounds awesome

    Basically it is possible to implement vehicles with the API, although implementing drivable cars (which adapt to the terrain etc) would be very complicated. It's easier to implement a vehicle which just drives a fixed route, e.g. a train, or a ferry. However, it's still some work to get that running ;)
    If you just want to implement a vehicle for decoration, it would be very easy instead (basically just importing a 3d model)

    Hast du die Lib so hinzugefügt, wie im "Getting started" Thread beschrieben war? Dann kannst du sie einfach wieder entfernen, wenn du in Netbeans oben auf Tools -> Libraries gehst und auf der linken Seite die entsprechende Lib (also PluginAPI) anwählst und "Remove" wählst ;)

    @famyko: Das klingt ja soweit schonmal ganz gut :)


    @hkurzawa: Ich habe ein kleines Update nachgereicht. Bei der Standalone musst du dafür kurz einmal ins data Verzeichnis gehen und die "risingworld-core.jar" Datei löschen, anschließend kann das Spiel gestartet werden damit die Datei erneut heruntergeladen wird. Zumindestens über die "config.properties" Datei kannst du dann einen Wert setzen (oder einfügen, falls nicht vorhanden) game_item_despawntime=300, die Zahl dahinter gibt die Despawnzeit in Sekunden an. Ändere diesen Wert einfach auf eine viel höhere Zahl, zB "86400" (das entspräche 24 Stunden). Speichere die Änderungen, und starte das Spiel erneut.
    Bedenke aber, dass die Items auf jeden Fall verschwinden werden, sobald du das Spiel beendest^^


    @TheKing: Danke für den Hinweis! Ich werde der Sache auf den Grund gehen ;)