Travelling Merchant

DM Cross

You want to see a magic trick?
Reaction score
568
For my New Age of Warcraft map (a melee map with new custom units and heroes and a few triggers ;) for spice) I've decided to create some of my own items and such...Naturally, I'm going to create a few Master items, or something along those lines, like Armor peices that will turn heroes into some new beast when they're all worn, or something like that...Anyway, what I wanted to know was how to create a trigger to make a shop, in the guise of a unit, jump around the map...Let me try that again, it was a little complex:

I want to make a shop called the 'Traveling Merchant' who sells rare items.

Every x seconds, I want the Traveling Merchant to move from his current place, to the next place. (That's obviously region related, but I get that part)

So how would you write a trigger like that?
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Three questions:

1) How often do you want it to move?
2) How many different regions?
3) In a pattern or randomly?

If you answer that then I'm pretty sure that I can do it. I think you can do it along the lines of turning on triggers and having them run periodically.
 

DM Cross

You want to see a magic trick?
Reaction score
568
1) Let's say every day/night
2) I didn't really think about it, let's go for 4 regions, why not?
3) Random, makes it harder to find him ;)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Unit - order "merchant" to move to center of RegionArray[ Random number between 1 and "number of regions" ]
(or "random point in region")

Where "RegionArray" is an array that holds all your regions.

For the event, either a periodic timer, or based on "game time becomes ...".


The shop itself is simpler,
put all the items in "techtree - items sold"
and give it the abilities "sell items" and "select hero" (or "select unit").
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Actually I thought of a way to make it much simpler. Here it is:

E:
Time of day becomes 6:00 / 18:00 (two events, I'm lazy)

C:

A:
Set <integer> = Integer((4 * random number from 0.00 to 1.00) + 1)
If <integer> = 1 then move <travelling merchant> to center of <region 1>
etc.
 

BrokenX

New Member
Reaction score
26
Lets not use random ;).

Heres a little thing to get you started maybe? you have to create your unit right off the start k... and place him in the region that will detect he is there so it will move him.

Code:

Events
time - elapsed time is 2.50 seconds.
Conditions
Actions
Create 1 (merchant) for (Your player) at (Your region)

Now this will move him in a big circle ;) required... 5 regions?

k


Code: Move1

Events
Unit - a unit enters (Your region where u will create you merchant thing)
Conditions
(Owner of(Entering Unit)) is equal to (Your player he will be under)
Actions
Unit - Order (Entering) Unit to (MOVE) to (region A)

Code: Move2

Events
unit - a unit enters (Region A)
Conditions
(Owner of(Entering Unit)) is equal to (Your player he will be under)
Actions
Unit - Order (Entering) Unit to (MOVE) to (Region B)

Code: Move3

Events
Unit - a unit enters (Region B)
Conditions
(Owner of(Entering Unit)) is equal to (Your player he will be under)
Actions
Unit - order (entering Unit to (MOVE) to (Region C)

Code: Move4

Events
Unit - A unit enters (Region C)
Conditions
(Owner of(Entering Unit)) is equal to (Your player he will be under)
Actions
unit - order (Entering) unit to (MOVE) to region (D)

Code: Move5

Events
Unit - a unit enters Region (D)
Conditions
(Owner of(Entering Unit)) is equal to (Your player he will be under)
Actions
Unit - Order (Entering) unit to (MOVE) to (region E)

Code: Move6

Events
Unit - a unit enters region (E)
Conditions
(Owner of(Entering Unit)) is equal to (Your player he will be under)
Actions
Unit - order (Entering Unit to (MOVE) to (Region A)

This will make it so he keeps going it a circle or you can place them all over in the orders you like ;) so he keeps going around and around ;) you can add more triggers on it can keep going if you like :).


Broken X
 

DM Cross

You want to see a magic trick?
Reaction score
568
I'd like to try Ace's way first because a) I would like it to be random...and b) well..he IS the moderator ;) However, a few questions:

1) do i have to have the merchant already in one of the regions at game start?
2) Could you explain the arrays a bit to me? I haven't gotten into those yet, really, so the help would be much appreciated :D
 

BrokenX

New Member
Reaction score
26
If you scroll up and read my first code ;) it creates a panda merchant or whatever it is called, inside of your region then it starts moving him automaticaly, and this is why i made this type of code for you because arrays are a ... hassal :) kind of hard if you are new to them ^.- .
 

DM Cross

You want to see a magic trick?
Reaction score
568
... :D *Starts making the triggers BrokenX posted*

Question, though...Will that make him WALK to the different spots, everytime, as soon as he gets to one?
 

BrokenX

New Member
Reaction score
26
Possibily... it would require alot of regions, you could have him going so many places at once I can see it in my head now. Non-stop, yea you could make him go many places, it is possibly yes, :).



(Off topic)
w00t 200 posts ;).
 

DM Cross

You want to see a magic trick?
Reaction score
568
Lol, congrats...

Go you, Broken...Ok, I added the triggers (All 5 of them -.- (I only had 4 regions, not 5, but thanks for the extra information anyway!)) so I'm going to test it...(Heh, kind of funny that the first time we met you were yelling at me for not knowing triggers, and now you're helping...Irony laughs down upon us all, doe it not?)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Alexander said:
Will that make him WALK to the different spots, everytime, as soon as he gets to one?

Yes.
As soon as he enters one of the regions, he will immediately walk on to the next one.


A time based solution would be better there,
since, after all, it's a merchant.
Which means he's supposed to actually want to sell you something,
not just to run away from you ;)


That said, arrays are simple.
New variable, give it some name, put in the type ("region")
and set the size to the number of regions you're going to have.

Then, at map initialization, put all the regions inside the array:
Code:
    Set MerchantRegions[1] = Region 001 <gen>
    Set MerchantRegions[2] = Region 002 <gen>
    ....

Then something that gets him to move:
Code:
MoveMerchant
    Events
        Game - The in-game time of day becomes Equal to 6.00
        Game - The in-game time of day becomes Equal to 18.00
    Conditions
    Actions
        Unit - Order "Merchant" to Move To (Random point in MerchantRegions[(Random integer number between 1 and "number of regions")])

If the event is "game time", it doesn't matter where he starts...


If you don't like arrays, go with the other suggestion up here:
a couple of "if then"s...
 

DM Cross

You want to see a magic trick?
Reaction score
568
Hmm...He didn't move...Maybe because he's a structure...Any ideas, there, Mister 200?

-Edit-
Hmm...maybe he'd move if he had MOVEMENT SPEED, ALEXANDER?! Good one, right? -.-

To Ace:
Thanks, I think I got arrays already...Though, since i started this way, i might want to just finish it up like this...However, I wouldn't be surprised to know you're way creates less lag, since it seems to be only one trigger...So i'll deffinately try it later ;) But for now -.- stupid walkess bastard of a merchant (am i allowed to say that about non-existant merchants?)
 

DM Cross

You want to see a magic trick?
Reaction score
568
Ok, it...Sort of worked...Well, he ran this time, it's just that he ran into trees and stopped moving -.- Ace, I'm not sure if your idea would work because I think he'd just get stuck like this more often...I think I just have to place a few regions around to avoid this...

Also, if I do something like

E: Merchant enters MerchantRegion1
C: Owner of Merchant is equal to Neutral Passive
A: Wait x seconds
Order move to Merchant Region2

Do you think that would work to, as you stated, make him 'not run away from you'?
 

Rinpun

Ex TH Member
Reaction score
105
Hey man, maybe you should add the ability wander or something too if you want the merchant to stick around. Aka, if he's at a place waiting for the time to go by, he's not just sitting there...but wandering around the general vicinity until he has orders to move to another spot.
 

DM Cross

You want to see a magic trick?
Reaction score
568
Awesome idea! :D Ty! Added that...Now let's see if he wanders in the spot, or just starts wandering :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Anything posted here will work, with some tries.
However, if he gets stuck in trees, there's a problem with your map layout...

WC3 has a rather advanced pathing, meaning that,
if there is a way to go, the units will find it.
If they stop somewhere in the middle... hm...
 

DM Cross

You want to see a magic trick?
Reaction score
568
What I did was I added a few more Regions so that he'd walk AROUND the trees...

Ace, it wasn't that he COULDN'T find a way around, it's just the way the trees were set up he got stuck in a hook...

X, I added a wait onto a certain 3 triggers so those will be his 'Selling spots' I guess...
 

DM Cross

You want to see a magic trick?
Reaction score
568
Grroar...Something went odd with the first spot he was supposed to stay...He just kept moving back and forth, but after awhile...Grroar some more, I think I'm just going to make him as slow as peanut butter and make him walk to each place one after the other -.-
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top