HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Carrying only one type of item...?

02-11-2007, 02:01 AM#1
Ignitedstar
I have not yet found another thread that concerns this question using the search function. If someone would like to direct me there, it is all one has to do. It's probably some simple solution, but I haven't found it yet.

Anyhow, I found a way to make sure that the weapon cannot wield two identical weapons, but I haven't found a way to make it so that it cannot wield another weapon within the same type.

For example, if a hero grabs a permanent item that gives +3 damage, then grabs another, the effects of the second don't work. However, if the hero were to grab a permanent item that gives +6 damage and has the previous item that gives +3 damage, it will gain the +6 damage(for a total of nine) when the +3 damage should be the only one working.

If more information is needed, then just say so. Thank you in advance.
02-12-2007, 04:28 PM#2
evolve2000
You must use trigger COnditions ! i think...
02-12-2007, 06:13 PM#3
happyraver
I also sought a solution for this earlier and made this set of triggers to solve the problem.
Now I am a beginner in this area so it could probably be done in som other way.

I had a set of custom made melee weapons that I wanted the hero to only carry one at a time, not being able to carry double swords etc.
I categorized the weapons as Artifacts. So this will affect all Artifacts in the map, thought that wasn't an issue to me.
The "Double Weapon prevent" trigger is initally disabled. When a weapon is aquired that trigger will be enabled though and the first trigger disabled. I think the rest speaks for itself.
The Erthae Ruvian unit is just the hero in my map, no other unit was owned by the player but u can edit that to your liking, aswell as the rest.
--------------------------------------------------------------------------

Acquire Weapon
Events
Unit - Erthae Ruvian 0002 <gen> Acquires an item
Conditions
(Item-class of (Item being manipulated)) Equal to Artifact
Actions
Wait 0.10 seconds
Trigger - Turn on Double Weapon prevent <gen>
Trigger - Turn off (This trigger)


--------------------------------------------------------------------------

Lose Weapon
Events
Unit - Erthae Ruvian 0002 <gen> Loses an item
Conditions
And - All (Conditions) are true
Conditions
(Item-class of (Item being manipulated)) Equal to Artifact
Actions
Trigger - Turn off Double Weapon prevent <gen>
Trigger - Turn on Acquire Weapon <gen>


--------------------------------------------------------------------------

Double Weapon prevent
Events
Unit - Erthae Ruvian 0002 <gen> Acquires an item
Conditions
And - All (Conditions) are true
Conditions
(Item-class of (Item being manipulated)) Equal to Artifact
Actions
Trigger - Turn off Lose Weapon <gen>
Hero - Drop (Item being manipulated) from Erthae Ruvian 0002 <gen>
Trigger - Turn on Lose Weapon <gen>
02-12-2007, 10:55 PM#4
Feroc1ty
Too bad the above is not MUI.
02-13-2007, 05:10 AM#5
Ignitedstar
Yes, over the past days, I figured that out. However, I don't know exactly which condition and what to put within the fields.
02-13-2007, 06:03 AM#6
happyraver
Quote:
Originally Posted by Jokes-On-You
Too bad the above is not MUI.


MUI?
02-13-2007, 09:23 AM#7
StockBreak
Quote:
Originally Posted by happyraver
MUI?
MUlti Instanceable, this mean that if you have many heroes/units doing the same action it will cause glitches or simply it won't work (this is mainly because you are using GUI, the normal trigger editor, and using global variables instead of local variables). If you want to create spells or something MUI using GUI, you can use arrays or variables; read here for more informations. Cheers.
02-13-2007, 01:18 PM#8
happyraver
Ah I see. Well no i didn't design it for MUI I guess. I'm not at that level yet :P
02-13-2007, 01:39 PM#9
Vexorian
this is an old thing I made a long ago.

A probable update to do is making it work with custom classifications instead of the object editor classifications.

Edit: no! I just forgot how it worked, it depends on the item's life, if an item class has 2 as factor then any item with a multiple of 2 hitpoints is an item of that class.
Attached Files
File type: w3xVexorian_ItemClass.w3x (27.2 KB)
02-14-2007, 04:50 AM#10
Ignitedstar
Thanks, Vexorian. I'll look into it. However, if anyone does know how to solve the problem, please post, as I still can't find the proper fields to edit.