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

[Solved] Variable type for running random trigger

Status
Not open for further replies.
Level 4
Joined
Feb 5, 2020
Messages
48
What variable type do I need to use to run a trigger checking condition based on random integer? To put it in context I have a dialogue box with a random button. When the player press the random button I want it to roll a random interger that decides which trigger to run (OBS run is not the same as turn on).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Expanding HerlySQR's answer. You use a trigger array to store a trigger for all possible outcomes in sequential indices of the array. You can then use a random integer between the start and end indices of the array list to select a random item from it. This selected trigger can then be run using the appropriate run trigger action.
 
Last edited:
Level 4
Joined
Feb 5, 2020
Messages
48
Well I'll be honest with you, I did not find these replys useful at all as it avoided the core question which was what variable type it had to be. However I found it myself and if anyone else is wondering how to do this it's actually quite simple. These are the only two triggers you need;
  • Trigger Example
    • Events
    • Conditions
    • Actions
      • Set VariableSet RandomTrigger[1] = (This trigger)
      • Trigger - Run RandomTrigger[(Random integer number between 1 and 6)] (checking conditions)
Where RandomTrigger type is trigger and has of course an array box.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
Well I'll be honest with you, I did not find these replys useful at all as it avoided the core question which was what variable type it had to be. However I found it myself and if anyone else is wondering how to do this it's actually quite simple. These are the only two triggers you need;
  • Trigger Example
    • Events
    • Conditions
    • Actions
      • Set VariableSet RandomTrigger[1] = (This trigger)
      • Trigger - Run RandomTrigger[(Random integer number between 1 and 6)] (checking conditions)
Where RandomTrigger type is trigger and has of course an array box.
Not to be rude but Dr Super Good said: "You use a trigger array".

But I understand you may not know what an array is or maybe you didn't know there was a Trigger variable, or both. In the future just assume that there's a variable type for basically everything in Warcraft 3.
 
Level 4
Joined
Feb 5, 2020
Messages
48
Not to be rude but Dr Super Good said: "You use a trigger array".

But I understand you may not know what an array is or maybe you didn't know there was a Trigger variable, or both. In the future just assume that there's a variable type for basically everything in Warcraft 3.
Well if you pay attention to what I said in the original post you should assume I know what an array is. Saying "use a trigger array" is very vague but you're right technically he did say which type to use but because of the phrasing it did not help me. Just like how you somehow completely ignored that I must know what an array is if I am aware of how to run a random integer number. And yes you are being rude.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
Well if you pay attention to what I said in the original post you should assume I know what an array is. Saying "use a trigger array" is very vague but you're right technically he did say which type to use but because of the phrasing it did not help me. Just like how you somehow completely ignored that I must know what an array is if I am aware of how to run a random integer number. And yes you are being rude.
Ah, you knew what is an array, but not how to get a random integer?
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,889
To this very moment, I still don't know what in the world the actual question was...
The title answers itself, even though it makes no sense.
Your description answers itself.
People tell you exactly what you need to do, you proceed to claim "is very vague", "phrasing didn't help me" and afterwards do the exact thing they told you to do.
Either there's not a sufficient level of english comprehension or...
did andreasaspenberg hack your account? :xxd:
But I understand you may not know what an array is or maybe you didn't know there was a Trigger variable, or both. In the future just assume that there's a variable type for basically everything in Warcraft 3.
One might not know a lot of things. But what I do when I don't know something I try and explore what certain things do and what not. If I can't find anything, then yes I ask. In this case, our friend knows the existence of variables, so it's very hard to miss the array option, try it out, check all variable types...it's a very basic and exploratory thing that anyone who's new users of world editor should do, and not doing this indicates laziness, unwillingness to try things on your own, fragile mindset.

Not knowing something basic doesn't really excuse you to just outright ask for help when you haven't even tried at all.

These are the only two triggers you need;
  • Trigger Example
    • Events
    • Conditions
    • Actions
      • Set VariableSet RandomTrigger[1] = (This trigger)
      • Trigger - Run RandomTrigger[(Random integer number between 1 and 6)] (checking conditions)
Where RandomTrigger type is trigger and has of course an array box.
These are not triggers. This is 1 trigger that contains 2 actions.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
Well if you pay attention to what I said in the original post you should assume I know what an array is. Saying "use a trigger array" is very vague but you're right technically he did say which type to use but because of the phrasing it did not help me. Just like how you somehow completely ignored that I must know what an array is if I am aware of how to run a random integer number. And yes you are being rude.
If we're going to talk about phrasing, this is your question: "What variable type do I need to use to run a trigger?"
This was the answer: Use a trigger array.

You also said: "When the player press the random button I want it to roll a random interger that decides which trigger to run" which made it sounds like you knew how to do the random integer part.

But if that was too vague which is understandable then you could always ask to elaborate:

"Okay, can I see an example of a Trigger array please?".

From my perspective you were being rude and still are.
 
Last edited:
Level 4
Joined
Feb 5, 2020
Messages
48
Lol are you children still bickering in here? I've marked this thread as solved ages ago. Whether you like it or not the replies I got did not help me at all because they were not clear enough. They might seem clear you you because maybe you already knew the answer but they weren't for me. But when someone searches the forum and sees my trigger and my text it will be clear to them as well, you are welcome.

Calling me out for saying triggers instead of action is honestly laughable. You really didn't have anything more substantial to criticise me with? Just wanted to pick a fight? Pathetic.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
This guy asked for help in a poor way, we gave him what he asked and completely despises us, he criticizes our way of responding when his was worse and on top of that he recriminates when someone criticizes his way of responding, that is why I did not respond to his rudeness.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
Lol are you children still bickering in here? I've marked this thread as solved ages ago. Whether you like it or not the replies I got did not help me at all because they were not clear enough. They might seem clear you you because maybe you already knew the answer but they weren't for me. But when someone searches the forum and sees my trigger and my text it will be clear to them as well, you are welcome.

Calling me out for saying triggers instead of action is honestly laughable. You really didn't have anything more substantial to criticise me with? Just wanted to pick a fight? Pathetic.
It's probably not a good idea to call everyone here children, especially after they've tried to help you and I've personally spent hours of my free time helping you with triggers in other threads.

ANYWAY, let's stop this back and forth quarrel, it's a waste of everyone's time. We think you were rude, you think we were rude, it sounds like it was a big misunderstanding. Both sides could have clearly played this out better so let's just move on, otherwise I'm going to lock the thread and/or have to report people which I'd really rather not do.
 
Level 4
Joined
Feb 5, 2020
Messages
48
If we're going to talk about phrasing, this is your question: "What variable type do I need to use to run a trigger?"
This was the answer: Use a trigger array.

You also said: "When the player press the random button I want it to roll a random interger that decides which trigger to run" which made it sounds like you knew how to do the random integer part.

But if that was too vague which is understandable then you could always ask to elaborate:

"Okay, can I see an example of a Trigger array please?".

From my perspective you were being rude and still are.
It is sad to see a "moderator" acting like 13 year old troll, baiting members by throwing around empty baseless assumptions and then calling them "rude" for being upset about it. I didn't say they were stupid, I just said it did not help me which it didn't. That is not being rude that is stating a fact. Because of that I made a much clearer explanation of the problem for future people searching the forum. I think you should take a deep breath and reflect on that.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
It is sad to see a "moderator" acting like 13 year old troll, baiting members by throwing around empty baseless assumptions and then calling them "rude" for being upset about it. I didn't say they were stupid, I just said it did not help me which it didn't. That is not being rude that is stating a fact. Because of that I made a much clearer explanation of the problem for future people searching the forum. I think you should take a deep breath and reflect on that.
I don't see it from that perspective and I'll explain to you why in a PM. We can discuss it there.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,889
Uncle and DSG are very patient and kind people, even HerlySQR.
You, on the other hand, were having a meltdown over nothing at all, and some lack of communication?...I was probably just as confused as them trying to understand the logic of your first three posts. Defending yourself further just made a rod for your own back.
Calling me out for saying triggers instead of action is honestly laughable. You really didn't have anything more substantial to criticise me with? Just wanted to pick a fight? Pathetic.
I call it correcting your mistake and you should step off your pride and accept it, it's that simple. There was no hidden intention. It was substantial enough, and other things have already been said, no point in repeating the same. You can view it however you want because it's convenient for you.
My post before had some comedic sense, but this one is just telling you to get some self-awareness, no one is trying to gank up on you just because we like it.
Yeah, I've just wanted to clear that up, this is just getting awkward at this point.
 
Status
Not open for further replies.
Top