1. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  2. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  3. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  4. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

SharpCraft, a managed replacement for Reinventing the Craft

Discussion in 'Warcraft Editing Tools' started by MindWorX, Nov 15, 2013.

  1. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,419
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    When I run it via command line:
    Code (Text):
    cd "C:/Program Files/Warcraft III/Tools/jassnewgenpack206"
    "SharpCraft/SharpCraft.exe" -game
     
    It returns:
    Code (Text):
    Sharpcraft by MindWorX
    Version: 1.1.3.0 <debug>
    Loading settings . . . settings.xml missing.
     
    However, this will work:
    Code (Text):
    cd "C:/Program Files/Warcraft III/Tools/jassnewgenpack206/SharpCraft"
    "SharpCraft.exe" -game
     
    Any way around that? btw, the console shows 1.1.3.0 even though I'm using 1.2.3.
     
  2. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    It's because of the work directory not including that file.
    To solve it from the code-side, set the work directory to the one of the executable on run-time:
    Code (C#):
    Directory.SetCurrentDirectory(System.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)));
     
  3. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,164
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    I get this error when I try to run it:

    Checking versions . . . System.IO.FileNotFoundException: C:\Programme\war3.exe
     
  4. MindWorX

    MindWorX

    Blizzard Developer

    Joined:
    Aug 3, 2004
    Messages:
    689
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    This isn't doing any syncronization, so some things can cause desyncs.

    In the first, you're specifying a different work directory. Try placing settings.xml in "C:/Program Files/Warcraft III/Tools/jassnewgenpack206" and run the first command again.
    I'll fix the version for next release.

    Sounds like your registry settings are borked up. You should look for a registry fixer.
     
  5. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,164
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    You were right, I just fixed them manually.
     
  6. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,419
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Moving the settings.xml worked (although, I don't like having the SharpCraft files outside its folder :( )

    I got this error:
    Error
    [​IMG]


    Upon running it through this:
    Code (Lua):
    function testmap(cmdline)
        start = string.find(cmdline, "-loadfile")
        loadfile = string.sub(cmdline, start)

        if sc_enabled.checked then
            cmdline = "SharpCraft\\SharpCraft.exe -game " .. loadfile
        end

        wehack.messagebox(cmdline)

        if wh_opengl.checked then
            cmdline = cmdline .. " -opengl"
        end
        if wh_window.checked then
            cmdline = cmdline .. " -window"
        end
       
        wehack.execprocess(cmdline)
    end


    The wehack.messagebox() command displayed:
    Code (Text):
    SharpCraft\SharpCraft.exe -game -loadfile Maps\Test\WorldEditTestMap.w3x
    And if you need the source on wehack.execprocess, click here. It started wc3 but it did not successfully hook. It just threw that error.
     

    Attached Files:

  7. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,523
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    I just tested it. It worked but I think I am missing something.

    1. how do I add a new native, the only way I noticed was to modify the example plugin and that is written c# (which I know a little of luckly) is that the only way?
    2. you need to start the game with a custom launcer to make the custom native work isnt this a problem?
    edit: calling a BJ doesnt seem to work either. I tried with BJDebugMsg("sads"); and it gave me error
     
    Last edited: Dec 6, 2013
  8. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,555
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    You gave no info or your code so we can't really help you.

    Take a look at this page and look at the source of my plugins.

    Also, you're not supposed to be able to hook BJ's (afaik).
     
    Last edited: Dec 6, 2013
  9. MindWorX

    MindWorX

    Blizzard Developer

    Joined:
    Aug 3, 2004
    Messages:
    689
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    It's the same issue as before I guess. This time, it's because it can't find SharpCraft.Game.dll. After that, it'll likely miss even more files. I need a better message for that I guess. I'll see if I can find a better solution so it's able to search other folders, however, I won't have time until Sunday.
     
  10. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,419
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    @MindWorX:

    Did you try what GhostWolf said?

    It would be very convenient if I could relegate it to one folder.
     
  11. MindWorX

    MindWorX

    Blizzard Developer

    Joined:
    Aug 3, 2004
    Messages:
    689
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    New release!

    Changelog
    Code (Text):
    v1.2.4a
     * Fixed type return bug in CDestructable, CItem and CUnit.

    v1.2.4
     * Fixed a directory launcher issue.
     * Fixed version reporting.
     * Added several unmanaged classes to tinker with at your own risk.
     * Improved launcher error reporting.
     
    Last edited: Dec 11, 2013
  12. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,555
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    Here's JNGP with the current SharpCraft implemented.

    Credits go to PurgeandFire, I just updated with the latest version so SharpCraft could have its own folder.
     

    Attached Files:

    Last edited: Dec 13, 2013
  13. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,164
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    Is this based on JNGP 2.x? Hence the name 2.07

    I'm still using 5d
     
  14. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,419
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Yeah. It is added to the 2.0.6 version (moyack's). I'll probably get moyack to do an official update in the next few days, but I first want to check out another resource that could be bundled as well.

    If you just want to add it to your 5d version, just put the contents of Sharpcraft within your JNGP folder, inside a folder named "SharpCraft".

    Then open wehack.lua, change the function testmap to this:
    Code (Lua):
    function testmap(cmdline)
       
        start = string.find(cmdline, "-loadfile")
        loadfile = string.sub(cmdline, start)
       
        if sc_enabled.checked then
            cmdline = "SharpCraft\\SharpCraft.exe -game " .. loadfile
        end

        if wh_opengl.checked then
            cmdline = cmdline .. " -opengl"
        end
        if wh_window.checked then
            cmdline = cmdline .. " -window"
        end
       
        wehack.execprocess(cmdline)
    end


    And add this to the code somewhere (make sure it is outside of a function):
    Code (Lua):
    --Sharpcraft Implementation

    sharpcraft = wehack.addmenu("SharpCraft")
    sc_enabled = TogMenuEntry:New( sharpcraft, "Enable SharpCraft", nil, false )


    Then just open NewGen and the option to enable sharpcraft should be there.
     
  15. saragon

    saragon

    Joined:
    Sep 14, 2010
    Messages:
    8
    Resources:
    0
    Resources:
    0
    Doodads/prop limits.

    Has there been something done about the doodad limit. As far as I know the World Editor only lets you place about 6k doodads, as well as trees/destructibles. I read that the map size is unlimited. Is this taking away those limits within the editor? Or is there already a way to get past these limits that I just dont know yet?

    :eekani:
     
  16. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,419
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Jass NewGen Pack should already allow you to get past that limit. You can download it here:
    http://blizzardmodding.info/4263/the-jass-newgen-pack-jngp-2-0/
     
  17. MindWorX

    MindWorX

    Blizzard Developer

    Joined:
    Aug 3, 2004
    Messages:
    689
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    Debugging improvements incoming!

    click

    [​IMG]
     
    Last edited by a moderator: Feb 14, 2014
  18. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    Ohoho
    That looks cool!
     
  19. Luorax

    Luorax

    Joined:
    Aug 7, 2009
    Messages:
    1,301
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Exception events that can be registered to triggers would be kinda cool. Could make debugging a whole lot easier even for non-SC maps.
     
  20. MindWorX

    MindWorX

    Blizzard Developer

    Joined:
    Aug 3, 2004
    Messages:
    689
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    I did consider adding some debugging functionality like that. Basically, if you declare a function like this:
    Code (vJASS):
    function SharpCraft_Exception takes nothing returns nothing
        // do your thing.
    endfunction
     

    That function would get called when an error happens. In time, I might be able to pass along what function failed as well.