Summoning heroes

U

Unregistered

Guest
Suppose if a player enetered the region around the Tavern I wanted to have one of the new heroes (At random) come out and fight the player and if the player won, the hero was his for the rest of the game, rescuable, how exactly would I do that. Thanks for the help.
 
1) Make a region of whatever size you want around the tavern (as long as its decent). Call it whatever you like. I'll call it "tavern_region" just for the sake of it.

2) Make a unit-type array variable, and give it a name like "tavern_heroes" or something. This is used to store all the various different heroes being built in the tavern. If you can't see where to make variables, go to the trigger editor and click on edit -> variables.

3) Also make a unit variable, and call it something like "random_tavern_hero". This is used to store what hero was randomly created.

4) Make sure you know what hero units you are putting into the tavern, and make sure you also know how many heroes there are.

So you need 3 triggers:

Trigger 1: [sets up all the tavern heroes in variables]
event -
map initialization
condition -
none
actions -
[wait]
wait 1 second
[set variable]
set tavern_heroes[1] = [select one of the tavern heroes]
set tavern_heroes[2] = [select another one of the tavern heroes]
....
[do this for all the tavern heroes]

Trigger 2: [creates a random tavern hero when a player hero gets near the tavern]
event -
[unit - unit enters region]
unit enters <tavern_region>
condition -
[boolean comparison - unit - unit classification check]
entering unit is a hero
actions -
[unit - create units facing point]
create 1 tavern_heroes[random number from 1 to {how many heroes there are}] for <neutral hostile> at (position of entering unit) facing (position of entering unit)
[set variable]
set (random_tavern_hero) = (last created unit)

Trigger 3: [player hero kills the tavern hero]
event -
[unit - generic unit event]
a unit dies
condition -
[unit comparison]
(dying unit) equal to (random_tavern_hero)
actions -
[unit - create units facing point]
create 1 (unit-type of (random_tavern_hero) for (owner of killing unit) at (position of killing unit) facing (position of killing unit)



You'll probably think thats a bit complex, but just read my points at the top first, and then do the triggers one by one, and you'll get it done in no time.
 
Thanks so much for the help, I typed it all in and now I'll go see if I did it right, I really appreciate your help, you are the best!
 
One thing I do not understand, in trigger 2 in your example, how do I set this value.

[random number from 1 to {how many heroes there are}]

I cannot figure out how to do it. Thanks
 
One other thing, I tested out the map and an interesting thing happened. I went and got a hero as did the AI opponent, then we did battle, when I killed his Tavern hero he was reborn into my army as per the trigger, how do I disable the trigger after the hero joins the army so that he then becomes like a regular hero, can be killed and revived at the alter instead of joining the killing hero's army. Thanks
 
1) [random number from 1 to {how many heroes there are}]

in the square brackets for this array variable you should see the word "index". Click on it and another window will pop-up. Look near the top of the window for the word "function", and then open up the list that you see to the right of "function". Scroll down and look for the function "math - random number".

2) The action you are looking for here is "trigger - turn of <some trigger>" Feel free to stick it wherever you like. I'm guessing the best place to stick it would be the end of trigger no. 3.

You should note though, if the hero becomes owned by you, then I believe it will always revive at the altar. Trigger no.3 will actually end up creating a duplicate of the hero. Therefore what could happen is, your hero gets killed, then joins the killing hero's army, and then he also becomes revivable at the altar (so you both will own a copy of the hero in the end). So "trigger - turn of <some trigger>" is a good idea to stop this sort of mess from happening.
 
Thanks! If I understand you correctly, the only way to avoid having the Tavern Hero become the killing players hero is to turn off the trigger after it has run? I wanted everyone who plays the map to have the option to get a hero this way and if I turned the trigger off after it ran once it wouldn't work for the next player correct? Is there a way to add to the end of the 3rd trigger and say something like (last created unit) no longer affected by trigger or something? Thanks again, I chat on a lot of websites about wc3 maps and you are by far the best at what you do. Chris
 
Unit - Create 1 Tavern_Heroes for Neutral Hostile at (Random point in Tavern <gen>) facing (Position of (Entering unit))


This is the trigger in question.
And this is your reply.

1) [random number from 1 to {how many heroes there are}]

in the square brackets for this array variable you should see the word "index". Click on it and another window will pop-up. Look near the top of the window for the word "function", and then open up the list that you see to the right of "function". Scroll down and look for the function "math - random number".

I cannot figure out where the word "Index" is. I clicked on the trigger, then I clicked on the Tavern-Heroes and I cannot find the word index anywhere to follow the rest of your directions. You called the variable an array variable, should I have the box "array" checked inside the variable? I tried that and it disabled my triggers. I am way lost and confused. Thanks for your help.
 
Ok, my fault, I figured out the array variable thing and fixed it. Sorry for wasting your time with my stupidity. Can you explain the difference between an array variable and a non-array variable?

Also, would this trigger string work to make the hero part of an army but to not have the copies made upon death?

Unit - Create 1 (Unit-type of Random_Tavern_hero) for Neutral Passive at (Position of (Killing unit)) facing (Position of (Killing unit))

Unit - Make (Last created unit) Rescuable by (All players)


I want the trigger to run during the entire game but I don't want so many copies. I played last night and had 8 heroes by the time I was done and I had only summoned one on my own from the alter. Sheesh.
 
Ok, there are quite a number of things to deal with here. I'm thinking if I write out the trigger code for you I could get it done in half the time it would take for me to write everything out. If you're up for it, send your map to me at "[email protected]" and I'll do it for you (and its the weekend so I can get it done ASAP). If you rather did it on your own that's perfectly fine too, and so here are my attempts at answering your questions:

Is there a way to add to the end of the 3rd trigger and say something like (last created unit) no longer affected by trigger or something?

How about this idea:

have triggers no. 2 and 3 work only once for each player. This way the triggers can be active for the entire game, but each player will only be able to activate it once. Sound ok? Here's how to do it:

trigger. 2: create a boolean array variable and call it "trigger2activated". Then:

condition:
[boolean comparison]
trigger2activated[player number of (owner of entering unit)] = false
[access "player number" via the same way that you found "random number"]

actions:
[add this action to the bottom of the other ones]
trigger2activated[player number of (owner of entering unit)] = true

trigger. 3: create a boolean array variable and call it "trigger3activated". Then:

condition:
[boolean comparison]
trigger3activated[player number of (owner of entering unit)] = false
[access "player number" via the same way that you found "random number"]

actions:
[add this action to the bottom of the other ones]
trigger3activated[player number of (owner of entering unit)] = true

Can you explain the difference between an array variable and a non-array variable?

an array variable can be filled up with multiple values. A non-array variable can only be filled up with 1 value.

example:

array variable: "nicelookingintegerarray"
non-array variable: "okaylookingintegernonarray"

I can store multiple values in the array variable like this:

nicelookingintegerarray[0] = 1
nicelookingintegerarray[1] = 6
nicelookingintegerarray[2] = 2
etc.

[0] [1] and [2] are called the array slots or indexes. You don't have to store values starting at slot 0, you can store values in any slot number you want.

I can only store 1 value in the non-array variable:

okaylookingintegernonarray = 1

Hopefully you get that. If not then tell me and I'll try again.

Also, would this trigger string work to make the hero part of an army but to not have the copies made upon death?

Unit - Create 1 (Unit-type of Random_Tavern_hero) for Neutral Passive at (Position of (Killing unit)) facing (Position of (Killing unit))

Unit - Make (Last created unit) Rescuable by (All players)

I want the trigger to run during the entire game but I don't want so many copies. I played last night and had 8 heroes by the time I was done and I had only summoned one on my own from the alter. Sheesh.

I think I might have answered this question already at the top.

You should probably change:
Unit - Make (Last created unit) Rescuable by (All players)

to:

Unit - Make (Last created unit) Rescuable by Player Group(owner of killing unit)

to avoid other players stealing your hero.
 
I highly recommend that you register btw :)

It will give you an identity here at the very least.
 
Here you go, I registered, again, I did it before but could not remember my password but hey. Thanks for your help again. This is a great site, much more informative than all the others I read. I sent you the map, Suburbia, tell me what you think about it. I like them big and involved, could you tell?

I would rather have the tavern work more than once for each player but with a time delay before you could do it again, hence the 600 second wait, but I would rather have it not continually clone heroes than have it work multiple times.

Getting the bridges where they could be crossed was a nightmare in the corners, any tips?

Also, I have an idea for a map I would like to make but I would rather not post it here for the world to see, is this something I could e-mail you about?

Thanks again, cdlots
 
Is there a way to make the level of the hero being summoned equal to the level of the entering hero? Is this something I could edit in the variables or should I add it to the 2nd trigger? Thanks
 
variables:

trigger 2: [stick anywhere in trigger]

[integer array]
set entering_hero_level<player number of owner of (entering unit)> = hero level of (entering unit)

"hero level" is found in the function menu list. When setting the value for that integer, the right-hand side should say "value" if you haven't entered a value yet. Just click on it and you'll see the function list in the window that pops up.

trigger 3: [stick after last action]

[hero - set level]
set (last created unit) hero-level to <entering_hero_level(player number of owner of (killing unit))>, hide level-up graphics
 
Thanks again, out of curiousity, how did you become so knowledgable at the wokings of the Warcraft world editor?
 
I wrote the editor :) lol j/k

If you've studied programming at university like I have, then understanding the editor isn't that hard. Most people are put off by the sheer size of it and all the things you can do with it. My education taught me how to see past this by trying to understand logically how things work in the big picture, and then learning everything step by step.
 
I have never studied programming but as you said on a logical basis it makes sence, the computer or any program is only as smart as the input it receives. In playing with the editor I have come to realize that nothing can be taken for granted and no logical conclusion will ever be made by the program itself, you must inout every step, no matter how simple or mundane as the program simply just does not think. There are a lot of people on the web that coincider themselves trigger men but you are easily the most knowledgable. Thanks for all your help and I'm sure I'll have another problem shortly, ha, Chris
 
thanks for the compliment, but i can't in any way claim the title of "most knowledgable". That title would go to a guy named Darky. This guy is amazing, he does ALL his triggering in custom text, and some of the stuff he churns out is amazing. Go to http://www.wc3sear.ch/rotd/ to check out his RPG, and get a glance at some of the custom spells he has made.

Although, having said that, if I were to show you some of the triggers I've churned out in the past, you would probably want to lock me up in an insane asylum hehe :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    It's actually remarkably easy to make mayonnaise though. Fun fact, it USED to kind of be a French mother sauce. I believe that Careme considered it one, it may have been aioli but that has also built a different meaning than it used to. An aioli is just mayonnaise I mixed with other shit typically, I didn't start it don't come at me
  • Varine Varine:
    It's very hard to do it on a large scale though
  • Varine Varine:
    Depending on how you pour the oil the consistency can vary wildly, but that's true for most emulsions. I can only make about two quarts at a time with my robo coup, and if I have to make several in series because I forgot to order it becomes really obvious even when I do it. We have to wait and mix them all together to make sure we have the same thing.
  • Varine Varine:
    Hollandaise is also kind of like that, emulsions require a very steady hand to do exactly the same every time.
  • Varine Varine:
    Luckily I live in an age with electricity so it's way fucking faster, but when I was just a boy trying to find my place I had some hardcore chefs that made use do things like that by hand. It is WAY easier to get right by hand because you control it and can feel it, but it takes soooooo much longer. And on the scale a modern kitchen requires... I serve 400-500 guests on average per day right now, if I had 100 then we could do things way better
  • Varine Varine:
    But we can't do that. In the winter yeah, but I HAVE to get people through here right now so I can afford the staff that we CAN do that. We have about 100 days of summer, and if that summer doesn't make us what it will, then I can't operate the other most of the year with my staff. The owner is talking about closing two days a week to cut down on labor, I told him he should cut down on vacations and it did not go great. I do think I won though, I have to keep my fucking core staff and they have to be gainfully employed
  • Varine Varine:
    Sure some of them might take a second job, but I can't just cut my entire staff to unlivable hours, nor can I can cut them off all winter if I want them to come back.
  • Varine Varine:
    And also, there is no fucking way I'm pulling these hours come september. I only do this right now because I have to, the second I don't have to be the one doing it I won't be
  • Varine Varine:
    I have a 5 person core staff in the kitchen, not including me or Chef Ben
  • Varine Varine:
    Though two of those people are likely not making it this year. One of them has been replaced, the other I am kind of trying to. He's being a giant bitch, today I had to get onto him because in the three hours before I left he had taken like thirty minutes for cigarette breaks
  • Varine Varine:
    And he was also complaining to me the other day that he was out of weed so couldn't smoke any before work that day, and was confused about why I was annoyed he was telling me, his boss, that he is smoking weed everyday before work.
    +1
  • Varine Varine:
    Like yeah I can tell. I don't need to fucking know.
  • Varine Varine:
    So now he's getting scrutinized and will not be top of the list. I know I don't have the smartest people but I do expect them to have some common fucking sense
  • Varine Varine:
    I did do a rare thing for me and hire a girl last month without warning. Everyone was made at me because I started her at like 21, but she worked with me before and I was like don't care. She made 19 at her old job and I wanted her to come work with me, she is the best
    +1
  • Varine Varine:
    I'm going to get her a raise at the end of the summer. She wants to go to school again, but I want her to still work with me so.... she kind of can just tell me what the price is. I can go to 25 if she keeps up. I need to get her onto line more, that's what she wants, but I need her where she is and it's not fair that she doesn't get the little bit of raise that comes with it. She can do it no problem, I've worked with her there.
  • Varine Varine:
    It's just hard to move and train people unnecessarily right now. And also the line fucking sucks, it's not any more fun. This is turn and burn so I have the bankroll, and everyone suffers for it
  • Varine Varine:
    Eventually we'll get it balanced, we'
  • Varine Varine:
    we're starting online orders and stuff, but I also turn that off all the time because I barely keep up trying to be the best at Sysco shit
  • Varine Varine:
    I think it's gonna be a good fall and winter though. We're going to have a good staff, they will get along, they will be able to manage the workload and the complications, they know how to really cook this year, like every person on line knows their steak temps. Some of them use thermometers a lot and they don't always use them right, but they do know how to do it. Failure, especially in this field, is the only way to get better. They'll get it
  • Varine Varine:
    They won't get feel down while they do the thermometer, but we didn't have an instant read probe when I was learning. Like they did but god knows how off it is, you HAD to do it by feel. Even if the chef was fine with me bringing my own, it takes too long. Poke and know
  • The Helper The Helper:
    420 threads in the Artificial Intelligence forum :)
  • The Helper The Helper:
    Happy Monday!
    +1
  • The Helper The Helper:
    and then it was Tuesday!
    +1
  • The Helper The Helper:
    fyi I am going out of town to lake somewhere in bfe texas for the weekend will be gone Friday morning to sunday afternoon for a paranormal thing and some rest peace

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top