• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How u make Items for ONLY 1 unit?

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2004
Messages
28
I am having the same problem in my CTF map. I think i figured it out though, havn't tested it yet.
Events
Unit- within x range of unit(create a dummy unit that spawns whereever the item is)
Conditions
triggering unit not equal to (whatever your paladin is)
Actions
order triggering unit to stop
game display text message to owner of triggering unit "You cannot use this item."

*not sure if all that is how it would be written out in WE i don't have it open right now but u get the basic idea*

Its a sloppy way of doing things but its the best i've come up with so far. If u come up with anything better lemme know cause i need to get this perfected for my map too.
 
Level 5
Joined
Jul 11, 2004
Messages
183
Craft said:
I am having the same problem in my CTF map. I think i figured it out though, havn't tested it yet.
Events
Unit- within x range of unit(create a dummy unit that spawns whereever the item is)
Conditions
triggering unit not equal to (whatever your paladin is)
Actions
order triggering unit to stop
game display text message to owner of triggering unit "You cannot use this item."

*not sure if all that is how it would be written out in WE i don't have it open right now but u get the basic idea*

Its a sloppy way of doing things but its the best i've come up with so far. If u come up with anything better lemme know cause i need to get this perfected for my map too.

your trigger is weird :)..this kinda eazy.. just use Integer A or B equal to or not equal to then set unit drop item.. givin u a clue :)
 
Level 6
Joined
May 5, 2004
Messages
232
In fact, it is simple when you know what to do. You have two solutions: You can create a region where the item will go if it isn' t the right type of unit picking it up, or stop the unit' s action:

Events
.Unit-A unit picks up an item

Conditions
.Item type-Item type of item picked up Equals to *your item' s type*

.Unit type-Unit type of unit picking up triggering item *or item-type*

Actions
.Item-Move instantly item to region
or
.Unit-Order picking unit to stop

But I suggest you use a region, it is easier to do.
 
Level 7
Joined
Jul 30, 2004
Messages
451
theres a few ways to do that, the way i'm about to write (assuming you wish to restrict item use to 1 type per class (1 weapon, 1 armor, etc...) requires a bit of presetup

item levels denote 'class' (hand, armor, accessory, etc...)

Code:
Event --
    map init
Actions --
    set paladinequip[0] = sword1
    set paladinequip[1] = sword2
    set paladinequip[2] = sword3
    ... ... ...
    set paladinequip[10] = armor1
    set paladinequip[11] = armor2

Event --
    hero acquires item
Conditions --
    unit type of hero manipulating item == paladin
    level item != 4 //so all classes can carry items (which i denoted as lvl 4)
Actions --
    local integer i
    local boolean bCheck = false
    for i = 0 to nMaxEquip //just the max gear that it will check, in this case 11
    +   if item type of manipulated item == paladinequip[i] then
    +   +   set bCheck = true
    for i = 1 to 6
    +   if item level of item in slot (i) == item level or manipulated item AND item in slot (i) != manipulated item then
    +   +   set bCheck = false
    if bCheck == false then
    +   move manipulated item to position of manipulating hero

and repeated for other heros changing the item arrays

i just wrote this on the spot too without aide of waredit so it might be a little off, but that should be about it (i also know theres prob a better more concise way to do this but sue me, it was the best i could come up with at the time)
 
Level 5
Joined
Jul 11, 2004
Messages
183
Raptor-- said:
theres a few ways to do that, the way i'm about to write (assuming you wish to restrict item use to 1 type per class (1 weapon, 1 armor, etc...) requires a bit of presetup

item levels denote 'class' (hand, armor, accessory, etc...)

Code:
Event --
    map init
Actions --
    set paladinequip[0] = sword1
    set paladinequip[1] = sword2
    set paladinequip[2] = sword3
    ... ... ...
    set paladinequip[10] = armor1
    set paladinequip[11] = armor2

Event --
    hero acquires item
Conditions --
    unit type of hero manipulating item == paladin
    level item != 4 //so all classes can carry items (which i denoted as lvl 4)
Actions --
    local integer i
    local boolean bCheck = false
    for i = 0 to nMaxEquip //just the max gear that it will check, in this case 11
    +   if item type of manipulated item == paladinequip[i] then
    +   +   set bCheck = true
    for i = 1 to 6
    +   if item level of item in slot (i) == item level or manipulated item AND item in slot (i) != manipulated item then
    +   +   set bCheck = false
    if bCheck == false then
    +   move manipulated item to position of manipulating hero

Never thought of this way its cool though,,, peoples whoever needs items trigger,,use this one its cooler than other ways.
 
Status
Not open for further replies.
Top