Posts by zfoxfire

    BTW, I checked out your website and saw the human and animal models you've made. Very very nice! I'm not sure if models with bone systems are properly supported yet but I'd have to let Red51 respond on that one. We should be able to do placement, scaling, rotation, and translation of objects with the current API atleast.

    Hello,


    I just purchased this game. I am reading about this plugin to add custom objects. I am a 3D artist but I know next to nothing about programming. How does one go about adding custom objects?

    Hi Carm3D. According to the new API spec it looks like custom 3d models will not be craftable or spawnable like conventional in-game objects (some Inventory system changes have to happen before that is possible). However, a small mod can be written to to place anything you have modeled. I guess if you don't know much about programming then just stick around here, show off some of your work, and I'm sure plenty of us coders will want to work with you :)

    The plugin can spawn as many threads to handle whatever synch or asynch processes you need to do. Not sure you would need multiple copies of a plugin. Java is object oriented so the plugin should be able to create any number of instances of any class bundled in the jar.


    Object1 = new object("foo");
    Object2 = new object ("bar);

    About testing the plug-in, of course this is not possible now, until a plugin-enabled version of the server will not be available (soon... :evil: ).


    I just confirmed this.. I must have misinterpreted what Red51 meant when he was talking about dropping jars in the scripts or plugins folder. I read that I can when it meant that it might be. Oh well... I already tried my jar file in both folders and it should have printed the text to stdout which I assume is the console in Rising World. It would be nice to have a feature in-game (maybe by console command) to list all recognized and active plugins loaded.


    Anyways looks like I have the basics down so I can atleast start writing a mod. Whenever the API is supported by the game then I "can" actually test in-game :) The way I read the comment about no server-side support was that I can still run a plugin that did not communicate with a server but would still work in the client.

    If this is not set in stone yet


    You receive the pun of the day award! :)


    Oh okay, yeah that may be confusing indeed. The game only renders the "transition" between solid and air blocks, that's why the world appears to be "hollow" ^^ Actually the hollow space still contains block data (solid rock).


    Yes, Red. This is exactly what I was confused about but you clarified it earlier that "solid rock" has a terrain value in the chunk data. I was confused because of how I was seeing it in rendering. I assumed that the terrain data might have been storing the space underground but between caves as being open air. I have yet to spend time reading Chunk data to see what's there.

    Thanks for reporting your findings, @zfoxfire. I personally use Eclipse under Linux, so most of it is not directly applicable for me, but it is always interesting to hear about other people experiences.


    I am a bit surprised about the need to fix the imports with NetBeans, Eclipse manages them automatically, or suggests the proper import, as soon as you use the implements keyword.


    About testing the plug-in, of course this is not possible now, until a plugin-enabled version of the server will not be available (soon... :evil: ).

    I am also surprised that I had to specify individual classes of the jar in my import statement. In the past, I've just included the top-level jar and that was it. Maybe there is a NetBeans setting i am overlooking. Maybe I am in some kind of strict mode. But that's fine by me. I did discover the light bulb icon with suggestions and I guess the IDE managed to scan the rest of the jar and suggest what other classes to import. No biggie!


    Testing should be possible in game right now. Atleast that is what I interpreted from Red51. Unless I am still confused on the language used.


    Regarding the proper way to implement a plugin, I'd suggest drop-in zip file approach. On game-launch, the zip files in plugins are expanded to a corresponding folder if the matching folder name does not exist yet. Regardless, the game reads the actual plugin from a folder, not the zip. The Jar file will contain Manifest info containing authors info so I really see no reason to require a config file as LUA did. The Jar file just needs a class matching the Jar/folder name for the plugin to be recognized. Any additional files such as config files or databases which will be modified can be included in the zip or we can just assume the mod writer will create those files if they don't yet exist.

    One thing I don't understand is the hacking of the game, most mods out there are made that way. ..... and in my opinion hacking is modding.


    Hacking is one way to come up with a mod. If you have the time and are comfortable digging into the jar files for Rising World then you could come up with a hack solution to modify the existing trees. I've already looked at the tree class files myself and it doens't seem to hard but I have no desire to do so. I'm sure some of the more seasoned developers on this forum have already hacked the game to make their own unique mods. But that sort of approach is outside of the "proper" modding approach which is to use the API that Red51 has provided us. The API will already allow you to place custom 3d models in the world. However the API does not yet allow you to craft or spawn unofficial models. Inventory according to the API is only limited to official inventory items. When this API is approved then we will have an easy way to override official object models or add new ones (perhaps a user space for our own inventory id values is needed).

    Finally got it to compile! So one thing missing from the examples that Red posted include was how to set up the import statements for Listener. Here's a more complete example of a simple listener event. I also learned that in Netbeans that its better to select "Java Class" as your project type, not "Java Application". The difference is an application has to have a class identified as the main class and must have a main method. However the "Java Class" is great if your writing a small plugin which is exactly what we are doing here! However, for testing purposes you can still include a main method (like below) but it doesn't have to do anything. This is still good if you want to test the application on its own. Not sure how we do that unless someone knows how to trigger events.



    To test the class on its own you can modify the main method like this to create an instance of itself. Of course this wont do much because this is event driven so the message will never display:



    Java
    public static void main(String[] args) {
    mod newMod = new mod();
    }

    Finally you just build the jar. Make sure your package matches the package line in the source code. Simply right-click on the package and compile it. Then browse to where your project is saved on your drive and find the jar file under dist


    http://imgur.com/a/1aKBW



    To install the package, I'm still a bit confused about. Red51 said your probably just drop a jar into scripts or plugins. The process seems not entirely finalized so I'll just play with it more for now. My work computer can barely handle running Rising World even at absolute minimal draw distances.

    So I'm a bit rusty in Java so please excuse the basic questions here:


    Do I really need a main method for this? I'm not writing a standalone application so the only main method should be buried in the rising world application.
    Even with a main method, it is not finding the main method. Configuring Netbeans was straight forward and the IDE is not throwing any errors so atleast there's that.


    I guess the next question is... how do i install a plugin once i compile? Do I have to create a individual folder under scripts containing a class or jar file and a configuration xml like the way LUA works? I don't think this was properly explained yesterday

    In the game Minecraft there's a mod to tweak biomes it's called Biomes O' Plenty. There's a tree called a Sakura and I would like to add it to Rising World as a very tiny mod to help me get started on understanding on how to write mods or in this case we call them plug-ins. I would add the tree, saplings for it and it's own variants to the block bench. @red51 said this stuff would only be static. Even so it would be nice to add a new tree to the plains.

    Hmmm... I know you can add custom models. I'm working on the same right now. However, I do not know if you can register a custom Inventory item (only in-game items are available without hacking) or modify crafting bench items. I'll study the API a bit more but it looks like the API already supports some functions for chat messaging so it might be possible to create a function linked to a chat window command (still not positive. i'll study more when I am home) . Meanwhile, Can you aquire some models of such a tree? there are lots of 3d modeling students out there sharing their work on the internet. shouldn't be too hard to come up with something.

    captain,


    I am struggling myself and i am just trying to import a model but i see now what my mistakes are and i am going to try again tomorrow. I havent written any uselful java in 4 years and I am quickly seeing how much I have forgotten. Im getting errors as well. If you wanna add me on steam then maybe we can learn together. My id is zork_foxfire

    Personally I'd rather just wait for the "proper" implementation as I'd assume it would give us ways of error handling than simply dumping stderr to the console but hey, it's quick and easy and won't take long to implement. :-D Now perhaps I am overthinking this but... regardless of implementation, if the command was to fail, would it be useful for the method to return whatever expected object and an exit code ? I handle exit codes at work all the time in my scripts (making use of both stdout and stderr). I am rusty on Java but it looks like there to pass multiple objects as an array using Pair or HashMap but I've never done such before so I leave the implementation details to your best judgement: http://stackoverflow.com/quest…lues-from-a-java-function

    I think Miwware meant that as a temporary solution to give us console access quickly that it would be easy to implement something like Plugin.executeCommand even while it is possibly less secure.
    In the long run, seems like player.executeCommand approach would be best. The call to the API should also trigger a check to see what permissions that user has.

    Indeed that would be a hack which is why I highly doubt if we will be given the power to pass a console command through an api as an actual string. That could create a vulnerability if someone was to find a way to exploit the console itself. Rather, each command function will need to be available in the API with its own method.

    Actually as @Miwarre suspected, the terrainData array in the Chunk class contains all necessary information to get the terrain id from a certain position (air is always 0). You could also use the surface array in the ChunkLOD class, although it's difficult to find out this way if there is really a cave or not. Here is the question: What is a cave? Or how do you find out that there is a cave? What's the difference between a cave or a hole in the ground, or a ravine for example?

    Ok, I see it now.
    I imagine there is no difference between air on either side of the cave wall. I likely have to write a recursive function to read in all terrain info surrounding the player position until actual terrain (non 0) is encountered to generate the map of the cave. Unless there is an id for solid without a texture (behind the cave wall). As to the definition of a cave, I'd imagine from a programming perspective a cave would be anywhere your position is below the known surface level of that postion and chunk. so if you fall down a deep hole, you can still see the surface but the map would still render surface. However once below the surface value, then the program could switch to the recursive function to generate a cave map, assuming the id values behind the cave wall are actually air.... Just my thought.. Never actually attempted anything like this before.