• 0

    posted a message on [Help] Setting Unit and not Player Alliances

    I don't believe you can set individual unit alliances, no.

    You could:
    Keep everyone as neutral. Players would have to attack manually.
    or
    Make triggers that give attack commands wherever you need them (would likely be quite complex).
    or
    Set up a new player, lets call him, "Discovered!". Give any discovered units to this shared control dummy player.

    Posted in: Triggers
  • 0

    posted a message on Trying to get the tint value of a unit
    Quote from Uplo: Go

    Ohhh, I was thinking that each time the trigger ran the variables would be reset back to zero. I didn't realize they kept their value.

    They don't keep their value after the trigger finishes. Every variable resets for each run through (or it would work very poorly with different players using different bunkers). I'm using local variables, not global. But the bunker does keep the units, and that's what I check.

    Posted in: Miscellaneous Development
  • 0

    posted a message on (Trigger) Income not updateing

    I don't see anything odd. I'm missing a few variables, but I assume they are in your map. What exactly does not work? Try showing the timer if that's the problem.

    Posted in: Triggers
  • 0

    posted a message on Trying to get the tint value of a unit

    I think you misunderstood my trigger. It does add the tint, sort of. I pick each unit in the bunker that loaded a unit and then calculate the color. It does not matter in which order you load the units... or unload for that matter.

    I'll set up a test map so you can see what I mean and copy that if you want. And no, it would not make the map lag (why would you run the trigger every second?). Triggers are low overhead. Animating a single marine is probably worse (very rough estimate).

    Now the only problem left as far as I see it is finding colors that work well (if you want more than 4). I used red, green, blue and gray. It's hard to find other usable colors. Yellow... blue + yellow = green, bad.. etc.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Trying to get the tint value of a unit

    I'd take a slightly different approach. Any time you load or unload a unit, check all cargo units and set the color appropriately. I'm in a bit of a rush, but using this as a base you should be able to get the desired effect. When the bunker is empty, it's pitch black (of course). Maybe check the current color of the player and set it to that or something if it's empty. Also, the numbers make it a bit dark at the moment. Maybe just set red / blue to a fixed number if X are in the bunker. I just found it a bit cool that the bunker got "redder" with more marines inside.

    Set Tint
        Events
            Unit - Any Unit Loads cargo
            Unit - Any Unit Unloads cargo
        Local Variables
            blue = 0.0 <Real>
            red = 0.0 <Real>
        Conditions
        Actions
            Unit Group - Pick each unit in (Cargo units in (Triggering unit)) and do (Actions)
                Actions
                    General - Switch (Actions) depending on (Unit type of (Picked unit))
                        Cases
                            General - If (Marine)
                                Actions
                                    Variable - Modify red: + 50.0
                            General - If (Marauder)
                                Actions
                                    Variable - Modify blue: + 50.0
                        Default
            Actor - Send actor message (Set Tint Color (Color(red%, 0.0%, blue%)) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering unit)
    

    Edit:
    Changed from "if then" to a "switch".

    Edit 2:
    Another way to do it would be to simply check "if marine" "if marine marauder" "if marauder" "if empty" (using a few more variables in the switch), and then set the colors to exactly what you want in another switch... depending, of course, on how many different unit combinations are possible in your map.

    I can give you an example in code later if you want. Gotta run now.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Two nested while loops

    Yup, what Riley said.

    In my opinion, you should use the "for each integer" loop instead of a "while" loop. Then you won't have to manually increase or reset the variables. Like this:
    (copied from another post of mine, but it's sort of the same thing)

    Spawn units
        Events
            Game - Map initialization
        Local Variables
            x = 0.0 <Real>
            y = 0.0 <Real>
        Conditions
        Actions
            General - For each integer y from 0 to (Integer((Height of Spawn 01))) with increment 1, do (Actions)
                Actions
                    General - For each integer x from 0 to (Integer((Width of Spawn 01))) with increment 1, do (Actions)
                        Actions
                            Unit - Create 1 Marine for player 1 at ((Bottom-left of Spawn 01 bounds) offset by (x, y)) using default facing (No Options)
    
    Posted in: Triggers
  • 0

    posted a message on (trigger) increase timer if/then

    Yeah, that's the way it should work, but as I haven't used it here yet, I didn't want to say anything for certain.

    Posted in: Triggers
  • 0

    posted a message on (trigger) increase timer if/then

    Your problem is the order in which you do the if checks.

    You start off with the timer at 30, and add 8. So now it's 38.
    Your next if checks if it's 38, and it is.. so adding 8 more. Now it's 46.
    the next if fires if it's 46. Bad luck, it is 46.
    ...and so on.

    There are a few options to fix this, but the easiest as far as I can see would be to reverse the order of the checks. Start with your highest and check lower and lower. Now, if your timer is increased, the check for that higher timer has already been done, so it won't fire immediately.
    ...or use a local boolean variable that makes sure that the timer is only increased once each time the trigger runs.

    I get the feeling that the entire procedure can be done with only one if check but using a few more variables that keeps track of which timer step you are currently on, but since you already have the trigger set up, might as well keep it I guess. Don't really matter as long as you get it to work as intended.

    Edit:
    Yeah, the trigger could be cleaned up quite a bit by removing redundant steps. But I think it's more important that you do it your way, so that you understand your own triggers.

    I'm unsure exactly how switches work in the galaxy editor, but using that instead of if then might also solve the problem (assuming it only allows one case to be chosen, even if the variables change halfway through).

    Posted in: Triggers
  • 0

    posted a message on (trigger) increase timer if/then

    It would help if we had a bigger picture to look at. Copy your entire trigger as text and paste it here in code tags. It's better to see exactly what you did. Right now I'm sitting here guessing what your trigger looks like from your description.

    Posted in: Triggers
  • 0

    posted a message on How to subscribe to a thread?
    Quote from progammer: Go

    That should be the best way atm, however the sort=-last-post didnt work for some ppl if they click on the Last Post (at least for me)

    Exactly, that's what I meant by trial and error. I guessed the link and added the "-" to invert the sorting (compared to how post count worked).

    Posted in: General Chat
  • 0

    posted a message on How to subscribe to a thread?

    I've been using: http://forums.sc2mapster.com/?scope=tree&search=Berrala&sort=-last-post
    ...which basically shows me all the topics I've posted in with the most active ones on top. The forums are a bit buggy for me, took me some trial and error testing to even get to that link since sorting refused to work when I clicked the different columns. Also, unread topics seem to reset and or simply refuse to work.

    Posted in: General Chat
  • 0

    posted a message on [SOLVED] Custom harvesting

    Why are you getting the unit type from a string conversion? Just choose SCV from "value" (not function).
    Also, a mineral field isn't an item. Your order should be targeting a unit.

    wOlfLisK's way is probably the simplest way, but you have no real control where the individual units go to gather, etc. Usually that's irrelevant though.

    Posted in: Triggers
  • 0

    posted a message on Is it bad to use a while loop without any wait?

    Ah, nice. I've been wanting to make a function, but never really had a reason to do so. I considered it briefly here, but didn't get into it since I haven't done any functions yet. Great example here on a situation where a function is very useful.

    Guess I was tired when I posted my last post. Totally missed that you had got it working well.

    Posted in: Triggers
  • 0

    posted a message on [Trigger] Black screen after cinematic finishes
    Quote from GePanda: Go

    He crouches when he actually shoots the sniper shot at the critters, but is there any way to make him crouch for the whole duration he is in the bush looking down on the critters, as well as shooting them? :)

    I haven't been playing around much with actors and animations yet. Anyway, in the data editor for the ghost actor events, I found "Spell B" (aiming his gun). The aiming looks good enough, but after a snipe he stands up as part of the animation before aiming again, looks a bit weird. You could play around a bit with it and see how it works.

    Play Animation
        Animation: Spell B
        Target: Actor From Unit
            Unit: Ghost [13.45, 11.16]
        Identifier: Default
        Flags: Play Forever
        Blend Time: Default Time
    
    -----
    
    Clear Animation
        Identifier: Default
        Target: Actor From Unit
            Unit: Ghost [13.45, 11.16]
    
    Posted in: Triggers
  • 0

    posted a message on [Trigger] Black screen after cinematic finishes

    You actually said it yourself. You fade out (to black) and end the cinematic. Just fade back in or the game will stay black, as you told it to. :-)

    A few thoughts on the map so far. I know, it's early but I'm a stickler for details.

    - After you kill the revealers after the cinematic, you should also set the area to be unexplored (assuming you don't want it to be seen for some reason).
    - Why is he sniping critters at point blank range? Doesn't feel very hunter'ish. Maybe add some distance, make him sit in a bush. Also, maybe add a reaction to the other critter when the first dies. Make him (try to) run away.

    I like the terrain so far, detailed = good. Keep up the good work!

    Posted in: Triggers
  • To post a comment, please or register a new account.