Picking matching variables?

Neoz

New Member
Reaction score
0
Uhm I've got a hard trigger i guess. I have a trigger like:

Event
blabla
Condition
None
Action
Play random sound from 1-4

Now i want to make an action that makes when number 2 for instance is picked. it does a certain action.
Like this: number 2 is a sound for "Yes milord"
I want to have a floating tekst above this unit that reads "Yes Milord". How can i make this variable match the action? or is this impossible?
Sorry for the bad explaining. :p

And then another hard question:

Event
periodic
Condition
None
Action
Play units attack animation
Play metalchopmetal sound

Is it possible to bind this sound to an area? Like when its a normal sound? Because when you are fighting in someone elses camp you dont hear them attack very loud when you are building in your own camp.
I can try to explain the situation better if i have to, but i think im clear enough about what the problem is:p
 

jig7c

Stop reading me...-statement
Reaction score
123
Event
blabla
Condition
None
Action
Play random sound from Sound[1-4]
For each integer A 1 to 4
If Sound[Integer A] equal to 2
Then Create floating text "Hello" at some unit/point
Else
 

Moridin

Snow Leopard
Reaction score
144
jig7c, he won't be able to use a for-loop because he'll have different text for each sound.

It'll be more like this:

Trigger:
  • Events
    • Conditions
    • Actions
      • Set int = Random number from 1 to 4
      • Sound - Play sound[int]
      • If (multiple conditions) then do (then actions) else do (else actions)
        • If - Conditions
          • int = 1
        • then - Actions
          • Floating Text - Create floating text above <unit> saying <whatever>
        • else - Actions
      • If (multiple conditions) then do (then actions) else do (else actions)
        • If - Conditions
          • int = 2
        • then - Actions
          • Floating Text - Create floating text above <unit> saying <whatever>
        • else - Actions
      • If (multiple conditions) then do (then actions) else do (else actions)
        • If - Conditions
          • int = 3
        • then - Actions
          • Floating Text - Create floating text above <unit> saying <whatever>
        • else - Actions
      • If (multiple conditions) then do (then actions) else do (else actions)
        • If - Conditions
          • int = 4
        • then - Actions
          • Floating Text - Create floating text above <unit> saying <whatever>
        • else - Actions


Note: Freehand.

-------------------

Also, for your second question. Instead of using the action "Sound - Play Sound" use:

1) Sound - Play sound at point
2) Sound - Play sound on unit
 

Azylaminaz

Vox Populi
Reaction score
91
Would probably just be easier to use a matching string array.

IE..
sound[x]
string[x]

Unless you want the actions to be different.
 

Neoz

New Member
Reaction score
0
well moridin.. Have you tried to make this trigger with a sound array? Because boolean comparisons cant be used with sound arrays. They dont "see" this option. and azylaminaz: I do want those actions to be different.
but thanks for this play sound thing moradin:) that will probably help me. I didnt think of that before!:D
 

Moridin

Snow Leopard
Reaction score
144
I'm sorry but what?

I'm not using a boolean comparison anywhere.... :S.

Int - An integer variable
Sound[] - A sound variable array of size 5
 

Neoz

New Member
Reaction score
0
Great! you're right:) I thought you would because ive opened an other map to see what he did, which was with booleans and didnt work. So this works now. but for some reason i can still hear the sounds at the total left side of my map even when it is attached to an unit at the total right side of the map. Any suggestions about that? :confused:
 

Moridin

Snow Leopard
Reaction score
144
Hmm. Since I don't know what you've done, I have to ask you a couple of things. You also should note that I normally don't use/deal with custom sounds...so I might not be the best person to know. Anywho, a couple of things to check:

1) Have you used "Sound - Play sound at point" or "Sound - play sound over unit" ?

2) There is an action called "Sound - Attach sound to unit" or something close to that. Have you used this? or the first two? ^

3) Try and ensure that it is not a global sound or that you have your positions correct.

4) As you get closer to the point of origin of the sound, does it get louder? If this is the case, then it just means that your sound file is very very loud. So loud it can be heard across the map. You might want to decrease the volume by adjusting the volume % in the action.


IF all else fails, you can also try using this actions:

"Sound - Set sound cutoff distance"

which will cut off any remains of the specific sound past a certain radius around the origin point.
 

Neoz

New Member
Reaction score
0
I use sound over unit or point. (tried both) those things dont work, neither does attach to unit. It might be a global sound, can i change this sound that its only hearable when i see this unit on my screen?
the cutoff thing doesnt even work when i say the range is 1. not even at 0.1:p
 

Moridin

Snow Leopard
Reaction score
144
I really don't know then. :S

Unless I look at the actual map I can't do much. Right now I have to go offline....so I suggest either wait for someone else with more sound skillz to reply or wait till tomorrow when I can try helping you.
 

Neoz

New Member
Reaction score
0
Well thanks allot m8. You helped me with the tekst-sound thing anyway. Ill wait for a new answer:)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top