View Full Version : Need to small trigger
alex1680
07-05-2012, 02:44 PM
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
Mcasdf
07-06-2012, 11:56 AM
Use
Event
Player 1 unit item event
Conditions
Item being used equals someitem
Actions
Custom script "if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then"
Do your stuff here
Custom script "endif"
alex1680
07-07-2012, 05:43 PM
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
Mcasdf
07-07-2012, 06:05 PM
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
defskull
07-08-2012, 01:09 AM
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.
alex1680
07-10-2012, 02:22 PM
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.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by
vBSEO 3.5.1 PL2