Variables

L

l2ankor

Guest
im having a lot of trouble understanding variables. What i am trying to do is trig up a hero selection with no avatar bullshit, where all you have to do is click on the hero to select it. While i did figure out how to do it it would require me to do about 200 trigs which im not willing to do heres the trig as is.

Event
player-player 1 selects a unit
Condition
(dwarve fighter is selected by player 1 equal to true
Actions
change camera for player 1
create floating text over heros
turn off other player 1 hero triggers

can any one tell me how i can change this trigger so that the event applies to all players???
btw check out my map and tell me what u think
p.s. ive only put about 3 hours into it
 

Attachments

  • shadowbane-beta.w3x
    165.9 KB · Views: 166
put all the players in a player group
(u need a variable of player group type)
then in a seperate trigger add them all then change where u say player 1 to the player group, however this will cause u more problems as u will need a filtering system.
Also when u say a unit is selected how do u mean, if a player selects it ie clicks on it , or if a player moves a selecting unit to a circle of power. i need to know this but assuming u mean if a player clicks on it, use the following.

E : <player unit group> selects a unit
C: unit selected is =to <your unit> (unit comparison)
A: create one <your unit> at center of <your region> for owner of triggering player facing <X,Y>
creat floting text at location of last created unit that reads <your text>
move camera to location of last created unit.
NOTE: u need one of these for each hero
 
Actually, no.
You can do it with only 1 trigger.

Code:
Events - player 1 selects a unit
player 2 selects a unit
player 3 selects a unit
player 4 selects a unit
player 5 selects a unit
player 6 selects a unit
(etc, etc..)

Conditions: None

Actions: - Set Number = Player Number of (Triggering Player)
- If -
     If Conditions - 
     Player[Number] Equal To False
     Then Actions - 
     Create 1 (Unit-type of (Selected Unit)) for (Triggering Player) at (Whatever place you want) facing default building facing degrees.
     Set Player[Number] = True
     Else Actions - 
     Do Nothing
That's the trigger you need... Number is an integer type variable and Player is a boolean type variable.
Hope to help.
 
[edit] yea dude
i would have never thought to put multipule players in the event, im gona go try that right now thx

[edit]
Don't use those words here.

Thanks.....

-Ryoko
 
If Conditions -
Player[Number] Equal To False
^^^^
i dont get this part right here
can u plz explain this a little more
 
Open the trigger editor.
Open the variables window.
Create a new variable.
Call it "Player".
Give it the type "Boolean".
Check "Array" and allow for 12 entries.

Confirm with "Ok".


HTH
AceHart
 
Originally posted by l2ankor
If Conditions -
Player[Number] Equal To False
^^^^
i dont get this part right here
can u plz explain this a little more

At the If (Conditions) Then do (Then Actions) Else do (Else Actions) the If Condition is that the player hasnt already selected a hero.

When a player selects a hero, the trigger sets player[his number] variable to true - which means he cant choose another hero now, because the player[his number] variable has to be false.
 
If you allow for one unit only anyway, you can also use

(Number of units in (Units owned by (Triggering Player))) equal to 0


No need for an array then...


HTH
AceHart
 
well this trigger would work if there was "selected unit" in the unit-types but there isnt so i guess im fucked

any other ideas?
 
lololol u should probly look at the trig before u make a comment
cause i dont think u can creat 1 triggering player for triggering player:rolleyes:
 
Code:
Unit - Create 1 (Unit-type of (Random unit from (Units currently selected by (Triggering player)))) for (Triggering player) at (Center of (Region000)) facing 0.00 degrees
 
actually im an idiot:p
i should have tried it before i said anything cause triggering unit totally works.
Thx ace
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • jonas jonas:
    cool take it easy
  • jonas jonas:
    I recently had an experience with a waiter that really brought down @Varine's point about them being in sales. The first waiter just asked "anything else? deserts?" and when the table shook their head said "ok" and left. Then the other waiter came in and started going off describing the deserts and you could see the heads turning, and they finally got a bunch of deserts
  • jonas jonas:
    makes sense if you consider that the tip is basically a commission on sales

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top