Question on Item Restrictions..

the_playa6916

Member!
Joined
Jul 30, 2004
Messages
54
Reaction score
0
Location
CaNaDa
Website
Visit site
Hey i was wondering how to not allow someone to pick up 2 weapons, or 2 armors, etc. i know the actions, just don't know how 2 specify it in Events/Conditions, since there is no "Weapon" item-type, or "Armor" item-type...

And another thing about items, if yu attach an attachment to lets say a right hand, and you actually do pick up 2 items that attach to the right hand, would this cause the game 2 crash after a while of using it? cuz mine seems to do that sometimes if i do that... Might be something else tho.

Thx alot,
PlaYa
 

Icedragon

BattleForums Addict
Joined
Aug 2, 2002
Messages
836
Reaction score
0
Location
The Swiming Pools
make your armors... permenants and your weapons something else.. then you can sort them like that...

I dont know much about attachments cause i havnt used them in any of my maps... its probaly not that though. its probably a trigger that causes and infinite loop or something
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
the_playa6916 said:
Hey i was wondering how to not allow someone to pick up 2 weapons, or 2 armors, etc. i know the actions, just don't know how 2 specify it in Events/Conditions, since there is no "Weapon" item-type, or "Armor" item-type...

And another thing about items, if yu attach an attachment to lets say a right hand, and you actually do pick up 2 items that attach to the right hand, would this cause the game 2 crash after a while of using it? cuz mine seems to do that sometimes if i do that... Might be something else tho.

Thx alot,
PlaYa
The easiest way is to make the items you pick up 'Dummy items', that use triggers when that item is picked up.

For example, you could make an item 'Gloves of Haste1' as a dummy item and rename it later. Gloves of Haste1 would make way for Gloves of Haste.

Then:

Event:
Hero - A hero acquires [Gloves of Haste1]

Action:
If - Conditions:
Hero - Hero has [Gloves of Haste]​
Then:
Hero - Drop [Gloves of Haste1]​
Else:
Hero - Create [Gloves of Haste] for [Hero manipulating item]
Hero - Remove [Gloves of Haste1] from [Hero manipulating item]​

Problem is, it's hard, because you cannot check each inventory slot for heroes.*
 

the_playa6916

Member!
Joined
Jul 30, 2004
Messages
54
Reaction score
0
Location
CaNaDa
Website
Visit site
Lol Icedragon that's a simple solution, *Doh* Why dint i think of that -_-

Yah X42 i would use that but i'd have to use "Hero - Hero has [Item]" for each and every item that exists in the specific group (Weapons, Armor, Shields, Etc)...
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
the_playa6916 said:
Lol Icedragon that's a simple solution, *Doh* Why dint i think of that -_-

Yah X42 i would use that but i'd have to use "Hero - Hero has [Item]" for each and every item that exists in the specific group (Weapons, Armor, Shields, Etc)...
I'm thinking of a way... If you could assign every single 'left' item to a variable in an array, and the same for the right, you could then use a For each Integer A from [start] to [end] action to check each item. You could use dummy variables as a condition...

Set left[0] = [Left Glove of Haste]
Set left[1] = [Left Glove of Slow]
... Must do beforehand, like Melee Initialization

For each Integer A from [0] to [length of left] Do Multiple actions
If [[left[Integer A] = [Manipulating Item (?)]] Then [Set [isLeft]=[true]] Else [Do Nothing]​
If - Conditions:
[[isLeft] = [true]]​
Then:
[Unit - Order [Hero Manipulating Item] to drop [Gloves of Haste1]]​
Else:
Hero - Create [Gloves of Haste] for [Hero manipulating item]
Hero - Remove [Gloves of Haste1] from [Hero manipulating item]​

Do this for each left and right item.*
 

the_playa6916

Member!
Joined
Jul 30, 2004
Messages
54
Reaction score
0
Location
CaNaDa
Website
Visit site
oh man... x42 is right, if you pick up an item, you can't check the rest of the inventory to see if the item exists there >.< (because the item yu picked up is now part of your inventory)

can you count the number of items of a certain class in your inventory somehow? or does anyone have a solution for only letting you pick up 1 item of a certain class?

--> it wud be better if this cud be done without having a dummy for each item!
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
the_playa6916 said:
oh man... x42 is right, if you pick up an item, you can't check the rest of the inventory to see if the item exists there >.< (because the item yu picked up is now part of your inventory)

can you count the number of items of a certain class in your inventory somehow? or does anyone have a solution for only letting you pick up 1 item of a certain class?

--> it wud be better if this cud be done without having a dummy for each item!
Without the ability to check all the inventory, it's very very hard. You have to use triggers to keep track of what items are in the inventory, when they acquire, drop or change owner. It's very tedious.*
 

Octopor

your whole family is made of meat
Joined
Nov 28, 2003
Messages
2,043
Reaction score
2
1)Go to clan eota on East.
2)Visit the website.
3)Ask for the trigger they used.
(In the map they make it so that you can't have more than one orb, glove or armor thingy.)
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
By trigger, simply check for the hero if he has 2 of whatever. Then either remove it and add money to the gold supply if it was bought, or cause him to drop it.
 

NewPosts

New threads

Top