wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-24-2006, 02:20 AM   #1
xttocs
User


Respected User
 
Join Date: Jul 2002
Posts: 181

xttocs will become famous soon enough (51)xttocs will become famous soon enough (51)

Default jAPI - Version 1.0

The Jass Tool is the prebuild tool using japi.dll. I'm pretty sure it should work now...

// Original Post
This is my first version of the Jass Hacking API that allows you to create new natives. Included is the source code only, so it is up to you to create a program to use it. I reccomend creating a dll using my code and then injecting it into the game or the editor. Here are some tutorials and resources for you coders interested in trying this:

http://www.thecodeproject.com/dll/DL...n_tutorial.asp
http://www.megasecurity.org/Programm...Injection.html
http://www.planet-source-code.com/vb...tp%2FC83204982

Just search google and you can find plenty more.

You will need to inject your code immediately after creating the process for this to work. I have included some sample code of adding natives in the .rar in addition to the two files that make up this library.

There is more to come (at least a bit), but I figured I'd release what I have so far.

Have fun, good luck, and enjoy.

Edit:

Hmm, actually, to make it easy... I'll release an entire project using this source code with the loader and all premade. It will have a plugin-like setup that will allow you to create new natives by simply building a dll that exports the native you want to add.

// End of Original post
Attached Files
File Type: rar jAPI Tool - Working 1.0.rar (83.6 KB, 958 views)

Last edited by xttocs : 01-27-2006 at 01:03 AM.
xttocs is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-24-2006, 04:46 AM   #2
Extrarius
User
 
Extrarius's Avatar
 
Join Date: Jul 2002
Posts: 952

Submissions (1)

Extrarius will become famous soon enough (59)Extrarius will become famous soon enough (59)

Send a message via ICQ to Extrarius
Default

I know it isn't exactly the same thing, but you might want to take some inspiration from MetaMod(a Half-Life 1 tool used to modify mods, thus the name) as far as the way the interface it exposes allow an arbitrary number of user dlls to be loaded =-)
If you design it right, others could make both new natives(the whole point of your work) and non-native additions (for example, an auto-downloader that could fetch missing dlls from a central 'WC3 MetaMod' website and register them with the program if the user approves)
__________________
ExtProtect - Extrarius's Map Protector

Last edited by Extrarius : 01-24-2006 at 04:50 AM.
Extrarius is offline   Reply With Quote
Old 01-24-2006, 03:09 PM   #3
IPEONRUSH-SHIP
User
 
Join Date: Jan 2006
Posts: 46

IPEONRUSH-SHIP has little to show at this moment (8)

Default Very interesting

interesting. Tha'ts the extent of my knowledge on this, i just know there's more possibilites on this. IF this is what i think it is then it could really benefit a lot of us who don't play melee but who like the competition part of it.

Keep up the good work :)
__________________
The Golden Age of Pirates - The Original 13attleships community.
http://www.thegoldenageofpirates.com

Last edited by IPEONRUSH-SHIP : 01-24-2006 at 03:11 PM.
IPEONRUSH-SHIP is offline   Reply With Quote
Old 01-24-2006, 03:41 PM   #4
Zoxc
( ~)>
 
Zoxc's Avatar


Respected User
 
Join Date: Feb 2005
Posts: 959

Submissions (9)

Zoxc is just really nice (312)Zoxc is just really nice (312)Zoxc is just really nice (312)

Default

Maybe we might find a way to sync things throught this?
__________________
Zoxc is offline   Reply With Quote
Old 01-24-2006, 05:21 PM   #5
Chuckle_Brother
Oh for the sake of fudge
 
Chuckle_Brother's Avatar


Respected User
 
Join Date: Dec 2005
Posts: 782

Submissions (2)

Chuckle_Brother will become famous soon enough (53)Chuckle_Brother will become famous soon enough (53)

Send a message via ICQ to Chuckle_Brother Send a message via AIM to Chuckle_Brother Send a message via MSN to Chuckle_Brother Send a message via Yahoo to Chuckle_Brother
Default

Finally, someone put out the source code for something, and it's in a language I have had the chance to learn. Huzzah!. So anyway, now that we have these capabilities we really need to figure out HOW the game derives certain values, such as damage and such....otherwise this is just a load of code that won't be able to help anyone really.
__________________
"...you play a mean banjo"
Chuckle_Brother is offline   Reply With Quote
Old 01-24-2006, 05:37 PM   #6
Zoxc
( ~)>
 
Zoxc's Avatar


Respected User
 
Join Date: Feb 2005
Posts: 959

Submissions (9)

Zoxc is just really nice (312)Zoxc is just really nice (312)Zoxc is just really nice (312)

Default

Quote:
Originally Posted by Chuckle_Brother
Finally, someone put out the source code for something, and it's in a language I have had the chance to learn. Huzzah!. So anyway, now that we have these capabilities we really need to figure out HOW the game derives certain values, such as damage and such....otherwise this is just a load of code that won't be able to help anyone really.

Except creating custom ladder systems and deliver messages from web into map. This will only work if one of the players has the mod.
__________________
Zoxc is offline   Reply With Quote
Old 01-24-2006, 06:46 PM   #7
Extrarius
User
 
Extrarius's Avatar
 
Join Date: Jul 2002
Posts: 952

Submissions (1)

Extrarius will become famous soon enough (59)Extrarius will become famous soon enough (59)

Send a message via ICQ to Extrarius
Default

Quote:
Originally Posted by Zoxc
[...]This will only work if one of the players has the mod.
I'm fairly certain every player will need the mod, because without it the Jass will seem to contain invalid code (that calls undefined functions) and thus it should cause an error.
There might be ways around that problem, such as altering an almost-never-used native to make it do something special if a certain value is passed in, but that would be a fairly difficult addition to what xttocs has released.
__________________
ExtProtect - Extrarius's Map Protector
Extrarius is offline   Reply With Quote
Old 01-24-2006, 08:58 PM   #8
xttocs
User


Respected User
 
Join Date: Jul 2002
Posts: 181

xttocs will become famous soon enough (51)xttocs will become famous soon enough (51)

Default

Ext, that is not difficult to add at all. Also, there numerous natives that are part of the game that aren't listed in common.j but are still already part of the game.

Here are some of the natives that are already present but do nothing.
Code:
Prototype - Native Name
"(S)V" - "DebugS"
"(SI)V" - "DebugFI"
"(SI)V" - "DebugUnitID"
"(IS)V" - "DisplayText"
"(ISI)V" - "DisplayTextI"
"(ISII)V" - "DisplayTextII"
"(ISIII)V" - "DisplayTextIII"
"(I)V" - "DebugBreak"

Last edited by xttocs : 01-24-2006 at 09:00 PM.
xttocs is offline   Reply With Quote
Old 01-24-2006, 09:27 PM   #9
COOLer
User
 
COOLer's Avatar
 
Join Date: Aug 2002
Posts: 485

COOLer is on a distinguished road (14)

Default

i seem to get compile errors on
[Warning] `naked' attribute directive ignored
`push' undeclared (first use this function)
void __declspec(naked) jInitializing_hook()
{
__asm
{
push ecx
push edx
call jInitializing
pop edx
pop ecx
jmp jBindNative
}
}
__________________
One of the original Wc3c Uber Jass Ninjas “ Now OOP can happen in Jass ”
Current Projects :
  1. Jass++ : Bringing OOP syntax to Jass
  2. Project Revolution: Most anticipated mod for WC3

Last edited by COOLer : 01-24-2006 at 09:28 PM.
COOLer is offline   Reply With Quote
Old 01-24-2006, 09:59 PM   #10
Zoxc
( ~)>
 
Zoxc's Avatar


Respected User
 
Join Date: Feb 2005
Posts: 959

Submissions (9)

Zoxc is just really nice (312)Zoxc is just really nice (312)Zoxc is just really nice (312)

Default

Me too, what do you use to build it? to both of ya ;)
__________________
Zoxc is offline   Reply With Quote
Old 01-24-2006, 10:05 PM   #11
COOLer
User
 
COOLer's Avatar
 
Join Date: Aug 2002
Posts: 485

COOLer is on a distinguished road (14)

Default

I got it to work you needed complie it as a libray im using Dev C++ IDE

this is the native that i want to add.
bool IsKeyPressed(char a){
if(kbhit()&& a == getch())
return true;
return false;
}

basicly it checks if key has been pressed and then gets the key and see if it is equal to the value passed.

hmm it only works on concle apps...
__________________
One of the original Wc3c Uber Jass Ninjas “ Now OOP can happen in Jass ”
Current Projects :
  1. Jass++ : Bringing OOP syntax to Jass
  2. Project Revolution: Most anticipated mod for WC3

Last edited by COOLer : 01-24-2006 at 10:24 PM.
COOLer is offline   Reply With Quote
Old 01-24-2006, 10:55 PM   #12
Extrarius
User
 
Extrarius's Avatar
 
Join Date: Jul 2002
Posts: 952

Submissions (1)

Extrarius will become famous soon enough (59)Extrarius will become famous soon enough (59)

Send a message via ICQ to Extrarius
Default

Quote:
Originally Posted by xttocs
Ext, that is not difficult to add at all. [...]
It depends on what you mean - finding a native isn't hard, but you can't just make it do ANYTHING special, it has to do a very certain thing - namely, execute jass script from somewhere that the other player's wc3's won't look, so theirs will run fine and won't have syntax errors but the hosts' file will do something different without desyncing. That seems to mean it could save everybody's info, but only the host could restore it (and even to do that much, you'd need some way to send info from the host to clients so they could decode the stored 'save code', maybe like tricking the host's wc3 into thinking he typed the text code to all players).

As far as how to compile it, you need MSVC because GCC uses a different format for inline assembly. Currently, though, the code isn't very useful to anybody that doesn't know how to inject a DLL into a process because xttocs hasn't added in that part yet.
You can freely (and legally) obtain VC 2005 Express Edition for several months (it's going to be downloadable for 1 year total, but once you download it you can freely use it forever), or if you can't stand the 2005 interface (like me), you can get VC Toolit 2003 for free (legally), but it only contains the command-line compilers and not the fancy interface (I use VS2002 w/ the 2003 compiler)

Note that if you get either one of the free versions listed above, you'll also need to download the Platform SDK and set up your compiler to work with it. The retail versions of visual studio come with the platform SDK, but it's a large download so the free versions don't include it.
__________________
ExtProtect - Extrarius's Map Protector

Last edited by Extrarius : 01-24-2006 at 11:04 PM.
Extrarius is offline   Reply With Quote
Old 01-24-2006, 11:02 PM   #13
Zoxc
( ~)>
 
Zoxc's Avatar


Respected User
 
Join Date: Feb 2005
Posts: 959

Submissions (9)

Zoxc is just really nice (312)Zoxc is just really nice (312)Zoxc is just really nice (312)

Default

We can make ladder systems
__________________
Zoxc is offline   Reply With Quote
Old 01-24-2006, 11:08 PM   #14
Extrarius
User
 
Extrarius's Avatar
 
Join Date: Jul 2002
Posts: 952

Submissions (1)

Extrarius will become famous soon enough (59)Extrarius will become famous soon enough (59)

Send a message via ICQ to Extrarius
Default

Quote:
Originally Posted by COOLer
I got it to work you needed complie it as a libray im using Dev C++ IDE

this is the native that i want to add.
bool IsKeyPressed(char a){
if(kbhit()&& a == getch())
return true;
return false;
}

basicly it checks if key has been pressed and then gets the key and see if it is equal to the value passed.

hmm it only works on concle apps...
You'll have to use Windows API calls to do that kind of thing. GetAsyncKeyState is probably the function you want, but you could also use GetKeyboardState to get the status of every key. Note that such a native could only be used to control local things, because the other players will get different results. You would need to make some kind of 'DoesPlayerHaveKeyPressed' function and make it somehow synchronize between all players (a LOT of work if we don't find a way to use what wc3 already does, and even then it will feel laggy just like the arrow keys do because the synchonization is why they feel laggy).
__________________
ExtProtect - Extrarius's Map Protector
Extrarius is offline   Reply With Quote
Old 01-24-2006, 11:31 PM   #15
Zoxc
( ~)>
 
Zoxc's Avatar


Respected User
 
Join Date: Feb 2005
Posts: 959

Submissions (9)

Zoxc is just really nice (312)Zoxc is just really nice (312)Zoxc is just really nice (312)

Default

I think he wanted it for single player... also its easy to sync a bool (0.5 sec thus...)
__________________
Zoxc is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:09 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services