| 11-04-2003, 03:23 PM | #1 |
I want to make a trigger that in a region there are many barrels, but only inside one of them there is a key that will be needed later... how do i make so that the barrel that the key is in is random? :bangH: |
| 11-04-2003, 03:36 PM | #2 |
Probably the easiest way is to create, in random locations, empty barrels, and have a single key-barrel get created. Destructible - create x barrels at random points in region Destructible - create 1 key-barrel at random point in region Set (Destructible variable) = last created destructible Then have another trigger watch for the death of a key barrel: (Destructible variable) dies Action: Create Key at location of killed destructible Since you're creating the barrels randomly every time, there's no way of knowing where the thing is. |
| 11-04-2003, 03:44 PM | #3 |
or place around 50 barels, adn give each a 1% chance that it will drop a key.... maybe u won't get the key at all, so use a trigger to add them to a unit group, and when the unit group is gone, spawn the key :) |
| 11-04-2003, 10:25 PM | #4 |
I like the first idea and the second one is kinda confusing, but if i did do the first one then wouldn't they know that that barrel had the key because of the name? |
| 11-04-2003, 10:30 PM | #5 |
not if you gave them all the same names |
| 11-04-2003, 10:38 PM | #6 |
Er, yeah, I thought that part'd be obvious. Naturally, you'd give them the same name; Key would be something you'd put in the editor suffix, not in the actual name. The key-barrel would still be labelled "Barrel". |
| 11-04-2003, 10:39 PM | #7 |
Heres what I would do. Add all the barrels to the map, and make one drop the key (put this one anywhere) Then select a random barrel, delete it, and move the barrel with the key to it's location. |
| 11-05-2003, 10:51 PM | #8 |
but there are many areas with barrels and there are paths that seperate each area of barrels. Isn't there like a tigger like Created 1 key in random barrel or sumthin? |
| 11-05-2003, 10:58 PM | #9 |
Seriously, Weirdusername, you have two perfectly workable answers. Go use them. |
| 11-06-2003, 12:08 AM | #10 |
Actually it could be done even easier...you could just make a custom item which is dropped upon death, randomly select one of all the barrels which are all the same units (no special key barrel) and they all have the ability to carry an item. They drop the key upon death and you can go pick it up. However as I write this I just realised you'd be able to select each barrel and view it's contents...but then again that's not really that bad is it? I'd kinda prefer it if you could check them as well as just randomly destroy them...Anyway, my way would be quicker but it has that little problem with the viewing, or you could just use the previous ones, either way it's not really a difficult problem I hope you realise...hell you could just randomly select one add it to a unit variable and then check whenever a barrel is destroyed and check if it's the one in the unit variable. |
| 11-06-2003, 02:39 AM | #11 |
Ok... thnx guys |
