HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

No more then one of same item. How?

09-29-2004, 05:24 PM#1
Jem1128
Hey im makeing an RPG and am trying to set it up so your hero can only have one of the same item at a time. This is my trigger as of now. All it does is make your hero drop any item even if u dont have anything the same.


Items1
Events
Unit - A unit Acquires an item
Conditions
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by Hero_of_Player[(Player number of (Owner of (Triggering unit)))] in slot (Integer A)))
Then - Actions
Wait 1.00 seconds
Item - Move (Item being manipulated) to (Position of (Triggering unit))
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Sorry you cant have...
Else - Actions
Skip remaining actions


Can anyone tell me why its not workin?
09-29-2004, 06:45 PM#2
Dead-Inside
Actually the action you're looking for is

Hero - Drop item

Otherwise it looks correct. Let me guess, the text fired but you never dropped anything? ;)
09-29-2004, 11:19 PM#3
Jem1128
Quote:
Originally Posted by Dead-Inside
Actually the action you're looking for is

Hero - Drop item

Otherwise it looks correct. Let me guess, the text fired but you never dropped anything? ;)

No it drops the item but i will use drop item anyway
but the big proble is whenever you get an item it drops it even if u dont have any items let alone the same ones
very anying lol
09-30-2004, 04:03 AM#4
thedevil
Event:a unit accquire an item
Condition:none
Action:
Set itemcount=0 (itemcount is a variable interger no array)
For each interger A from 1 to 6 do multi action
loop-If then else do multi action
And all conditon equal to true
+Item type of item being manipulate equal to item carry by hero manipulate in slot [interger A]
Action:
+set Itemcount=itemcount+1
Else action:
do nothing
If then else do multi action
+Itemcount greater than or equal to 2
action:
make hero manipulate item drop item being manipulate

All done ^^ i learned it from thyflame he also send me a sample map if u want then i can send it for u
09-30-2004, 05:06 AM#5
Jem1128
Thanks thedevil i hope it works ill fix it in the mornin, and tell u how it goes
09-30-2004, 05:34 AM#6
Dead-Inside
Edit: Sorry Vex 'n' thedevil, I can't read.
09-30-2004, 01:20 PM#7
Vexorian
Quote:
Originally Posted by Dead-Inside
Umm... It's "If item count equal to *1*"
Actually, in the unit acquires an item event, The unit already has the gotten item in its inventory, so it is 2
09-30-2004, 07:22 PM#8
Jem1128
Quote:
Originally Posted by thedevil

All done ^^ i learned it from thyflame he also send me a sample map if u want then i can send it for u

yo thanks again i set it up and it seems to be workin fine.
09-30-2004, 08:00 PM#9
Jem1128
ok now that i got that one working on to the next question

i want to set up another trigger now to do almost the same thing but with item class
i made all armor power ups all weapons charged so on
then made another trigger almost exactly the same
Here it is:

NoSameItemClass
Events
Unit - A unit Acquires an item
Conditions
Actions
Set itemclass = 0
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by Hero_of_Player[(Player number of (Owner of (Triggering unit)))] in slot (Integer A)))
Then - Actions
Set itemclass = (itemclass + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
itemcount Greater than or equal to 2
Then - Actions
Hero - Drop (Item being manipulated) from Hero_of_Player[(Player number of (Owner of (Triggering unit)))]
Else - Actions
Do nothing


ok and yep u gessed it
it doesnt work ahhhh
can anyone help

oh and i also wan add a thing so that if item class misalanius it ignors this trigger so that i can set up potion and things in that catigory and they can have more then one
09-30-2004, 09:09 PM#10
Anitarf
"Hero - Drop (Item being manipulated) from Hero_of_Player[(Player number of (Owner of (Triggering unit)))]"

Perhaps here is your problem and you set the variable wrong. Anyway, why don't you just use "triggering unit" instead of "Hero_of_Player[(Player number of (Owner of (Triggering unit)))]", as it appears they are meant to be the same thing?

Oh, no, wait, I found the real problem:

"itemcount Greater than or equal to 2" you forgot to change it to "itemclass"
09-30-2004, 09:43 PM#11
Gandalf2349
Yea, I was going to say the same thing, get rid of the Hero_of_Player[player number... and replace them with Hero Manipulating Item.

Also when you post you triggers, put them in [code] tags.
10-01-2004, 01:14 AM#12
Jem1128
Quote:
Originally Posted by Anitarf

Oh, no, wait, I found the real problem:

"itemcount Greater than or equal to 2" you forgot to change it to "itemclass"

lol thanks man do i feel like an idiot
10-02-2004, 12:58 AM#13
Jem1128
ok so how can i set it up so that the item class miscellaneous is ignor so i can put potions and stuff in there so the hero can hold like a mana potion and a healing potion that are both miscellaneous

here is the original trigger:

Code:
NoSameItemClass
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        Set itemclass = 0
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by Hero_of_Player[(Player number of (Owner of (Triggering unit)))] in slot (Integer A)))
                    Then - Actions
                        Set itemclass = (itemclass + 1)
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        itemclass Greater than or equal to 2
                    Then - Actions
                        Hero - Drop (Item being manipulated) from Hero_of_Player[(Player number of (Owner of (Triggering unit)))]
                    Else - Actions
                        Do nothing
10-02-2004, 02:13 AM#14
BuRnInSpartan
well you could do what i did and have slot 1 be designated for weapon 2 armor things (like shield) 3 4 5 6 mis. and then do a unit aquires an item item being manipulated equal to item caried in slot one by hero (w.e.) in slot 1 equal to item type of (sword) drop item being manipulated game- sorry you cannot carry two swords
10-03-2004, 02:54 PM#15
Anitarf
At the beginning of the trigger, put "if item type of item being manipulated equal to miscelaneous then skip remaining actions else do nothing"