| 06-05-2004, 11:52 PM | #1 | |
Yea, a friend of mine asked me for help. In a desparate attempt for an answer. As he asked the forum several times for an answer. So I am asking for him. Quote:
Answer it please. |
| 06-06-2004, 12:38 AM | #2 | |
Quote:
Code:
Item System Events Unit - A unit Acquires an item Conditions Actions For each (Integer A) from 1 to 6, do (Actions) Loop - Actions If ((Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to [b]Powerup[/b]) then do (Set count = (count + 1)) else do (Do nothing) If (count Greater than 1) then do (Hero - Drop (Item being manipulated) from (Hero manipulating item)) else do (Do nothing) For each (Integer A) from 1 to 6, do (Actions) Loop - Actions If ((Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to [b]Perminant[/b]) then do (Set count = (count + 1)) else do (Do nothing) If (count Greater than 1) then do (Hero - Drop (Item being manipulated) from (Hero manipulating item)) else do (Do nothing) Just replace the bold word with the class types. ...You mentioned (he mentioned, really) that some things should be no more than 3, or whatnot. In that case, change the number where it says (count Greater then #). At least, I think that's what you want. Thats the only item-class comparison I could find. |
| 06-06-2004, 02:30 AM | #3 |
you could always do use my DT4a its built pretty much on the idea of restrictions... |
| 06-06-2004, 12:57 PM | #4 |
PLease stop advertizing you SYSTEM! People don't always like using something that is pure JASS and has nothing to do with he question! GEEZ! |
| 06-06-2004, 01:49 PM | #5 |
Um the system works for ITEM RESTRICTIONS. Thats why it was built, the above trigger is tedious and doesn't work properly, DT4a has been abused to be tested. I don't understand how you can call it advertiseing as you do the same crap when ever you made something and point a link to it when ever anyone asks a question about it... Is saying lookin in teh FAQ advertiseing? |
| 06-06-2004, 02:04 PM | #6 |
You asked how it could be done. He gave an answer. If you don't like it, make one better. You also never said JASS couldn't be used, nor that you did want a system. I'd hardly call pointing to his work, when it is relevent advertising. Also, what does he gain from getting more downloads? He's not getting payed for this. I've seen weadder's work, and you should really consider it. It does do what your asking for, and he might find some of the other features useful. |
| 06-10-2004, 06:28 AM | #7 |
Ok but can u do the same in normal triggers(without JASS)?? i dont where to copy custom scripts, what to do with item arrays.... |
| 06-10-2004, 07:29 PM | #8 |
I played with something similar, though not as thick. I limited units to carrying only one weapon, one armor, and one jewlery. I set weapons to 1, armors to 2, and jewleries to 4. I limited it with a very basic trigger. W = 1 A = 2 W+A = 1+2 = 3 J = 4 W+J = 1+4 = 5 A+J = 2+4 = 6 W+A+J = 1+2+4 = 7 If a hero tried to equip a weapon, it would check the hero's custom points. If it was 1, 3, 5, or 7 it would not let him equip the weapon. If it wasn't any of those number it would let him equip and add 1 to his custom points. You are asking for something for complicated, but it just means more numbers. One number for each jewlery, etc. |
| 06-10-2004, 09:43 PM | #9 |
wow.. thats pretty smart :D but you would have to make sure u have numbers that will always work and never duplicate an answer. |
| 06-10-2004, 11:13 PM | #10 |
well I used a bit flagging system in DT4a only I did it a little bit more clever I found out which bits were actually enabled. Decoding an int isn't hard at all. I stole peppars function only because it was so compact. Code:
function DecodeInt takes integer bf, integer bit_num returns boolean
return ModuloInteger(bf / R2I(Pow(2, bit_num)), 2) == 1
endfunctionIt was really a neat system for its time I think. |
| 06-11-2004, 02:11 PM | #11 |
It seems that witha ll this info, you should be able to whip something up. :) |
| 06-11-2004, 08:43 PM | #12 |
I actually made a really nice, and totally ignored system for this that can be configured in GUI. http://www.wc3campaigns.com/showthread.php?t=42798 and weaaddar spent too much time in his system, let him do that , it allows a lot of stuff, and you don't really need to know JASS that much, just to know how to type |
| 06-11-2004, 09:15 PM | #13 |
i suggest, if you really don't want to look into weaddars system. do something like johnfn, but only with item lvls for example, it easy to set item level in item editor so have weapons lvl 1, shields lvl 2, helmet lvl 3, etc etc. or whatever classes you have and then as units aquires an item check first what lvl it is.. event: unit aquires item condition: none action: local unit hero= hero that is manipulating the item loop from 1 to 6 if in slot (loop variable) of hero item level == level of item being manipulated then drop the item being manipulated enter some text for player("no, you already got this item class") end loop something like that |
| 06-11-2004, 09:21 PM | #14 |
Levels would make item dropping more difficult, the same if you use classification, mine is better actually |
