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

Need to small trigger

Status
Not open for further replies.
Level 1
Joined
Oct 12, 2011
Messages
4
hi

i need to trigger for show a picture in map only for 1 player.

for example :

event : player 1 use an item
condition : use item = avatar
action : cinematic mode fade in picture ...

this trigger show picture for all player! but i want to show pichtre only for player 1.

please help me. thank you! sorry for my bad languege :D
 
Level 1
Joined
Oct 12, 2011
Messages
4
thank you Mcasdf!

but i can not find "player 1 unit item event" from event list? i think event is custom trigger and i can not enter this to map trigger! can you help me?

and i need to other trigger.
i make TD and i want :

if wave 1 (Wave 1 contreled by computer) enter region 1 and under attack do use a ability by wave 1 (deactive Spells) for exm: ability is "divine shiled" or "invisbility".

in normal and defult active ability (in unit editor) spells not work automatic.

i need to AI for waves.

thank you!very much! I apologize for my language mistakes and text. :D
 
Level 6
Joined
May 13, 2009
Messages
260
No problem :)

The correct unit event is: Unit - A unit owned by Player 1 (Red) Uses an item

This is the trigger
  • trigger
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Region 1 <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Human Paladin - Activate Divine Shield
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Remember to use GetLocalPlayer() function in a safe manner to avoid desync.
Desync occurs when you create a split handle (Selected Player gets to see/feel the effect, other player will not be able to see it), which is what you're doing it now.

Desync-prone trigger;
  • Actions
    • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
    • Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
    • Custom script: endif
Prevent desync trigger;
  • Actions
    • Set SFX = <Empty String>
    • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
    • Set SFX = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
    • Custom script: endif
    • Special Effect - Create a special effect at (Center of (Playable map area)) using SFX
As you can see, I'm creating the handle outside the GetLocalPlayer() function, that way, it will never creates a split handle for other players.

So, if you create the handle outside the GetLocalPlayer() function, won't it affect other players as well ?
- No, because as you can see, before I called the function, I set my SFX variable (string variable) to an Empty String, and when I go into the GetLocalPlayer() function, I set the variable to "Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl"
Note that this variable setting occurs inside the GetLocalPlayer() function, right ?
Meaning that only the affected player will be setting that variable, and other players just followed the Empty String.
And after the SFX variable is set, I get out of the GetLocalPlayer() function and creates a handle for all players but only the players inside the function will see the effect while other players don't because I set it to Empty String, got that ?

Same goes to a situation where you want to create a unit that is only available to you.
First, you set that unit = No unit
And then inside the GetLocalPlayer() function, you set the variable to you desired unit
And then you create the unit by using the variable.
Only the affected players will see the unit, while others don't because you have set it to No unit, meaning that No unit is spawned for other players.
 
  • Like
Reactions: nGy
Level 1
Joined
Oct 12, 2011
Messages
4
thank you defskull and Mcasdf.

This is the trigger
trigger
Events
Unit - A unit Is attacked
Conditions
(Region 1 <gen> contains (Triggering unit)) Equal to True
Actions
Unit - Order (Triggering unit) to Human Paladin - Activate Divine Shield

i test this trigger but not work action! for custom abilitys What do I do?

for example i make custom ability (medusa mana shiled or bounty wind) and add this custom ability to Wave 1 units (wave 1 is enemy) and i want if wave 1 under attack by towers buildings use custom ability (wind or mana shiled or every . . .) for self , As DOTA AI maps.
 
Status
Not open for further replies.
Top