HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

restricting items?

08-14-2003, 12:18 PM#1
311
I thought this would be easy to do, with varibles but I just cant seem to find out how now. What I want to do is have it so I can only carry 1armor/1weapon/boots/gloves/2misc. I thought it was as simple as putting all my armor items into a varible called armor, then have a trigger saying if you pick up the 2nd armor item auto drop it. However I don't see how to add multiple items into a varible. any help? Hope someone understands what I want, its the best I could explain it
ex: i got about 25armor items, I want it so i cant have 2at the same time, and if I try to pick another up it will just give a msg, then drop automaticly

I know I some how need to put my items into varibles, all I can think of though is putting EVERY ITEM in to SEPERATE varibles though, and I got about 150items, so I dont really wanna do that. I want somthing like a armor variable(with 25items in it) a weapon variable(with 40items in it) and so on, is it possible?
08-14-2003, 12:25 PM#2
Izidkiel
I am also in need of such trigger for my CS map. Can anyone help?
08-14-2003, 01:25 PM#3
Gurrgel
Try making each kind of item type (armor, weapons) inte an allready existing item type (artefacts, powerups and so on). Think there are triggers to notice items of item types in inventory.
08-14-2003, 01:39 PM#4
Vexorian
This will help you only if you have few items for each class, There is a way to put more than an item into a variable, just use arrays, when creating the Variable Check the array Checkbox

Then whenever you need to give an item to a variable

Let's say you have 12 items for each class. You need to set each variable MANUALLY, I will only do the armor class thing:

armor(1) = Ring of protection +1
armor(2) = Ring of protection +2
....
armor(12) = Leather armor

These actions should appearat map initialization

Then you have to do a for loop to get an item's class, when you need it. (you need a BOOLEAN variable for each item class) Use the unit adquires item action.




set bITEMisARMOR = False
set bITEMisWeapon = False
set bITEMisBoots = False
set bITEMisGloves = False
set bITEMisMisc = False
For each integer a from 1 to 12 do (multiple actions)
=Loop actions
==If (Item being manipulated) equal to Armor(Integer A) then Set bITEMisARMOR = True
==If (Item being manipulated) equal to Weapon(Integer A) then Set bITEMisWeapon = True
==If (Item being manipulated) equal to Boots(Integer A) then Set bITEMisBoots = True
==If (Item being manipulated) equal to Gloves(Integer A) then Set bITEMisGloves = True
==If (Item being manipulated) equal to Misc(Integer A) then Set bITEMisMisc = True
(end of the loop)

That way you get the class of the Item, when you use an Unit adquires item event.

Now if the hero is wearing an item of the (item being manipulated)'s class, we drop it

If (Conditions are true) then do (multiple actions)
-Conditions:
--bITEMisArmor equal to TRUE
-Then - Actions
--For each integer A from 1 to 6 do (multiple Actions)
---Loop - actions
----For each integer B from 1 to 12 do (multiple Actions)
-----Loop - actions
------If (conditions are True) Then do (multiple Actions)
-------Conditions :(Item carried by (Triggering Unit) in slot (integer A) equal to armor(integer B)
.........Actions:
---------Drop (item carriedby (triggering Unit) in slot (integer A) fro (triggering unit)
---------Game Show Text message to (Convert player to player group(Owner of Triggering unit)) :You can wear 2 armor items at the same time

Repeat the last actions for each item class.
08-14-2003, 01:53 PM#5
Krakou
This can be a very long process if you have hundreds items.
I used HP of the items to set the class, just make the items invulnerable to avoid class shifting.

The best way would be if we could add more item classes (maybe UMSWE 4.0 ?)
08-14-2003, 02:03 PM#6
Vexorian
If I just could use Hit points for my arena, too bad I have this item disappearance system.
08-14-2003, 02:19 PM#7
311
how would I do it by hitpoints? If I make them invurnable how will I destroy the items on the ground? as of now sometimes theres to many items on the ground and I like to kill them, I thought about making triggers that would delete the items however this is what I think would happen

e: item on ground in entire map area
c: none
a: wait 80sec delete item if some1 picks it up wont it be deleated after the 80secs still?
08-14-2003, 02:19 PM#8
311
how would I do it by hitpoints? If I make them invurnable how will I destroy the items on the ground? as of now sometimes theres to many items on the ground and I like to kill them, I thought about making triggers that would delete the items however this is what I think would happen

e: item on ground in entire map area
c: none
a: wait 80sec delete item if some1 picks it up wont it be deleated after the 80secs still?
08-14-2003, 03:35 PM#9
Vexorian
found a new way to do it , well it is the same I posted, but it doesn't need you to set every variable, this intelligent trigger will register each item's class by himself.

You need 5 regions (locate them in unused map areas), give each region a class name.

now Put every armor item in the region Armor, every weapon item in the region weapon, and continue with each item class.

Now you need 5 integer variables, ArmorNUM, WeaponNUM, gloveNUM, bootsNUM, and miscNUM, make all of them start on 0

Now at map initialiation:

Pick every item in armor and do (multiple actions)
--Set Armornum = Armornum + 1
--Set Armor(ArmorNum) = (picked Item)

Repeat this for every class.


now use the trigger I posted, but replace every 12 with the class' integer.
08-14-2003, 03:39 PM#10
Jitb
If you have a small amount of item classes, I suggest you use the Class system. When a unit aquires an item, check to see if they have any other item in their inventory that is the same class of the one they just picked up, if so, make them drop the last picked up item.
08-14-2003, 08:53 PM#11
311
I still don't get it. Is it to much to ask to put it in a small test map for me? I know your probably busy and all, and working on your own maps, but Id REALLY appreciate it. If not though its ok, Ill just somehow do it with hitpoints, or not at all :(
08-15-2003, 02:21 AM#12
Neo_Genesis
You could use another intiger value to identify item classes, like level for instance sincer there is an item - item level in the intiger comparason.

so

Events
Unit - A unit Acquires an item
Conditions
(item level of (item being manipulated)) Equal to 1
Actions
Hero - Drop (item being manipulated) from (triggering Unit)

Hope that helps you

Neo_Genesis
08-15-2003, 09:35 AM#13
311
I use item level though, i got rares,uniques and all that kinda stuff
08-15-2003, 09:57 AM#14
XVoltaireX
hmm Hit Points very thought of that. I think I will use this in my map. Thnx
08-15-2003, 10:46 AM#15
BoZo
Bah, just used classes for the items.
I use this triggers for my map, it might help you...

armor drop
Events
Unit - Ifir 0000 <gen> Acquires an item
Conditions
(Item-class of (Item being manipulated)) Equal to Charged
Actions
Set armor = (armor + 1.00)

armor drop 2
Events
Unit - Ifir 0000 <gen> Acquires an item
Conditions
(Item-class of (Item being manipulated)) Equal to Charged
armor Greater than 1.00
Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Set armor = 1.00

armor drop 3
Events
Unit - Ifir 0000 <gen> Loses an item
Conditions
(Item-class of (Item being manipulated)) Equal to Charged
Actions
Set armor = 0.00

This works perfectly for one unit (or one player), so if your doing a map with multiple players you have to do one for every player.