HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting passive procs for spells

10-30-2005, 06:42 AM#1
Taelrie
Well I have been trying to puzzle this out, and I am sure this has been answered somewhere else (the search function is broken, always says "gotta wait a minute" etc.) but I am stumped. the problem is there is no trigger to detect when he uses a crit! (I am using critical strike with a 0 crit modifier as the effect). I first tried having it proc a buff on the enemy, which worked, but then I couldn't find what I could use to detect that he has the effect (there is a condition to use for it but not an effect). Then I tried with the buff, same problem. Can anyone help?

I suppose I might as well also ask another question while im at it, another custom spell I am using happens to use black filtering as an effect. However black filtering only allows itself to be applied to everyone; is there any way to give only a singel user a black filter?
10-30-2005, 09:33 AM#2
Anitarf
There's no way to detect passive abilities such as critical strike unless you trigger them entirely.

It is possible to apply a filter for one player, using GetLocalPlayer() function. Here's an example:

Code:
    Set TempInteger = ((Player number of (Owner of (Ordered unit))) - 1)
    Custom script:   if GetLocalPlayer() == Player( udg_TempInteger ) then
    Cinematic - Apply a filter over 0.01 seconds using Normal blending on texture Scope, starting with color (0.00%, 0.00%, 0.00%) and 100.00% transparency and ending with color (0.00%, 0.00%, 0.00%) and 0.00% transparency
    Custom script:   endif
10-31-2005, 04:21 PM#3
Taelrie
Quote:
Originally Posted by Anitarf
There's no way to detect passive abilities such as critical strike unless you trigger them entirely.

It is possible to apply a filter for one player, using GetLocalPlayer() function. Here's an example:

Code:
    Set TempInteger = ((Player number of (Owner of (Ordered unit))) - 1)
    Custom script:   if GetLocalPlayer() == Player( udg_TempInteger ) then
    Cinematic - Apply a filter over 0.01 seconds using Normal blending on texture Scope, starting with color (0.00%, 0.00%, 0.00%) and 100.00% transparency and ending with color (0.00%, 0.00%, 0.00%) and 0.00% transparency
    Custom script:   endif

The problem with this is the fact that the if statement is still applying to the total cinematic. you aren't making a filter for (owner of (ordered unit)-1) (btw why -1, wouldn't that do the player before him, like blue if teal did the action), it would be checking if local player is the person who is behind the player doing the action, then filtering for everyone if he is.
11-02-2005, 08:23 AM#4
Anitarf
Quote:
Originally Posted by Taelrie
The problem with this is the fact that the if statement is still applying to the total cinematic. you aren't making a filter for (owner of (ordered unit)-1) (btw why -1, wouldn't that do the player before him, like blue if teal did the action), it would be checking if local player is the person who is behind the player doing the action, then filtering for everyone if he is.
Wrong. GetLocalPlayer() gives you the player on who's computer the trigger is running. The trigger runs on all computers at the same time, but the if will only be true on one computer, so the fade action will only run for that player and won't be able to affect what happens on other player's computers where it doesn't run.

Of course, this sort of thing can cause a desync, a game split. You must be careful what actions you use within the if block, it must be the kind of stuff that doesn't generate network traffic. So, creating a unit is wrong. Not even all fade filter actions are safe, as far as I know... use only the "advanced fade filter" action.

I put a -1 there because GUI counts players from 1, JASS counts them from 0. If I used "GetConvertedPlayer()" instead of "Player()" in the if, then I wouldn't have to substract 1.