HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AH! item carrying help!

09-12-2004, 09:17 PM#1
skado
i have a couple questions plz.

1) how do i make it so a hero can only carry only one armor and only one weapon at a time ( i hope its kinda small trigger cuz ive got tons of items needed to be done)

2) to kinda go with the other one is there a way so only specific type of unit can buy certain items?

3)also if a hero has a bow item with sfx (using orbs as a base item) can it make them ranged somehow?

4)my minimap preview thing is all screwed.. i imported a 256x256 tga file and tried every type of bit but its a white screen as a preview!

thanks if u can help me with any of these ^_^
09-12-2004, 10:13 PM#2
-={tWiStÄr}=-
1. well.. its pretty much a long trigger.
Code:
Swords Copy
	Events
		Unit - A unit Acquires an item
	Conditions
		(Item-class of (Item being manipulated)) Equal to Permanent
	Actions
		If (All Conditions are True) then do (Then Actions) else do (Else Actions)
			If - Conditions
				Or - Any (Conditions) are true
					Conditions
						HeroClass[(Player number of (Owner of (Hero manipulating item)))] Equal to 1
			Then - 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 carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
							Then - Actions
								Hero - Drop (Item being manipulated) from (Hero manipulating item)
							Else - Actions
								Do nothing
			Else - Actions
				Hero - Drop (Item being manipulated) from (Hero manipulating item)
that should work for your second question also. you do have to set each hero to a class tho. to set the heroes class set the variable HeroClass[playernumberoftheherotobeclassed] equal to its class (1-whatever).
then you have to have item classes. luckily these are there for you. set all of the swords to permanent, armor to charged etc. in this trigger the class 1 corresponds to the permanent item class.
3. thier attack animation wont change but.. some abilities add range dont they? like item attack fire bonus.
4. I dont know much about minimaps sry :\
09-12-2004, 10:19 PM#3
AFB-DieHard
1) You could create two boolean for each player(maybe an array) which is set to true when you buy a weapon(first boolean) or shield(second boolean). Then when you buy another weapon/shield drop the bought item if the boolean1/2 is true.
09-12-2004, 10:22 PM#4
-={tWiStÄr}=-
yes but if he has multiple units then that would require tons of booleans and as each unit is created it would have to be indexed in the array then refrenced later through a loop which is a real pain. my trigger checks class and multiple items all in one.
09-13-2004, 12:21 AM#5
BuRnInSpartan
i made this for an rpg i made it works too (however it only works if sword is in slot 1 and armor is in slot 2...)

Unit - A unit Acquires an item
(Item-type of (Item being manipulated)) Equal to Sword
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item- type of(item carried by triggering unit in slot 1)) equal to sword
Then - Actions
item-remove
Else - Actions
nothing

09-13-2004, 02:10 AM#6
-={tWiStÄr}=-
well that requires a whole other trigger to constantly move the sword and shield to slots 1 & 2
09-13-2004, 03:04 AM#7
ObsidianTitan
A way that I came up with to do this a while ago was to set the life of items. For example set all weapons life to 1, and set all armors life to 2. This can be used to check alot more like requirements.

This trigger should do the trick.

Events
Unit - A unit Acquires an item
Conditions
((Triggering unit) is A Hero) Equal to True
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
(Integer((Current life of (Item being manipulated)))) Equal to (Integer((Current life of (Item carried by (Hero manipulating item) in slot (Integer A)))))
(Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
Then - Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Else - Actions
Do nothing
09-13-2004, 06:16 PM#8
terradax
Since im using a lot of permanent items, is it possible to make heroes use only one lvl 5 permanent item?

For instance, all my weapons are lvl 5, and i want the heroes to be able to use weapons and gloves of haste. can you give me the codes for that?
09-13-2004, 08:28 PM#9
Gandalf2349
Usually giving the items different settings for health is the best way to go. As long as you give them all the invulnerable ability you can have an infinite number of categories, and it's still easy to check, no-matter where they put them.
09-14-2004, 01:24 AM#10
ObsidianTitan
Sure you can check item level, im just going to add it to the trigger I posted earlier so it only checks the life of lvl 5 items.

Code:
    Events
        Unit - A unit Acquires an item
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    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
                        (Integer((Current life of (Item being manipulated)))) Equal to (Integer((Current life of (Item carried by (Hero manipulating item) in slot (Integer A)))))
                        (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
                        (Item level of (Item being manipulated)) Equal to 5
                        (Item level of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to 5
                    Then - Actions
                        Hero - Drop (Item being manipulated) from (Hero manipulating item)
                    Else - Actions
                        Do nothing