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

Can buildings train units and sell items?

Status
Not open for further replies.
Level 4
Joined
May 14, 2013
Messages
48
I made a structure/building unit. I want it to sell items and train units. The problem is as soon as i train a unit it appears to black out the items it sells. Did i miss something obvious? Or is this not possible? If so any suggestions on a way around this?

The item is based off "Rune of dispel magic".

If i used a purchase unit system it would mess up several of my maps triggers.
"Unit - A unit Finishes training a unit"
I believe this trigger will not work if the building sells the units.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
I made a structure/building unit. I want it to sell items and train units. The problem is as soon as i train a unit it appears to black out the items it sells. Did i miss something obvious? Or is this not possible? If so any suggestions on a way around this?

The item is based off "Rune of dispel magic".

If i used a purchase unit system it would mess up several of my maps triggers.
"Unit - A unit Finishes training a unit"
I believe this trigger will not work if the building sells the units.
use a tree ent or other elf building with uproot.

when rooted the building sells items, when up uprooted it trains units.

I've encounter the same problem you are experiencing now. for some reason buildings can train and upgrade units without a problem, but it can't sell items and train units
 
Level 4
Joined
May 14, 2013
Messages
48
use a tree ent or other elf building with uproot.

when rooted the building sells items, when up uprooted it trains units.

I've encounter the same problem you are experiencing now. for some reason buildings can train and upgrade units without a problem, but it can't sell items and train units

Thanks for the suggestion, sadly this one will defiantly not work for my situation. The building needs to be able to do both at the same time. Any other ideas?
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Thanks for the suggestion, sadly this one will defiantly not work for my situation. The building needs to be able to do both at the same time. Any other ideas?
Give the building a spell book, in the spell book it can sell items.

That way the system for selling items will be separate from the training units screen, hopefully this will mean neither will disappear
 
Level 4
Joined
May 14, 2013
Messages
48
Give the building a spell book, in the spell book it can sell items.

That way the system for selling items will be separate from the training units screen, hopefully this will mean neither will disappear

I do not understand what you mean by this? How would you sell items through a spell book? From my understanding spell books can only hold abilities?
 
Level 4
Joined
May 14, 2013
Messages
48
  • Building refresh
    • Events
      • Unit - A unit Cancels training a unit
    • Conditions
    • Actions
      • Unit - Replace (Triggering unit) with a (Unit-type of (Triggering unit)) using The old unit's relative life and mana
So far this is my solution its not great. But it does allow the building to sell items after units have been trained.
The only problem i can see is that the building would lose all its buffs.
 
Level 4
Joined
May 14, 2013
Messages
48
They should only black out when units are being trained if memory preserves.
Use unit enter region and set the region to playable map area and you can catch sold unit.

Even after you stop or finish training the items remain blacked out. Some type of refresh is the simplest way to fix it that Ive found so far but it does still pose a couple of problems.

If i use Unit enters region i lose the ability to target the unit doing the training with the trigger correct?

I will post my trigger at a later time so it makes more sense but in any case the trigger targets both the unit being trained and doing the training.
 
Level 8
Joined
Jan 28, 2016
Messages
486
You are supposed to disable the tech tree of the spell book in the start of the game using a trigger
This will not crash the game

Can confirm; this will crash the game either when the building with the spell book is about to start construction (as shown in my test map) or before the map completes loading if there is a preplaced building with the ability.

Edit: Try building a Barrack to trigger the crash.
 

Attachments

  • Sell Item Crash.w3x
    14.9 KB · Views: 38
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
Can confirm; this will crash the game either when the building with the spell book is about to start construction (as shown in my test map) or before the map completes loading if there is a preplaced building with the ability.
maybe uses uproot. it makes the building us it's unit abilities when uprooted

I'll be home tonight. I'll try it out then
 
Last edited:
Level 4
Joined
May 14, 2013
Messages
48
maybe uses uproot. it makes the building us it's unit abilities when uprooted

I'll be home tonight. I'll try it out then

I recall the uproot idea being less user friendly then my solution. When a player cancels training it "refreshes" the building by replacing it. first problem the player has to re select the building afterwards i guess i could look into forcing the selection afterwards. Second problem the building loses all buffs. Third problem anything currently targeting the building would lose its target. Still i feel this works better than the uproot thing at least from my attempts with it.

Can confirm; this will crash the game either when the building with the spell book is about to start construction (as shown in my test map) or before the map completes loading if there is a preplaced building with the ability.

Thank you for testing this so we can confirm spells books simply cannot contain sell items. Well of course you could use dummies and trigger the whole thing which would be fine for a couple items or maybe a shop but for a whole set of shops this would get ridiculous.

So the spell book idea is a no go.
I will give the uproot another try.
I am thinking refreshing the building is the best option but there may be another way to refresh a unit without replacing it. Maybe like a dummy version of Mirror image? i will try a couple things. Any suggestions?
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
I recall the uproot idea being less user friendly then my solution. When a player cancels training it "refreshes" the building by replacing it. first problem the player has to re select the building afterwards i guess i could look into forcing the selection afterwards. Second problem the building loses all buffs. Third problem anything currently targeting the building would lose its target. Still i feel this works better than the uproot thing at least from my attempts with it.



Thank you for testing this so we can confirm spells books simply cannot contain sell items. Well of course you could use dummies and trigger the whole thing which would be fine for a couple items or maybe a shop but for a whole set of shops this would get ridiculous.

So the spell book idea is a no go.
I will give the uproot another try.
I am thinking refreshing the building is the best option but there may be another way to refresh a unit without replacing it. Maybe like a dummy version of Mirror image? i will try a couple things. Any suggestions?
Do you have to train units from the place?
I found that you can purchase units and it won't interfere with the item's sold ability
 
Level 4
Joined
May 14, 2013
Messages
48
Do you have to train units from the place?
I found that you can purchase units and it won't interfere with the item's sold ability

I am aware that its no problem to sell items and sell units. I just wanted to find out if it was possible to sell items and train units, since ideally i would like it to work that way.
 
Level 2
Joined
Mar 8, 2017
Messages
17
What about , creating dummy unit ( shop ) and give abillity to this building for swaping pages. When ability is finished, dummy unit is selected for triggering player . I think something like this , ehh currently i cant do it with my best ,but if you like my idea i could create it with better trigger tommorow
 

Attachments

  • sample.w3x
    17.5 KB · Views: 43
Last edited:
Status
Not open for further replies.
Top