• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Itemsss!

Status
Not open for further replies.
Level 6
Joined
May 8, 2010
Messages
150
Basically, trying to create a trigger which when a hero picks up an item, such as "Sword" it will move it instantly to slot 1, but if theres already an item in slot one such as "Axe" it will move it to the trigger players bank.

But im struggeling to make the item move from one slot in the heroes inventory to another.

Can anyone help me?
Plus it must fit in with the below trigger.


[trigger=Item Sword]
Slot 1Sword
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Wooden Melee Weapon
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Wooden Melee Weapon
(Item carried by (Triggering unit) in slot 1) Equal to No item
((Unit-type of (Triggering unit)) Equal to Berserker) or ((Unit-type of (Triggering unit)) Equal to Hero)
Then - Actions
Else - Actions
Item - Move (Item being manipulated) to (Center of Banks[(Player number of (Owner of (Triggering unit)))])
[/trigger]


+ rep for helpers also!
Thanks.
 
I just worked on the same kind of system.
The action is in the unit category :
  • Unit - Order (Triggering unit) to move (Item being manipulated) to inventory slot 1
But you'll have to do something to avoid a player from moving items in inventory manually. You can do it in jass with the order IDs or you can just set your weapon-type into a variable and check if the variable is "No item-type" instead of check if there is no item in the inventory slot.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Basically, trying to create a trigger which when a hero picks up an item, such as "Sword" it will move it instantly to slot 1, but if theres already an item in slot one such as "Axe" it will move it to the trigger players bank.
to move item to slot use
issue order - move slot (find it at units actions)

and for Axe use
Hero - give item

if you want units to be able to pick up items with full inventory and store them to bank,than make

channel ability with

first line - empty
effects - none
range - 100
target - unit
targets allowed - items
follow trough time - 0
options - none
duration - 0.01
maan cost - 0
cooldown - 0

now use
trigger 1
event
unit is issued targeting an object
conditions
-if target item of issued order not equal to no item
-items carried by triggering unit equal to 6
Actions
order unit to channel at targeted item

trigger 2
when unit begins casting channel move target item of ability being cast to trigger player bank
 
Level 6
Joined
May 8, 2010
Messages
150
I have been doing that.

Well its not really a trigger.. a start of system.
Basically im doing it so a type of hero can only use one type of weapon.
For example.. Berserker.. Mellee Weapon.
But if the unit already has a weapon.. it moves it to the bank.. or if the unit isnt capable of using the type of item.

Conditions are..
if the unit isnt carrying any spears
and not already carrying the triggering item

[trigger=system]
DruidWeps
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Spears[(Min(1, 999))]
(Unit-type of (Triggering unit)) Equal to Druid
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item being manipulated) Not equal to (Item carried by (Triggering unit) in slot (Min(1, 6)))
Or - Any (Conditions) are true
Conditions
((Triggering unit) has an item of type Spears[(Min(1, 9999999))]) Not equal to True
Then - Actions
Else - Actions
Item - Move (Item being manipulated) to (Center of Banks[(Player number of (Owner of (Triggering unit)))])
Floating Text - Create floating text that reads Moved To Bank above (Triggering unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 25.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds

[/trigger]


This is the trigger so far.
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
here it is (at Attached Files)
you need to add your own conditions now
i dont use conditions at start of triggers because i use only 1 trigger by event,so ther woulod be only 1 trigger with event "Unit Dies" in whole map

btw you should learn some triggering before making anything,i suggest learning triggering only and when you can,move to SC2
SC2 should have a lot better editor,and finally a freaking mouse detection

i think the important thing is to learn how to save things in variables and to learn how to make triggers short

for example,you can save what item is by setting his hit points to some value
1 HP item can be swords
2 HP item can be axes
3 HP item can be staffs
4 HP item can be shields
and you can also have shields in one item class,swords in another item class ...etc
this is good to avoid saveing item-types in variables (any useless object editor value is good i fcan be detected by triggers,you can also use Item level value instead item HP)
 

Attachments

  • MoveTo Bank.w3x
    17.7 KB · Views: 95
Level 6
Joined
May 8, 2010
Messages
150
Yes i added channel, i've copied everything over.
These are the triggers on MY map.

[trigger=ObjectTarget]
Events
Unit - A unit Is issued an order targeting an object
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Issued order) Not equal to (Order(channel))
(Target item of issued order) Not equal to No item
Then - Actions
Custom script: call IssueTargetItemOrder( GetTriggerUnit(), "channel", GetOrderTargetItem() )
Else - Actions

[/trigger]
trigger 2


[trigger=trig]
CastBegins
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to CHANNEL
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type (Item-type of (Target item of ability being cast))) Equal to True
Then - Actions
Item - Move (Last created item) to (Center of Banks[(Player number of (Owner of (Triggering unit)))])
Else - Actions
Hero - Give (Target item of ability being cast) to (Triggering unit)
Unit - Order (Triggering unit) to Stop
[/trigger]
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
use the trigger tags so we can see how your trigger looks like

(it looks good now,but copy trigger as text,use trigger tags,and paste between them)

upload your map and paste the link here so i could fix it if needed.....
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
you used
Item - Move (Last created item) to (Center of Banks[(Player number of (Owner of (Triggering unit)))])
instead
Item - Move (Target item of ability being cast) to (Center of Banks[(Player number of (Owner of (Triggering unit)))])
 
Status
Not open for further replies.
Top