• 🏆 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!

Replace an item

Status
Not open for further replies.
Level 16
Joined
Mar 3, 2006
Messages
1,564
Try this:

  • Item Replacing
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set Location = (Position of Item)
      • Item - Remove Item
      • Item - Create Tome of Experience at Location
      • Set Item = (Last created item)
      • Custom script: call RemoveLocation(udg_Location)
But I don't what do you mean by "ugly".
 
Level 6
Joined
Apr 23, 2008
Messages
263
Try this:

  • Item Replacing
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set Location = (Position of Item)
      • Item - Remove Item
      • Item - Create Tome of Experience at Location
      • Set Item = (Last created item)
      • Custom script: call RemoveLocation(udg_Location)
But I don't what do you mean by "ugly".

this is the most weird thing i've seen in a while o_O How would this help?

The problem is that the items position doesnt exist if I don't put in a 0.00 second wait before the actions, and this makes it look ugly.

also i tried hiding the item before the 0.00 wait but it still looks the same.
 
Level 6
Joined
Apr 23, 2008
Messages
263
My mind is overworked right now but i want the replacement to occur only when i drop an item on the ground and that trigger didn't even start hence to the event.

edit ~ If you want to know what i'm trying to achieve, I need to swap the permanent item with a powerup dummy item because otherwise it will say "inventory is full" when i pick up an item that would fulfill an item recipe.
 
Level 6
Joined
Apr 23, 2008
Messages
263
Powerup can be used even when the inventory is full.

that's exactly the reason to why i need the permanent item i drop on the ground to be replaced with a powerup item.

In DotA one can pick up an item on the ground if a recipe will be completed and you will have enough space, if the item wont fit in, the item will just stay there on the ground. If you look real close you can see that the item is replaced when you rightclick it (if it wont fit). So i assume the item on the ground is a powerup one.
 
Level 6
Joined
Apr 23, 2008
Messages
263
hmm so the first "Item" isn't the variable Item? it's the item being manipulated?

well now I have tested it... even though i have tested the same thing around ~10 times, the Location isnt where i put the item, it's where i picked up the item, and thats why i need a 0.00 sec wait to let the editor know the position of the dropped item, but when i use that 0.00 sec wait, it looks really bad. its just an item dropped on the ground that suddenly is destroyed and a new one is placed upon it.

I don't really think i can be any more clear now...

thanks anyways for trying
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
If you haven't read [SELF="http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/how-to-make-item-recipes-33931/"]this[/SELF] in the tutorial section try it now; it may help you make a recipe system, Although I haven't read it myself but it seems to cover your need since the creator mentioned that he is making a recipe system as in DotA.

Try it and good luck :grin:
 
Last edited:
Level 6
Joined
Apr 23, 2008
Messages
263
I thought that was obvious? the problem is, like i've said fiftyeleven times, that i need to replace the permanent item i put on the ground with a similar powerup one, but that is impossible to make it work flawless it seems. Icefrog must be some kind of genius.
 
Level 6
Joined
Apr 23, 2008
Messages
263
recipes can only be created by permanent items, you cant even carry the powerup items, they are just there as dummy items that allows you to complete a recipe with a full inventory
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
And when the recipe is complete that permanent item is replaced with the resulting item from the recipe ?

May be I didn't understand your problem well because I still don't understand why you would drop the permanent item to be replaced with a powerup, can you tell me a detailed information of the recipe system you need, please ?
 
Level 6
Joined
Apr 23, 2008
Messages
263
I still don't understand why you would drop the permanent item to be replaced with a powerup

you cant pick up a permanent item from the ground with a full inventory, even if the item-pickup would result in a complete recipe. that's why i need to replace every item you put on the ground with a similar powerup one, because this will enable recipe creation with a full inventory
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Is that statisfiyes what you need ?

  • Drop Item
    • Events
      • Unit - Warden 0000 <gen> Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    • Actions
      • Trigger - Turn off (This trigger)
      • Set TempLocation = ((Position of (Triggering unit)) offset by 100.00 towards (Facing of (Triggering unit)) degrees)
      • Item - Remove (Item being manipulated)
      • Item - Create Tome of Experience at TempLocation
 
Level 6
Joined
Apr 23, 2008
Messages
263
OK, I uderstand now.

But you said the trigger I post have some problem and looks wierd in the game do you mean the item animation when it is created, like tomes when they scale up and chests when they open ?

the Temp Point gets the wrong location for the item without my 0.00 wait
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
the Temp Point gets the wrong location for the item without my 0.00 wait

You are right I tested this couple of times and you are right, however, try the trigger I posted in #21. I get the location of the item drop manually.

It leaks two locations OK, so I don't a rain of posts "Your triggers leaks" "It leaks" and all that mumbo jumbo about leak, I KNOW IT LEAKS TWICE NOT ONCE.
 
Level 6
Joined
Apr 23, 2008
Messages
263
Is that statisfiyes what you need ?

  • Drop Item
    • Events
      • Unit - Warden 0000 <gen> Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    • Actions
      • Trigger - Turn off (This trigger)
      • Set TempLocation = ((Position of (Triggering unit)) offset by 100.00 towards (Facing of (Triggering unit)) degrees)
      • Item - Remove (Item being manipulated)
      • Item - Create Tome of Experience at TempLocation

i already had a trigger turn off and then remove item and then turn on trigger again thingie, but i didn't had the trigger turn off before i set the temp point, so i tried that... didnt help neither

edit: didnt see the pos. of triggering unit by offset, will test again.
ok ready to go now this might actually work
 
Level 6
Joined
Apr 23, 2008
Messages
263
Turn off Trigger doesn't stop the execution of the reamaining action(s), I turned it off because items get duplicated and create 2 items, turn it on again at the end of the trigger.

uhm yeah did i say something else? o_O

well tested your trigger now... and it kind of fails :( it's because the heroes do not even need to look at the place where you drop the item :p

another solution is to have the event a unit is issued an order targeting an object and then check if the targeted item is within 100 range, but this also fails because the message "inventory is full" will appear
 
Level 6
Joined
Apr 23, 2008
Messages
263
I checked now DotA recipe system, it works with a free inventory space. And I can't find what you mean by droping the recipe item then it is replaced by a powerup.

cant explain that more simple than this:

in DotA one could easy make a complete recipe with 7 recipe factors (1 more item than a full inventory)

so i need a way of picking up* an item when you have a full inventory...

*if the picked up item wont complete a recipe the picked up item will be placed underneath the picking hero.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
I noticed something about what you said on making the recipe with full inventory, you said that you need to change the permanent item into a powerup one when it is dropped, right ? I found this don't happen, all recipe componenet are sold as powerups but if the bought item doesn't complete the recipe then it is converted to a permanent item in your inventory. And that explains why the last item can complete the recipe even with full inventory.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
To Moderators: Sorry, for posting 3 consecutive times.

To HellslayerX15:

I think this trigger might work (actually it works but don't know if it is wierd as you say)

  • Drop Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    • Actions
      • Trigger - Turn off (This trigger)
      • Set ItemToBeReplaced = (Item being manipulated)
      • Countdown Timer - Start Wait as a One-shot timer that will expire in 0.01 seconds
  • Drop Ex
    • Events
      • Time - Wait expires
    • Conditions
    • Actions
      • Set TempLocation = (Position of ItemToBeReplaced)
      • Item - Create Tome of Experience at TempLocation
      • Item - Remove ItemToBeReplaced
<< EDIT >>

The trigger will still work for timer duration less than 0.01, I tried 0.001 and even 0.00 and it worked, but I think you don't need a samller interval than that.
 
Level 6
Joined
Apr 23, 2008
Messages
263
why would that trigger be better than 0.00 second wait? it's the same wait time? i just remembered that the least wait time you can have is like 0.27 seconds and that's what makes it look so ugly

wait just also remembered that timers have more precise timing, i fear that 0.00 seconds wait is too short wait to find the position of the item, but well worth a try.
 
Status
Not open for further replies.
Top