• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Selling items to a shop on/under a cliff

Status
Not open for further replies.
Level 7
Joined
Feb 27, 2010
Messages
184
In my map there is a shop that is near a cliff. I want units on both below and on the cliff to be able to buy and sell items. Buying works well for both, but selling only works correctly for those that are on the shop's level. For units that are on the cliff, selling only works correctly when the unit is facing the shop exactly - when it's not, pathing takes place and decides that the hero absolutely has to be on the same ground level as the shop to sell, so it starts running the whole path around to sell from there. It's well visible on pictures below:
popis_cliff_sellingu.png


I think it could be solvable through a trigger that whenever an issue is triggered to a unit targeting this shop, and the unit is nearby, the item gets sold (removed from the game and owner gets gold cost of the item/2 golds), but it feels clunky and it'd be complicated to look good with the animations etc. Isn't there a better way?
 
Last edited:
Level 21
Joined
Mar 29, 2020
Messages
1,255
you could make a dummy shop on the top level and if you really want you could detect with regions if the unit is on the top or the bottom and redirect their selection to the dummy shop when you need to.

edit: by dummy shop I mean a fully functioning duplicate of the shop with a nearly invisible model as used by dummies.
 
Last edited:
Level 7
Joined
Feb 27, 2010
Messages
184
How do I redirect the selection though? Neither "Unit - A unit is issued an order" targeting a point, with no target nor targeting an object seem to catch the command of attempting to sell an item, nor "Unit - Icecrown Market is selected". The only triggers that respond to this are pawning/losing an item which activate after the item is sold, not when the move is executed.
 
What's happening is:
When within sell-range, all is fine and item is sold.
When outside range, it checks the path to the buildings center (or something like that). It does not take into account the sell-radius when path finding.

I guess you could place some invisible platforms behind the building that allows you to walk to the shop. It will be allowed to walk down the cliff or something, but with the building there and how pathfinding works, you would have to know that you can walk there for it to ever happen and it wouldn't matter in game play I guess.
 
Level 21
Joined
Mar 29, 2020
Messages
1,255
I tried to replicate this problem and couldn't. In my test map it seems to be working just fine. so maybe just try to move the shop so it sits a little more flush with the cliff.

a different suggestion is to try giving visibility of the shop with triggers when the unit is close enough that you don't want it to go around, that might fix the problem. (if you just right click the shop - when it is visible to you it counts as an object order vs when the shop is not in your current vision it goes through as a point based order. if this has to do with the issue than giving vision of the shop should fix it.)
 
Level 7
Joined
Feb 27, 2010
Messages
184
What's happening is:
When within sell-range, all is fine and item is sold.
When outside range, it checks the path to the buildings center (or something like that). It does not take into account the sell-radius when path finding.
No - I mean, that's happening too and it isn't ideal, but it's not that much of a problem as it's clear what's happening to the player.

The problem here is that even when within sell-range, the item is not sold unless the hero is facing directly to the middle of the shop. If he needs to do at least a little bit of turning, he doesn't sell the item and runs around instead. This is very confusing as it's quite hard/rare to aim precisely at the middle.

a different suggestion is to try giving visibility of the shop with triggers when the unit is close enough that you don't want it to go around, that might fix the problem. (if you just right click the shop - when it is visible to you it counts as an object order vs when the shop is not in your current vision it goes through as a point based order. if this has to do with the issue than giving vision of the shop should fix it.)
The hero's vision is as seen on the screenshots, there doesn't seem to be a problem like that, and as I stated in my previous post, it doesn't trigger when unit-targetting, neither point-targetting :/


HOWEVER!
so maybe just try to move the shop so it sits a little more flush with the cliff.
This worked. I moved the shop a tile closer to the cliff and it works. And not only when the hero is within range, but also when he's outside of it, he'll just run towards the range as long as he has vision.
I've tried a few positions and it seems that it works when the shop is slightly overlapping the cliff.

popis_cliff_sellingu_fixed.png



Thank you very much!
 
Status
Not open for further replies.
Top