HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do you get all #'s 1-20?

11-01-2004, 01:46 PM#1
311
There are 2 differnt triggers I need this for, random # doesn't work It just gets 1 #.
condition: Item = to Artifact 1-20

I want it to be item is equal to any of the 20items, I dont want to put 20conditions, im sure there is a way to make it item 1 through 20, without having to put all 20 seperate
11-01-2004, 02:14 PM#2
HEZZA
Yeah me might be able to understand the question rather than your mumbling
11-01-2004, 06:15 PM#3
Zazzadar
I THINK your having a problem i did...but you post is a little unclear.

Do you mean that whenever it generates a random number it generates the same one every time?

In that case press file>preferences and uncheck Use Fixed Random Seed

OR

Do you want to have 1 variable that can hold several values? In which case check the array button in the variable and then each new value you put in it will have an Index number (just have a fidlle around thats what i did lol and got it to work)
11-01-2004, 07:15 PM#4
linkmaster23
Create an Item Array and then Create a Loop from 1-20 checking all the items inside. [If you don't understand my answer, fix your question.]
11-01-2004, 10:46 PM#5
Squally425
And also, after doing wut linkmaster23 told you, you might like to rewrite that condition.
You're basically asking the program if it is a random one of 1-20.
Basically you're asking the program to generate TWO random numbers IF you had an action "unit/hero/wutever manipulates an item".

Step by Step Procedure u are asking the program to do is:
1) Generate a random number between 1 - 20. Lets say it gets 6.
2) Ask the program if the item is a random item between 1 - 20. The program generates another random number, lets say 8.

If the item is number 8 (which the program has as 6) then do actions.
And since 8 and 6 aren't equal... it won't work.

You're going to need a condition with an array variable.
11-01-2004, 10:50 PM#6
linkmaster23
Did I miss something? Or did I just answer his question just fine...o.O
11-01-2004, 10:56 PM#7
Squally425
No your answer is perfectly fine.
I'm just saying, he needs to rewrite his condition.
11-01-2004, 11:05 PM#8
linkmaster23
He needs to rewrite his question... -.-j
11-01-2004, 11:15 PM#9
-={tWiStÄr}=-
wow.. you guys really misunderstood it.. he just wants to save time instead of
OR
item = tome of knowledge
item = tome of intel..
... 20 times
to do what you want, you need to use jass and have a preset array. because in GUI you cannot do a loop in a condition but in jass you can. if you dont know jass then dont bother with this, sorry.
one thing you could do is have a if then loop. so have a loop 1-20 with and if/then/else statement in it, and if the condition item is equal to items[forloopindexa] then set a boolean to true. then after the loop if the boolean is true do nothing, if it is false skip remaining actions.
11-02-2004, 01:29 AM#10
311
Ok twister understood me it seems, I don't think it was to hard to understand my question, but I will try my best to show you what I want

Heres how I dont want to do it, but think I need to

E: unit picks up item
C: item = to sword(1)
C: item = to sword(2)
C: item = to sword(3)
C: item = to sword(4)
C: item = to sword(5)
C: item = to sword(6)
C: item = to sword(7)
and so on

Now here is what I want if its possible

E: unit picks up item
C: item = any sword (1-20)




so any of the 20swords I pick up it will fire
11-02-2004, 03:38 AM#11
-={tWiStÄr}=-
yeah, theres no way except for writing them all out. i think you may need the OR function though. the trigger will run if any of the conditions are met. it is at the bottom of the condition pulldown. if you are looking for a shorthand way to do it, you have jass or the loop thing.
11-02-2004, 04:38 PM#12
linkmaster23
Wow, that was... an easy explanation...