Danis[h]
New Member
- Reaction score
- 19
So basically I want my non-important units to speak idle gossip through floating text tags when you right-click them and stand near them, but I only want it to be possible for them to 'chatter' once every 6th seconds (since that's the duration of the floating text) so the text tags wont overlap..
Also, I think I've been able to make it so that it will only display for the player who clicks the unit, however I'm not sure if it will work?
edit
In case you were wondering about the string im referring to in the trigger 'AravilleChatter' then here it is set up.
Also, I think I've been able to make it so that it will only display for the player who clicks the unit, however I'm not sure if it will work?
Trigger:
- Show Chatter
- Events
- Unit - A unit Is issued an order targeting an object
- Conditions
- ((Owner of (Target unit of issued order)) Equal to Player 10 (Light Blue)) and ((Target unit of issued order) Not equal to (Random unit from ImportantUnits))
- (Issued order) Equal to (Order(smart))
- Actions
- Custom script: local string Message = ""
- Set Point = (Position of (Ordered unit))
- Set Point2 = (Position of (Target unit of issued order))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between Point and Point2) Less than or equal to 200.00
- Then - Actions
- Set Die[0] = (Random integer number between 1 and 6)
- Custom script: if GetLocalPlayer() == GetOwningPlayer(GetOrderedUnit()) then
- Custom script: set Message = udg_AravilleChatter[udg_Die[0]]
- Custom script: endif
- Custom script: call CreateTextTagLocBJ( Message, udg_Point2, 0, 10, 100, 100, 100, 0 )
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 6.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
- Custom script: set Message = null
- Else - Actions
- Do nothing
- If - Conditions
- Custom script: call RemoveLocation(udg_Point)
- Custom script: call RemoveLocation(udg_Point2)
- Events
edit
In case you were wondering about the string im referring to in the trigger 'AravilleChatter' then here it is set up.
Trigger:
- Araville Chatter Setup
- Events
- Map initialization
- Conditions
- Actions
- Set AravilleChatter[1] = Lovely Weather
- Set AravilleChatter[2] = There's nothing like a good bit of fresh air, don't you think?
- Set AravilleChatter[3] = Welcome, stranger!
- Set AravilleChatter[4] = You're not from around here, are you?
- Set AravilleChatter[5] = Stop Bothering Me
- Set AravilleChatter[6] = We don't want no trouble here. Araville is a nice town
- Events