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

"Send message to (Player: Owner of triggering unit)"?

Status
Not open for further replies.
Level 3
Joined
Jul 14, 2004
Messages
38
Send message to (player: Owner of triggering unit)

Does this trigger exist? I'm trying to send a message to the player as he enters a region but unlike the camera triggers there dosnt seem to be a message trigger that will send to triggering player. Is there a way I can do this without having to copy all my triggers for each specific player?

I have alot of messages to player triggers and if I have to make a specific one for each player I'll probabaly be x3 my trigger count. My maps already starting to look quite large, if anyone knows to do this I'd realy appreciate some help.

Golemeyes
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
This might be helpful:

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters <region>
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Entering unit)))) the text: <String>
Select the Display Text Message action. Display to <Convert Player To Player Group>, and then I guess you already know how to go on from there.
 
Level 3
Joined
Jul 14, 2004
Messages
38
This might be helpful:

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters <region>
    • Conditions
    • Actions
      • Game - Display to (Player group((Owner of (Entering unit)))) the text: <String>
Select the Display Text Message action. Display to <Convert Player To Player Group>, and then I guess you already know how to go on from there.

Nice thanks! So I need to Convert the triggering player to a player group first?

I'll test this out when I'm back home. I was using a specific variable (Unit: <String> enters region) rather than a generic unit event as I thought it would reduce the lag associated with the game runing a check every time a unit enteres a region, am I right in needing to take that into consideration?
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Specific unit causes less lag. First because Generic Unit Event calls a BJ function, which calls another function, so basically you are running 2 functions instead of 1, and then the conditions of Triggers are also coded and pilled up badly.

I suggest using Specific Unit Event if you can.
 
Level 3
Joined
Jul 14, 2004
Messages
38
I see, I thought so, I'll have a play around with this new infomation tonight and see if I can get it working with a specific unit event as I already have alot of Generic "Unit begins casting an ability" events. Btw sorry for the newb question but what does BJ stand for? I'm not very good with abreviations.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Blizzard.JASS
Half of the BJ functions call other functions, Blizzard created the BJs in order to fit the grammatic of the Triggers.

You can merge all those Unit Begins Casting an Ability events into one trigger and use if/then/else. Then have separate triggers for the spells:
Code:
If (Spell being cast)==CustomSpell1
then
 Trigger - Run <CustomSpell1>
else
 Do Nothing
Something like that.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Rui, the BJ call is insignificant in the case of events, since it's only run on map init, and never after, and AnyUnitEvent is rather useful as far as BJs go, anyways.

--

However, Specific Unit Event would be faster if it's only for one, preplaced unit, because it won't have to consider the conditions for every unit in existence when the event is fulfilled. However, if you noticed the difference, your computer wouldn't be able to play WarCraft.
 
Status
Not open for further replies.
Top