1. Hello guys I'm a bit new on HurtWorld modding. So basicly how can I create a dynamite in front of the player typed my command ? I thought about using "Instantiate" on Unity because HurtWorld uses Unity, but I don't know how to use it on Oxide Plugin.
     
  2. Wulf

    Wulf Community Admin

    You'd need to find how Hurtworld spawns the item and use that. I'd recommend checking out the game's Assembly-CSharp.dll using a program such as JustDecompile.
     
  3. In a forum full of code developers, someone should write a simple axample post explaining how to for instance spawn items. I've been looking at the meteor script a bunch of times, but it is too complex for a newb. I don't want to learn how to be a hacker to do simple scriptbased events - a basic library of snippets would do miracles for me and I guess a lot of other people.

    The slow activity around here is a bit frustrating, when there are so many rather simple scripts that needs to be made..
     
  4. Exactly, and to provide a bunch of updated code examples for an indie game that is constantly changing, there needs to be a community that is willing to provide these examples and maintain them every single update.
    If there isn't such a community, then no one will start doing this kind of work.
    Perhaps other Hurtworld devs are thinking like you do, that someone else should provide this kind of documentation and that it's too hard for them?
    Perhaps this is because modding communities often don't consist of industry professionals?
    Perhaps the few that already do a bunch of documentation related stuff are already busy with the stuff they are currently working on and maintaining?
    Everybody wants to write plugins, but most don't want to contribute what's necessary to make writing plugins easier.
    Rust, for instance, is better documented because at some point a bunch of people decided that they are willing to expand their knowledge and at least try reverse engineering the game.

    So why not be one of the first to pass the hurdle? Why not start up a decompiler, load the Hurtworld DLL, start looking through the code to find what you need and post it here, to provide a simple example for other people with the same problem?
    Even better, maintain that example when the game is updated and the code in question changes.
    Using a decompiler is simple (simpler than using most software used by secretaries every day). Reading C# should be doable too (and even necessary if you want to write anything of slight complexity!) - if you encounter any language constructs you don't understand, just look them up or consult MSDN.

    That being said, I don't own Hurtworld, but I understand C#, so I loaded up the plugin you mentioned.
    Opening the plugin immediately presents me with a class "MeteorInstance", which instantiates a meteor like the following:
    Code:
    Singleton<HNetworkManager>.Instance.NetInstantiate(
        uLink.NetworkPlayer.server,
        "WorldItemMeteor",
        Vector3.zero,
        Quaternion.Euler(0, 180, 0),
        GameManager.GetSceneTime());
    
    Normally I'd now open up the decompiler to understand NetInstantiate, to understand what each of these parameters do.
    I'd guess the following:
    Code:
    Singleton<HNetworkManager>.Instance.NetInstantiate(
        uLink.NetworkPlayer.server, // target server?
        "WorldItemMeteor", // entity name?
        Vector3.zero, // position
        Quaternion.Euler(0, 180, 0), // rotation
        GameManager.GetSceneTime()); // no idea
    
    In addition to understand its parameters, I'd try checking out where this function is used (in ILSpy: Analyze (Used by)), to check if Hurtworld itself does any additional initialization work when using this function or whether this already does all of what you need. I'd also check where it's used to see if maybe Hurtworld provides another more comfortable abstraction than this function (the plugin also uses Singleton<HNetworkManager>.Instance.NetInstantiate("ExplosionServer", pos, Quaternion.identity, GameManager.GetSceneTime()); for instance).
    But you can confirm that with your decompiler, just search for the respective function.
    I can't provide you with a full example, because I don't own Hurtworld and I can't analyze whether this works. You'll have to do the additional work yourself and report back so that others will have an easier time with this.
    Contribute to the community instead of expecting the community to contribute for you!
     
    Last edited by a moderator: Sep 28, 2016
  5. Valid point indeed sqroot. It's easy to demand others to do the legwork for you.
    People however are good at different things, with visual stuff I can pull my weight, I can't with code. I'm a terrible coder who can get through and do interesting or creative stuff by copy/pasting and hacking away at existing projects for weeks, but even then - I'm quite dependent on documentation and examples to get past the many obstacles I get entangled in. And the result is usually not pretty code.

    This is why I'm hoping someone here would be the one to throw the first stone in building up a C# foundation.. I'll do my part in other aspects of the Hurtworld SDK community, I've spent months learning Unity to make a map for it, and to follow up on your post there I'll make a tutorial for that as best I can, tonight, with what I've learned so far. The textures I've made have already been shared, but since we're also lacking a shared forum for the different parts of modding HW I'll post a link here aswell to a groundtexture library that took me a few months to create. MEGA

    Again, I agree with you. But I'm the guy who watches mr. robot and thinks that they did a great job at framing that shot, or that they've should have used ctb gels on the highlight in the pano shot across the street. I'm not the one who gets all the kernel related jokes..
     
  6. And just to have said it. BIG highfive to Wulf for administrating this forum and all you guys who have made excellent mods and tools that you maintain and develop for almost no cred. I really don't mean to sound ungrateful for this - I know how much time and effort it is.