• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Unit Inventory

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Hi forum dwellers. I got a rather confusing question

When a normal unit is given the "Inventory (Hero)" ability a couple of bad things happen. The unit can hold and use bonuses from items (even though he is a normal unit and if item gives stats, they just don't add up) but the most disturbing thing is that when that unit dies, if the items aren't removed, moved or dropped via triggers or something else, they stack up.

When another normal unit dies, not only does the system not show the items he was holding, but the items from the previous unit that died are spawned at a random location (most likely the point where the new unit died)


QUESTION IS:

Is there any way via either game constants, triggers or object data to change this?

WHAT I WANT TO HAPPEN

Unit dies, items get moved to a dummy treasure chest. When a new unit of the same player is created, items are given to it.

WHERE'S THE PROBLEM

Sometimes the system bugs and doesn't move the items. They get send to the "void" and are dropped from it when another random unit dies. They cannot be used, retrieved or sold when in the "void"
 
Level 9
Joined
Dec 6, 2007
Messages
233
Instead of giving it "Inventory (Hero)", try making a custom inventory ability based off of a "Unit Inventory" ability and setting the "Data - Item Capacity" field to 6. Might produce different results.

Also, can you post your triggers for all of that?
 

sentrywiz

S

sentrywiz

Thing is that Inventory unit isn't an active inventory. Its meant for melee maps, for example if your hero is in your base and you have a footman near a shop, you can buy an item with the footman, but the item gives nothing to the footman. The footman is just a transport, so you can later on give it to the hero you want.

How do you mean post triggers, I haven't made any triggers yet.
 

sentrywiz

S

sentrywiz

@MortAr - thanks for the effort, but you missed my point. I could of made these triggers myself (better, without the wait)

The problem is that normal units even if given hero inventory or change the normal inventory to keep items, they don't respawn like heroes do. That's why after a unit dies, the items that were in his inventory are gone (for the time being) and after some time, around 3-5 minutes the items will appear at the same death location.

I've tried what you did in the map (in my own full made map, with much better handling system, and it still bugs in 1 out of 10 cases)

Unit dies, items are kept. After X minutes, items reappear, like someone dropped them. Moving them at the exact same second doesn't help since its not 100% certain.

I need a solution to help a vulnerable normal unit on death with items to either move them, delete them then remake them but without the bug.
 
[trigger=Try this, but use some type of indexing method so it can be MUI or MPI]
Events
Unit - A unit Dies
Conditions
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set i = (i + 1)
Item - Create (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) at (Center of (Playable map area))
Set items = (Last created item)
Item - Hide (Last created item)
Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
Wait 2.00 seconds
Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Hero - Give items[(Integer A)] to (Last created unit)

[/trigger]

I would of made it for you, but I am currently busy with something, and I don't have the time to make this. Sorry, goodluck however. =)
 
Level 4
Joined
Oct 20, 2011
Messages
129
Use trigger to move items at the time that unit dies, so those item won't drop at its death location minutes after. Can't move items when a unit is dead? I'm sure you know how to make a fake death.
 

sentrywiz

S

sentrywiz

@Dat-C3 and @MortAr

Thanks for your ideas. The triggers that you posted aren't the issue. Its the % chance those triggers have to create the bug.

@ForeverBeADragon

I was considering this back when I was making Villager Wars 2. To create some sort of animation and instead of killing the units, to hide them or move them somewhere, remove the items then kill them. Of course then I just moved to Heroes, because I couldn't bother with the system anymore. Still, that's not a solution I am looking for, because as I said, I was using triggers like the above mentioned, only better suited for my map. And they failed, because in 1 out of 10 or 20 deaths, the system would miss one unit its items will go to hell, and the game balance goes out of whack.
 
Status
Not open for further replies.
Top