Do you want to support blizzardmodding.info? don't worry, we don't want money, just advertise it with this affiliate icon, or using any of the resources available here
WC3jass.com has a new theme, very similar to the original but lighter to load. If you have any suggestions or comments about it, just post it here.
We are getting more social!!! Visit the new social group section and create your own group with your friends
Welcome
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.
News!! #2 I know... I know, I've promised a monthly news, but real life has been rude with me
Ok, right now the main reason of this news is to show up to the jassers community the new Theme of WC3jass.com. Probably the main question is: what's wrong with the other theme?? The issue was it implied a lot of load in the server because it made some excessive calls to the server, and it's very likely people noticed it took 3-5 seconds to load... plain text.
This theme is based in the native one, which is faster. Now you should notice more speed in the load time but keeping the feeling as similar as possible like the previous theme.
If you find any bug with the theme, please report it here.
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.
Introduction Before I start, I would just like to credit Moyack for patience with testing and pointing out certain flaws, especially with how the code is presented.
Description I have created a function, that can group units in line with; a distance-value that is unchanged no matter where the end-point may be, a radius-value, a optional spread-value (determined in radians, easiest way to get the spread-angle you want is to create a constant with the spreadangle * bj_DEGTORAD) and an optional boolean exp-filter.
Requirements - vJass
Actual Code
Code: jass
library LineGroup /* library LineGroup, used to group units in a line with a optional boolexpr-filter.
privateconstantgroup GR = CreateGroup() //a constant unitgroup to avoid all CreateGroup, DestroyGroup and gr=null stuff
constantreal RV_pi2 = Acos(0) //A half-pi, should not be changed
privateconstantreal UNITEXTRASIZE = 16 //This number could be played with to fit your needs, it is basically just a number to make the radius-value more linear. Otherwise, only units with their centers in the cone passes the check.
endglobals
privatefunction LineGroupFunc takesgroup g, real startx, real starty, real endx, real endy, real distance, real radius, real spread, boolexpr bex returnsnothing
function LineGroup takesgroup g, real startx, real starty, real endx, real endy, real distance, real radius, real spread, boolexpr bex returnsnothing//spread is declared with angle in radians.
localreal rx = startx - endx //This is the function to call. To use it, create a group and call this function with the group.
What it does: it takes a group to fill (a group already existing), 4 coordinates (startx, starty, endx, endy), a real value distance (how far will this line go from the start-coordinates. It could reach and go further than the end-point or it could not get that far at all), a real angle expressed in radians that tells if and how much the line should change as it goes further (0.262 would give a 15~deg spread in angle, 0 will give a straight line) and a boolexpr "bex", this to actually lessen the cpu-usage in some cases, as the more units getting filtered away with the boolexpr, the less units it has to calculate for (just set this for null if you want it to take all units in the line)
How to import: Easiest way; download the testmap, open it with the NGJP-world editor, find the trigger named LineGroup and copy it, and paste it in your map. Alt. copy all text inside the LineGroup-trig and paste it in an empty text-trigger.
How to use: Create a group with locals or use a group from an global variable, then call LineGroup with the group as the first value, and the rest with the values in the order told at a number of places in this text.
Sample Code
Code: jass
function TestGroupLineBlaBla takesnothingreturnsnothing
localgroup g = CreateGroup//You need to have an already created goup in here.
And a little extra, the code won't empty the group itself, so you could make some special stuff, like fan-shapes and stuff (this might require some further math, if someone is interested, I could show how.)
If you find any trouble with this, know a way to improve it or just have a question, just ask in this thread or PM me. (the map have a non-other-than-me-user-friendly version of the TickTack, or ChainTimer as I have comed to call it. Dont mind 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.
Description The purpose of this library is to offer a single function which checks if the game is played in single player mode or multiplayer. Important: This function must be used only to define if the player is in single player or in Bnet or lan game. This function will fail in replays (it will show that you're in a LAN game by default).
Credits to Nestharus for the awesome solution to this problem