Welcome to the community where modding your favorite game can be possible, and supported by a nice and warm community. Here you will find resources which will help you to develop your projects faster. Additionally you can show your projects and share with a growing community, even be part of the Blizzard Modding Network, which aims to gather all the projects and clans around this game.
JNGP 2.0.9 is live!!!! Fellow WC3 modders & mappers:
It's an honor to announce the release of the new version of JNGP: 2.0.9. With this new pack, I've added the most recent mods for WE and other features that will help you in the mapping process.
Among the main features added in this version, we can find the new WC3 patcher, which allows to set your WC3 installation in any version different from 1.27, this is needed to allow multiplayer emulation to work properly.
Some tools has been updated to the latest version:
One of my favorite string scripts from Python. I can't live without it.
StringStrip will strip the leading or trailing characters from a particular string. This is very, very useful for parsing. Just to show an example, you have a command: "-gold 500" Normally, you would read it as SubString(text, 6, StringLength(text)), and convert it to an integer. But what if someone types it like this? " -gold 600 " That should be perfectly acceptable, but the system will interpret it as "d 600 ". If you try to convert that, it will return 0. There are many ways to approach that problem, but one way is using StringStrip(). Simply:
function StringStrip takesstring text, string chars returnsstring
set text = StringStripLeft(text, chars)
return StringStripRight(text, chars)
It is mostly useful for spaces, but you can use other characters too--even multiple ones: "xxxtestxxx" -> StringStripLeft("xxx") -> "testxxx" "testing" -> StringStripRight("ing") -> "test" As far as complexity goes, this is a very lightweight function, despite how large it looks. It can be implemented recursively, but recursiveness is generally a bad idea in wc3 speed-wise. It doesn't generate any more strings than it needs, as well.
This library will allow you to simulate a 3D sound. It will have most of the features of a 3D sound, except for cones and velocity. Most of these are guesstimates, but when I compared it to the regular 3D sounds, they were very similar.
I don't have a 100% concrete grasp on what each field does, so if you have more insight on it, feel free to share. I interpreted it from a lot of testing, but even then there are still a few things I can't account for.
Anyway, why have this system? (1) 3D sounds are incredibly annoying. As far as I can tell, mp3's and 2-channel sounds don't work as them. This will allow you to use it as a regular sound, so you won't have to worry about any of that. (2) If you have a 3D sound, you cannot use SetSoundPlayPosition(...). If your sound is not 3D, you cannot have 3D features (obviously). This system will serve as a compromise, having the sound as non-3D and emulating the features of 3D sounds to get the best aspects of both sides.
This system allows you to register a code that will run every specified timeout. Note that this system only uses one timer for all registered codes. Therefore, codes with periods indivisible by 0.03125 doesn't run with a constant time interval. Although the difference will not exceed 0.03125, you probably don't want it to be that way. But this will not be much of a problem for codes with low frequency period such as those with timeouts greater than 2 seconds since the difference wouldn't be so noticeable.
In short, this works best for codes with timeout divisible by 0.03125 seconds.
This library will allow you to disable/enable the feature that allows you to skip cinematic transmissions by pressing ESC. Some RPG's are ruined when other players press ESC during a cinematic because it skips the transmission for everyone. This neat script can prevent that.
This solves the ever-so-annoying problem of unit orientation--determining how one unit is facing, or oriented, in relation to another. This snippet provides the functionality to: - Determine if a unit is behind a unit - Determine if a unit is facing the behind of a unit - Determine if a unit is facing a unit
All with an angle margin (margin of error, sort of) to determine what is considered "true" or "false" for those functions. View the image and the documentation to get a better understanding of how the angle margin works. Here is the code:
Let me know if there are any functions you want me to add. If you still don't understand the purpose of this, think about the conditions for a backstab spell. You have to be (A) behind the target, (B) facing the target. This snippet will allow you to check those easily.