Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

SharpCraft, a managed replacement for Reinventing the Craft

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

  1. ENAleksey

    ENAleksey

    Joined:
    Nov 29, 2014
    Messages:
    190
    Resources:
    1
    Tools:
    1
    Resources:
    1
    Is it not working?
    This is code for SharpCraft:
    Code (Text):

    [DllImport("storm.dll", EntryPoint = "#266")]
    public static extern bool OpenArchive(string filename, uint priority, int flags, IntPtr handle);

    public static bool OpenArchive(string filename, uint priority, IntPtr handle)
    {
        return OpenArchive(filename, priority, 0, handle);
    }
     
     
    Last edited: Oct 28, 2016
  2. Barade

    Barade

    Joined:
    Feb 2, 2006
    Messages:
    678
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Well the JNGP does it using the loadmpq.lua file somehow. It would be very useful for SharpCarft. Otherwise I can't start my mod with all the resources.
     
  3. MindWorX

    MindWorX

    Joined:
    Aug 3, 2004
    Messages:
    690
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    You're right. I never knew how it did the injection in the first place. I'm rather busy at the moment, but I'll see if I can piece something together as soon as possible Barade.
     
  4. ENAleksey

    ENAleksey

    Joined:
    Nov 29, 2014
    Messages:
    190
    Resources:
    1
    Tools:
    1
    Resources:
    1
    Barade, this is code used in Grimoire to load custom MPQs.
    To use it in SharpCraft, just create new plugin and add something like that:
    Code (C#):

    using System;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Collections.Generic;
    using TinkerWorX.SharpCraft;

    namespace MyFirstPlugin
    {
        [DllImport("storm.dll", EntryPoint = "#266")]
        public static extern bool OpenArchive(string filename, uint priority, int flags, IntPtr handle);

        public class FirstPlugin : Iplugin
        {
            public void Initialize(PluginContext context)
            {
                IntPtr handle;
                if (!OpenArchive("MyArchive.mpq", 0, 0, handle))
                    Debug.WriteLine("Failed to load MyArchive.mpq");
            }

            public void OnGameLoad(PluginContext context)
            {
             
            }
        }
    }
     
     
  5. Barade

    Barade

    Joined:
    Feb 2, 2006
    Messages:
    678
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Can you maybe provide such a plugin using a config file where I can specify MPQ archives like loadmpq.lua? I would have to set up a C# development environment first. It would be VERY USEFUL if when I enable "Use SharpCraft" in the JNGP 2 it would start the game with sharpcraft considering loadmpq.lua of the JNGP.

    This would also be cool for multiplayer tests with the JNGP.
     
  6. Trokkin

    Trokkin

    Joined:
    Jan 23, 2015
    Messages:
    98
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Hello there, wondering about the work done and work that will be done later on; though I was to try it, but got an error while loading the game:
    Initializing natives api . . .
    InitNativesHook: 0x6F1E9A50 . hook installed!
    Scanning vanilla natives . OnGameLoad(MindWorX.SharpCraft.Modules.JassAPI.JassAPIPlugin): System.NullReferenceException: Object reference not set to an instance of an object.
    in MindWorX.SharpCraft.Modules.JassAPI.Natives.InitializeVanillaNatives()
    in MindWorX.SharpCraft.Modules.JassAPI.Natives.Initialize()
    in MindWorX.SharpCraft.Modules.JassAPI.JassAPIPlugin.OnGameLoad(PluginContext context)
    in TinkerWorX.SharpCraft.PluginSystem.OnGameLoad()
    sub_6F7B0FA0Hook: 0x6F7B0FA0 . hook installed!
    sub_6F660F00Hook: 0x6F845EE0 . hook installed!
    sub_6F65DE40Hook: 0x6F8476B0 . hook installed!
    sub_6F661A90Hook: 0x6F84AE20 . OnGameLoad(MindWorX.SharpCraft.Modules.JassDebugger.JassDebuggerPlugin): System.NotSupportedException: STATUS_NOT_SUPPORTED: Hooking far jumps is only supported if they are the first instruction. (Code: 2)
    in EasyHook.LocalHook.Create(IntPtr InTargetProc, Delegate InNewProc, Object InCallback)
    in TinkerWorX.SharpCraft.Utilities.Memory.InstallHook[T](IntPtr address, T newFunc, Boolean inclusive, Boolean exclusive)
    in MindWorX.SharpCraft.Modules.JassDebugger.JassDebugger.OnGameLoad()
    in MindWorX.SharpCraft.Modules.JassDebugger.JassDebuggerPlugin.OnGameLoad(PluginContext context)
    in TinkerWorX.SharpCraft.PluginSystem.OnGameLoad()
    I loaded into the /plugins folder everything from the latest Modules.zip from the 2nd post of this thread which I believe has the latest version of such plugins. I was loading from "Start game windowed (debug).bat"

    Also, do we have any kind of specialized to the sharpcraft forums, where could be submissions for plugins, for example? I guess this one lonely thread isn't enough for discussing everything.
     
  7. EdwardElric

    EdwardElric

    Joined:
    Jun 19, 2010
    Messages:
    49
    Resources:
    0
    Resources:
    0
    is there already a way that sharpcraft can be run multiple times for wc3.exe?
    my map is based on sharpcraft & i really need to make some multiPLAYER tests...
    also found a new kLoader, but i guess it doesn't work together with sharpcraft as it only comes as an EXE:
    UnrealLoader [Universal kLoader]
     
  8. MindWorX

    MindWorX

    Joined:
    Aug 3, 2004
    Messages:
    690
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    As far as I can tell, you might be on the wrong version of Warcraft, can you check which one you're on?

    It's been discussed a few times. It's basically just about me saying so, and I'll get a hosted forum here, but I don't have a lot of time to dedicate to this project, and the hosted forum might give another impression.

    Sadly, SharpCraft doesn't currently support running multiple times on the same system. This is a known issue that might get fixed in the future.
     
  9. Trigger.edge

    Trigger.edge

    Joined:
    Jun 21, 2012
    Messages:
    419
    Resources:
    0
    Resources:
    0
    Sorry for my ignorance, I've had this installed on my NewGen and I've never I used it haha.

    The SharpCraft features work for multiplayer maps?
     
  10. MindWorX

    MindWorX

    Joined:
    Aug 3, 2004
    Messages:
    690
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    It depends entirely on the feature. What's important to keep in mind is that SharpCraft is just the framework for modding Warcraft III. How people use it determine what is possible.
     
  11. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,793
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    But yeah it works in Battle.net. Warden won't kick you (I don't think it even runs on custom games).
     
  12. MindWorX

    MindWorX

    Joined:
    Aug 3, 2004
    Messages:
    690
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    Yes, TriggerHappy is of course right, seems I didn't actually answer that. SharpCraft appears safe for both LAN and Battle.net use. I wouldn't use it on ladder games though, not even if you're not intending on cheating.
     
  13. EdwardElric

    EdwardElric

    Joined:
    Jun 19, 2010
    Messages:
    49
    Resources:
    0
    Resources:
    0
    - on post #1 in the changelog, version v4.0.0.179 is already ready, but for download you only offer v4.0.0.160 ;D
    (double checked it: SharpCraft.dll is also on 4.0.0.160...)
    - is v4.0.0.160 & v4.0.0.179 ready for WC3-TFT-1.28a?
     
  14. MindWorX

    MindWorX

    Joined:
    Aug 3, 2004
    Messages:
    690
    Resources:
    5
    Tools:
    1
    Tutorials:
    4
    Resources:
    5
    This wont be getting more updates. It has been migrated to a more stable version. I should get this thread locked.
     
  15. EdwardElric

    EdwardElric

    Joined:
    Jun 19, 2010
    Messages:
    49
    Resources:
    0
    Resources:
    0
    ah, wait, so is this new SharpCraft WEX Bundle also containing this latest SharpCraft?!
    Link to your SharpCraft WEX Bundle:
    SharpCraft World Editor Extended Bundle

    ah, i guess so, hence the word "bundle", lol :D my fault...
    okay, confirmed:
    so the new official place to discuss SharpCraft & friends should be in the "Forum/Hosted Projects/SharpCraft & WEX":
    SharpCraft & WEX
     
    Last edited: May 1, 2017