• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

SharpCraft, a managed replacement for Reinventing the Craft

Status
Not open for further replies.

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
I've come to the conclusion that SharpCraft has started suffering from feature creep.
This means that next release will have a lot of the main features stripped away, in favor of a cleaner modding API. The existing advanced features will be moved into plugins.
Also, the sandbox is causing more issues than it's worth, so for now, that's going away as well. Hopefully this means SharpCraft will become a clean lean modding machine and not require as many updates as it currently needs.
I realize this changes the modding API drastically once more, but hopefully this will be the last major change for a while.
Very reasonable decision. Definitely takes balls to admit something like that.
 
Level 6
Joined
Jul 30, 2013
Messages
282
We should make a lobby map that allows users to download maps online and stuff and go through games (maybe similar to the sc2 arcade). It should have a chatroom and people should be able to pick an avatar too.

The big thing ofc is dling maps. If we're going down full c#, they'll have to download the dll or w/e for the map + the map itself. Could also have automatic patching ^)^. On b.net, we could advertise sharpcraft. When they download the map, we tell them to start the map on their own and tell it what drive they want to put the installer on. From here, when they click the shell script, it will download the lobby map + SharpCraft to their computer. At this point, they just start wc3 through SharpCraft, go to single player, and run the lobby map =), then they are in.


Who wants to code this awesomness? Also, what server should host the lobby + provide the maps? I don't think that we'd get away with asking Ralle to do this, that's starting to ask too much, heh. Also, what server will host these maps? We'd have to have instanced maps and constant state maps (mmo vs like a fps).


a) awesome idea, must like :)
b) you could ask Nevo, he has a server that's way over-spec'd for what he's running on it and he might agree for some swag :)
c) automatic patching is a must imo. nobody would like to manually go poking at his/hers sharpcraft installation every few weeks.
d) hmm.. mapt-get.w3m ? well sounds like fun.. might pitch in later.. after i have actually got some exp with SC. :)
 
Level 6
Joined
Jul 30, 2013
Messages
282
Practical uses would include a chat system, online score system and even a tournament streaming service where people could spectate competitive games from a website. I could see a system that allows Twitch streamers to see the chat from viewers while in a game. There are plenty of uses for client-only modifications. That being said, personally, I think the most interesting is complete overhauls, but that's a bit more challenging to get people to use.

Not only that..
since it IS possible to sync some data to other players manually (@Nestharus #libraries) you can also have things in there that effect the game state.

..such as some SharpCraft enabled player could contact a central server that coordinates player stats/rank/profiles etc, and then syncs that data to the regular players if they have outdated/no data.

maps with more than 12 players (11 real +1 sharpCraft node that plays in the place of al lother players for instance)

the point i'm trying to make is.. there are uses, and by making systems incompatible with the comparatively large installed userbase of standard war3 you are needlessly handycapping the system.
 
Level 6
Joined
Jul 30, 2013
Messages
282
hmm. api to get time could be useful...
then could do features that differ by day of the week for instance..
or unlock some time in the future (or lock)..
and shouldnt bee too diff..
 
Level 1
Joined
Dec 15, 2012
Messages
6
Usage with self-executing MPQ

Hi, I using SharpCraft with NewGen World Editor, when I run test map directly from editor, custom natives work, but when I start map from normal(no hacked game) or from my custom self executing mpq archive, map not start, because SharpCraft is not asociated with this map.
How i can use SharpCraft natives in any map or campaign, even with my self executing MPQ ? And what files are needed to pack with my own mod (self ex.MPQarchive+Campaign=My mod) if i decide upload mod online?
Thx for any hints.
Upgrade: I just edited some of .bat scripts and i can now run War3 + Sharp via this .bat, but i still dont understand what is needed to distribute when i upload my mod and how to run Sharp natives in my self ex. MPQ ...
 
Last edited:
Level 3
Joined
Dec 30, 2010
Messages
53
There is a strange bug when using Sharpcraft. When concatenating strings with string arrays all but the last one become "ui@y".
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
New release!

Changelog
Code:
v3.0.1.135b
 * Fixed .zip reading error.

v3.0.0.133
Everything is back to basics. SharpCraft now only has the core plugin functionality. All the advanced features will come as separate plugins.

I will be releasing the old features as plugins shortly.
 
Last edited:
Level 3
Joined
Dec 30, 2010
Messages
53
I'd also like an example plugin, can't see the plugin's source in git, perhaps you forgot to add them?
Basically what I'd like is a stopwatch plugin.

Btw thanks for the Debugger plugin.
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
I'll see if I can get around to making a basic stopwatch plugin. Also, the next thing I'm planning is a walkthrough on how to get started with your own plugins, in the most convenient way. The only issue I have is, that I use Visual Studio Professional, which has differences from the Express version people will get. So I'll need to find a way to utilize Express for the tutorial. But don't worry, it's coming!
 

MindWorX

Tool Moderator
Level 20
Joined
Aug 3, 2004
Messages
709
I only use Express so I could help out there if needed.
I'll see if I can catch you in the chat, then we can work out something.
I could compile the older version with Mono Develop.
I haven't tried Mono Develop myself, but it might be a viable alternative to VS Express. I'll see if I can get a tutorial out for both IDEs.
 
Level 5
Joined
Oct 10, 2010
Messages
71
AFAIK This enables us to use jass extensions api to manage our connections with "server", that means each functionality of our maps must be converted to this new fashion?

How does this really work? Is there just jass code that does this ?
Code:
call Connection(127.0.0.1)

How, when, why? I must say im pretty exctied for this, but there is huge lack of information:sad:
 
Level 33
Joined
Apr 24, 2012
Messages
5,113
Help?
 

Attachments

  • Untitled.png
    Untitled.png
    10.4 KB · Views: 197
Level 1
Joined
Jan 25, 2015
Messages
2
Awesome library!

But I have some problem passing string arguments to natives from C# and getting strings from natives. My code is simply

Code:
JassStringArg argTest = "Teststring";
string s = Natives.GetPlayerName(Natives.Player(0));
MessageBox.Show(s);

Constructing a JassStringArg does the following:

Code:
Unhandled Exception in InternalScript.OnPostMain!
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   in System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr ptr, Int32 ofs)
   in System.Runtime.InteropServices.Marshal.ReadIntPtr(IntPtr ptr)
   in MindWorX.SharpCraft.Modules.WarAPI.GameFunctions.JassStringIndexToJassStringHandle(Int32 jassStringIndex)
   in MindWorX.SharpCraft.Modules.JassAPI.JassStringArg.op_Implicit(String from)
   in MyPlugin.MyPlugin.Script_PostMain()
   in MindWorX.SharpCraft.Modules.JassAPI.Script.OnPostMain()

And getting it:

Code:
Unhandled Exception in InternalScript.OnPostMain!
in System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr ptr, Int32 ofs)
   in System.Runtime.InteropServices.Marshal.ReadIntPtr(IntPtr ptr)
   in MindWorX.SharpCraft.Modules.WarAPI.GameFunctions.JassStringIndexToJassStringHandle(Int32 jassStringIndex)
   in MindWorX.SharpCraft.Modules.JassAPI.JassStringRet.op_Implicit(JassStringRet from)
   in MindWorX.SharpCraft.Modules.JassAPI.Natives.GetPlayerName(JassPlayer whichPlayer)
   in MyPlugin.MyPlugin.Script_PostMain()
   in MindWorX.SharpCraft.Modules.JassAPI.Script.OnPostMain()

What am I doing wrong?

E: Reals and other types work fine.
 
Level 1
Joined
Jan 25, 2015
Messages
2
In case anyone is still looking in this thread, I've narrowed in the problem.

Code:
GameFunctions.GetThreadLocalStorage().Jass.VirtualMachine

is null. Does the Jass-object need to be manually initialized somewhere?
 
Level 2
Joined
Dec 31, 2010
Messages
9
Hi , is there a way to make custom event - when unit miss attack whit sharpcraft , and when critical hit occur and things like that
 
Hi , is there a way to make custom event - when unit miss attack whit sharpcraft , and when critical hit occur and things like that

It is possible, but only through convoluted methods such as reading memory. It isn't worth making your map require SharpCraft for something small like detecting misses or critical hits. It is better to just trigger those specifically in your map.

If you use a custom damage detection system, you can alter damage after it has been dealt. For example, Bribe's damage engine:
http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-v2-2-1-0-a-201016/
If you wanted to create a miss, you would simply set the damage to 0 and create a floating text with "miss". If you want to have a critical strike, just multiply the damage by some factor (e.g. 2 or 3). That means you'll also have full control over when they happen, and you can just run a separate event to tell yourself when it happens.

IMO, SharpCraft is most useful for mouse detection, displays, networking, and things that are truly beyond the editor's capabilities. Simple things such as crits/misses, damage detection, or reading from tooltips is stuff that should be implemented specifically from map to map. :) Keep in mind that a map that requires SharpCraft will require it across all players (and wc3 has to have been started up with SharpCraft), so you should only use it when it is necessary for your map.
 
Level 2
Joined
Dec 31, 2010
Messages
9
I need to control cd off skills. And for miss chance if somebody hit me with bash it still bash me. I need networking too and many other things but no one write plug-ins or I can't find page for them.I need if it is possible to make maps larger than we limits, generate items dynamic skills too.so is it possible and can you give me tutorial how to detect that thing with memory I have some programming skills and there is Google too so if you can give me direction I will try to make what I want. Typically
 
Much of what you're asking would be too large of an undertaking to program. But if you are interested in reading/writing memory, just google guides on Cheat Engine and perhaps for the Warcraft 3 cheat tables. But that is against the ToS of the game--you run the risk of being caught by the warden if anyone plays your map on BNet. And most of the cheat tables are just for giving a ton of gold/xp/stats, they rarely deal with anything useful.

In the meantime, the bash problem can be solved by triggering your bash ability. JNGP can extend the map size to 480x480 (but you really shouldn't need more than that. It would also be way too laggy for the engine. And you probably wouldn't be able to extend it any more than that with SharpCraft since it would have to be dynamically extended, but it would probably be easier to rewrite Warcraft 3 from scratch than to do that). For items and dynamic skills, you can handle much of it with trigger logic. The only issue would be tooltips, but you should try to find a workaround (or just generate a lot of object editor objects).

You would probably be better off developing in an environment like Unity if you want that sort of control.
 
Level 2
Joined
Dec 31, 2010
Messages
9
Can you tell me how to find in c# if program is accessing a specific memory address(to fire event for that) , i search google but no luck
 
Level 5
Joined
Jan 26, 2015
Messages
94
more than 12 players

I'm actively working on the project at the moment, and I'm fixing up a few things. One of the things I've added is the ability to import libraries directly into maps, which should make everything a bit easier, including your issues Xonox.


One question. I know that the sharpcraft can modify the winsock for make maps than 12 players. Its this possible?
 
Status
Not open for further replies.
Top