Advanced Trigger help

  • Thread starter Thread starter team.ism
  • Start date Start date
T

team.ism

Guest
This question is for the advanced triggerers(?):

I want to make a merc system with the following uses:

1. You can buy the merc then as soon as you buy it the selling unit can no longer sell it. Meaning that it disappears from the selling units slots, not just sets the available units to 0.

2. when you buy the merc, it will follow you wherever you go and will attack creeps that attack you or creeps that they see automatically. I am thinking maybe putting some auto abilities on him so he can cast abilites automatically.

3. I want to make him neutral so that the player cannot control him directly but can still click on him and see his stats and equipped items.

4. Maybe making it possible to give him items (like potions or equipment). He is a hero so he can level and get stronger. ( not that important really )

5. Make it possible to hire different mercs. Say I get a footman merc and then I decide I want a rifleman merc. When I buy the Rifleman merc I want the Footman merc to be removed from the game and the Rifleman replacing him. Alos the footman will be available for selling again and the rifleman will be removed.

I know this is a lot of stuff, but I also know that there are a lot of great people in here that know a lot about the editor.

I have tried some of the possibilities myself. The one that is irritating me is the following and attacking automatically. I can get the merc to follow me but if I am attacked and the creep is out of his range then he will just stand there. When he finally does attack then afterewards he will just stand there and not follow anymore.

I would appreciate any help that is provided me.

Also I am using WEU so I can use any of the advanced triggers it provides and will be able to insert JASS code if it would be easier to provide that.

Thanks again for reading this.
 
try setting the aquisition range of the merc units higer, and have a periodic trigger make him follow you. did you get all the other ones working or is that all?
 
For number 1 - Just use the Tavern tutorial for that (on left hand side link bar).

Im guessing you making a Diablo 2 Map, because what you've listed here is exactly what you do with them on D2 :P.

-Husky
 
When you buy the mercenary from a neutral shop use the action "Neutral Building - Remove unit-type (From Marketplace)"

For making him follow you use a periodic event of 3 seconds, and have a unit variable (Array if multiplayer) to store him in. When you first purchase the unit, use an if/then/else action, If "UnitVariable equal to No Unit" then "Do Nothing" Else "Remove UnitVariable from the game, Set UnitVariable equal to Sold Unit". Then to order him to attack-move to region (Convert point with size to region[Position of (OwnerUnitVariable) with size 350,350]) where OwnerUnitVariable is the unit variable of the hero of the owner.

If you use items, make them only allowed to use items such as boots of speed, or claws of attack. If using potions, a new trigger is required. Use "Unit property becomes less than or equal to 20%" Event and then run an if/then/else checking each slot for potions. If they have a potion order the hero to use it etc.

For abilities, use a new trigger per each ability of type (Example, flamestrike and blizzard can be the same event, just use different if/then/else. But StormBolt and Shockwave are different so will require different events.). If using a StormBolt, just run a 'unit enters region' converting the position of unit with a size of the range of stormbolt, then set a dummy integer variable to random number between 1-5, if it is equal to 3 order UnitVariable to 'MountainKing - StormBolt' on 'Entering Unit' using boolean alliance check conditions to determine the alliance (So you wont storm bolt allies).
 
It's not a diablo 2 map, althoughtit is an rpg. I just want to use the merc system because I hate fighting alone.
 
For 5, you would have to make a variable of type unit titles 'Merc' or something, then when some1 buys a unit use.

Events:
Unit - A Unit is sold
Conditions:
Unit - Selling unit equal to merc tavern
Actions:
Unit - Remove all unit-type of Merc from the game
wait 0.01 seconds
Set Merc = Sold Unit

that is a very rough trigger, I will make one and edit this post in 5 minutes.

Edit~

O.k here it is:

Code:
    Events
        Unit - A unit Sells a unit
    Conditions
        (Selling unit) Equal to (Merc Tavern)
    Actions
        Unit - Remove Merc from the game
        Wait 0.01 seconds
        Set Merc = (Sold unit)

Not sure we need the wait action in there, but I wasn't sure if the trigger would run fine if I had 'remove merc' and 'set merc' next to eachother.
 
BTW to everyone else that helps, this is a one player map. So don't try to work too hard trying to make triggers for mulitple players.


Thanks again for all the help.
 
Everything is working so far except for removing the merc from the selling unit. This is what I got.

Code:
Event
     Unit - A unit Sells a unit
Condition

Action
     Neutral Building - Remove (Unit-type of (Sold unit)) from (Selling unit)

Now before you post another trigger, I want to know why this isn't working. I like to learn from my mistakes so I don't have to ask so many questions in the future.
 
Neutral Buildings with the (From Marketplace) require either 'Sells units' or 'Sells items' ability on the shop, do you already have this set up? (And why cant i register? I just tried and when i put in the activation key it said my PASSWORD was invalid)
 
possibly cuz the seller isnt a nuetral building

Event
Unit - A unit Sells a unit
Condition

Action
<b>Neutral Building</b> - Remove (Unit-type of (Sold unit)) from (Selling unit)
 
I think you are on to something sg. The unit is a Barracks but I made the owner Neutral Passive.
 
Helper said:
Neutral Buildings with the (From Marketplace) require either 'Sells units' or 'Sells items' ability on the shop, do you already have this set up?

try what he is saying and its sqrage :P
 
Yeah it has the Sell Unit and Invulnerable (Neutral) abilities. I got it to work though. I changed it to Player - Make Merc unavailable for training/construction
 
[I am Helper]

Well was the unit being sold or trained? It sounded like it was being sold and USUALLY Neutral Building actions will work fine for what you needed. But if you got that to work more power to you... Good job solving it on your own :D.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top