• 🏆 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!

GetLocalPlayer Help

Status
Not open for further replies.
Hi, so I don't really know JASS at all but need a GetLocalPlayer function to work so I can properly display a fade filter for players that are being damaged.

Here's my trigger:

  • Blood Splat
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Velma the Dolphin
    • Actions
      • Set FilterPath[1] = BloodSplat.tga
      • Set FilterPath[2] = BloodSplat.tga
      • Set FilterPath[3] = BloodSplat.tga
      • Set FilterPath[4] = BloodSplat.tga
      • Set FilterPath[5] = BloodSplat.tga
      • Set FilterPath[6] = BloodSplat.tga
      • Set FilterString = <Empty String>
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == Player(bj_forLoopAIndex) then
          • Set FilterString = FilterPath[bj_forLoopAIndex]
          • Custom script: endif
          • Cinematic - Fade out and back in over 1.00 seconds using texture BloodSplat.tga and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
This is pretty much copy pasted from another thread I found, but it didn't work for me unfortunately. All players still sees the fade filter when any unit of type Velma the Dolphin (don't ask) is damaged.
 
Level 4
Joined
Mar 8, 2006
Messages
27
I assume the `using texture BloodSplat.tga` should use `FilterString`, not `"BloodSplat.tga"` otherwise what's the point of all of that code above it?

Also why make an array with 6 of the same thing, then pick one of them? They're always BloodSplat.tga, no need for the array or the loop at all.

Basically what you want is for everyone who isn't a specific player (I'm assuming the owner of `DamageEventTarget`) to use the path `""`, but for the owner of `DamageEventTarget` to use the path `BloodSplat.tga`.
 
I assume your "using texture BloodSplat.tga" should use `FilterString`, not "BloodSplat.tga"
I can't select a string as a texture to use though :(

Also why make an array with 6 of the same thing, then pick one of them? They're always BloodSplat.tga, no need for the array at all.
True, I just copy pasted from that other thread but it makes sense when you say it.
 
Level 39
Joined
Feb 27, 2007
Messages
5,024
It's much simpler than what you're doing.
  • Blood Splat
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Velma the Dolphin
    • Actions
      • Set YesSplat = BloodSplat.tga
      • Set FilterString = <Empty String>
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_DamageEventTarget) then
      • Set FilterString = YesSplat
      • Custom script: endif
      • Custom script: call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUTIN, 1, udg_FilterString, 1.0, 1.0, 1.0, 0)
You can see what the arguments for the function are below. I presumed you actually want to use color so 3 of the last 4 arguments should be 1.0 not 0.
function CinematicFadeBJ takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans
 
It's much simpler than what you're doing.
  • Blood Splat
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Velma the Dolphin
    • Actions
      • Set YesSplat = BloodSplat.tga
      • Set FilterString = <Empty String>
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_DamageEventTarget) then
      • Set FilterString = YesSplat
      • Custom script: endif
      • Custom script: call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUTIN, 1, udg_FilterString, 1.0, 1.0, 1.0, 0)
You can see what the arguments for the function are below. I presumed you actually want to use color so 3 of the last 4 arguments should be 1.0 not 0.
function CinematicFadeBJ takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans
Thanks got it now.
 
Status
Not open for further replies.
Top