| 02-01-2005, 01:43 PM | #1 |
Guest | ok iam trying to get this to work but i dunno how... is it possible to make a trigger that says u can only have a specific item in ur inventory once??? if so please post it here :P |
| 02-01-2005, 02:23 PM | #2 | |
Quote:
I dunno... the only way I can think is if you remember every item type that has been in the inventory and prevent it from being acquired again. So you have a boolean array that corresponds with an item-type array and when you acquire an item, the boolean is set to true and makes it such that you can't acquire such an item again. |
| 02-01-2005, 03:19 PM | #3 |
Guest | iam not that advanced with it... can u post some trigger examples ??? |
| 02-01-2005, 04:42 PM | #4 |
Guest | Im pretty sure I know how to do this. If you are looking for a boolean array example, an excellent one is in the Warchasers map, in the monsterspawn folder where they set each building to a different number of the same array, or set, and then set up which kind of monsters it spawns. Basically, an array is a set of objects that each have their own number. If I make an array called Heroes, and I want to set an object to a number, then I do Set Variable and pick the array I want. If I pick heroes, it will say, "Set Heroes[Index] = Value". Index is a placeholder until you pick which number you want. For example, if I want the first number of a Heroes to correspond to a Paladin, then I click Index, choose Value, type 1, and push enter. Now it will look like this: "Set Heroes[1] = Value". Then I click Value, choose unit-type, and pick a Paladin. Now the Paladin corresponds to one. So you could have each item correspond to a number. In the beginning of the map, each item will be set to either true or false. And then when they pick up the item, then (see the warchasers part i told you about, i forget the exact commands) have a trigger that sets that item = to either true or false (the opposite of which it started). Then have an item picking up trigger that says (warning: advanced, read about loops), event: a hero acquires an item, actions: for every integer a from one to (number of items in map, whatever is the last number of your array), do actions: If Loop Integer Item[1] = to true, destroy item or remove item from inventory, whichever you prefer. The part I am not sure about is Item[1], because I have never made a loop before. Someone else can tell you what you have to put in the Item[1] to make it work. If it is only one item you want to make this happen to, just do event: hero acquires an item, condition: item-type equals (item you want), action: Set Item[Player number of triggering unit] = Item[Player number of triggering unit] + 1, then another: event: hero acquires an item, condition: item-type equals (item you want), action: if Item[Player number of triggering unit] = 1, destroy/remove item being manipulated. OMG, I should get some MAJOR Rep points for that. |
| 02-01-2005, 05:47 PM | #5 |
http://www.wc3campaigns.com/showthread.php?t=69994 - I did some large posts on there with examples, and its set out properly to |
| 02-01-2005, 08:21 PM | #6 |
Guest | then can u tell me how i make this condition??: Conditions WeapsHeld[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 2 i cant find the right comparisation... :S and is weapsheld supposed to be a item type array?? |
| 02-02-2005, 01:30 PM | #7 | |
Quote:
Yes, weapsheld or what ever is an item type array. As for the condition, its an integer comparison. |
| 02-02-2005, 02:46 PM | #8 | |
Guest | Quote:
well it doesnt work i cant get it to the right sentence... what part of the integer comparisation do i use??? the "item level" "item charges" and "item custom value" are useless so wich do i use then??? |
| 02-03-2005, 02:28 PM | #9 | |
Quote:
Deary me... its not that hard... I take it you know how to make a condition (correct me if im wrong), so after you have created it, change it to an INTEGER COMPARISON. INTEGER , not item-type or item-class, but INTEGER. The default is number of units in units in playable map area. Click on that and change it to WeapsHeld[(Player number of (Owner of (Triggering unit)))] in the dropdown box. |
| 02-03-2005, 08:10 PM | #10 |
Guest | i suppose you mean the variables but WeapsHold isnt showed there thats my whole problem... i dont know what iam doing wrong :S i have an integer comparisation, i click on the "number of units in units in playable map area" but i cant select the variable anywhere, it just doesnt show it. and iam sure i have the variable set to an Item-Type array of 50 |
| 02-04-2005, 11:16 PM | #11 | |
Guest | Quote:
That could be your problem. Some conditions types can only use certain types of variables. Integer comparisons might not use integer arrays; maybe they only use integers. I'm not sure which condition types accept integer arrays. I was pretty sure that integer comparisons used integer arrays. And as much as I hate to hear (and tell you) this myself, maybe you should go back and check again, or play around with it a bit. |
| 02-05-2005, 04:03 AM | #12 |
Dang... I deleted post on accident.. gotta rewrite... Make it like this... Two triggers needed.... Event - Unit Aquires an Item Condtion - Item Classification = (Artifact) Actions - If/Then/Else(Multiple Functions) If - Custom Value of (Unit manipulating Item) is Less than 2 Then - Set Custom Value of (Unit manipulating Item) = Custom Value Of (Unit manipulating Item) + 1 Else - Turn Off Trigger 2 Drop (Item being manipulated) Turn on Trigger 2 Trigger 2 Event - Unit loses an item Conditions - Item Classification = (Artifact) Actions - Set custom value of (Unit manipulating Item) = (Unit manipulating Item) - 1 |
| 02-05-2005, 05:31 AM | #13 |
Have only 1 item per type i aldready done it in my test rpg map so if u wanna know then just download it and see ^_^ |
| 02-05-2005, 09:00 PM | #14 |
Guest | well i am ever thankfull to all of you... i used ur triggers thedevil now iam facing a minor problem... i only care if it can be easely be solved, how do i make it that u can only get 1 wepaon in ur invent?? cause it works on the same items now but it doesnt work when u buy for example 1 small axe and 1 large axe u can both carry them... hope u guys can help me out again :P -Relaxed- |
| 02-06-2005, 07:32 AM | #15 | |
Quote:
|
