• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to proper send transmission from unit ?

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
So I wanna know how to proper send a transmission to a specific player, NOT ALL PLAYERS OR PLAYER GROUPS. So how can this be achieved? I tried the following trigger but it turns out it has a "triggeraction" leak in the transmission (I debuged it to know the right action that was causing the leak and it was the transmission from unit).

  • Untitled Trigger
    • Events
    • Conditions
    • Actions
      • Set PlayerGroup = (Player group((Triggering player)))
      • Cinematic - Turn cinematic mode On for PlayerGroup
      • Cinematic - Send transmission to PlayerGroup from (Triggering unit) named Example: Play No sound and display Hi, recruit.... Modify duration: Add 0.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for PlayerGroup
      • Custom script: call DestroyForce(udg_PlayerGroup)
 
If you're really worried about this kind of stuff you should be using vJASS.

Anyway, this should work.

  • Set Player = (Triggering Player()
  • Set Unit = (Your Unit)
  • Custom script: if (GetLocalPlayer() == udg_Player) then
  • Custom script: call DoTransmissionBasicsXYBJ(GetUnitTypeId(udg_Unit), GetPlayerColor(udg_Player), GetUnitX(udg_Unit), GetUnitY(udg_Unit), null, GetUnitName(udg_Unit), "YOUR MESSAGE", bj_NOTHING_SOUND_DURATION)
  • Custom script: endif
 
it's not possible to send clear transmissions trought normal GUI ? I'm not really a jass expert. I'll try your solution, thanks for the help!

PS: Do I need to destroy the player and unit variables after I use it ?

You should probably set the unit variable to null.

If you want it to be exactly the same as the GUI command you will have to issue these commands too

JASS:
call PingMinimap(UNIT_POSITION_X, UNIT_POSITION_Y, bj_TRANSMISSION_PING_TIME)  // this can be done in GUI, I think
if (not IsUnitHidden(whichUnit)) then
    call UnitAddIndicator(whichUnit, bj_TRANSMISSION_IND_RED, bj_TRANSMISSION_IND_BLUE, bj_TRANSMISSION_IND_GREEN, bj_TRANSMISSION_IND_ALPHA) // this too
endif

as well as implement your own wait if that's what you want.

JASS:
call WaitTransmissionDuration(soundHandle, timeType, timeVal)
 
Status
Not open for further replies.
Top