• 0

    posted a message on Converting Java to SC2 code

    @SoulTaker916: Go

    Well right now I use the grid boxes via points for the system. Would that work?

    As well, I'm still having a hard time even visualizing where I should start, let alone how to implement it fully.

    Posted in: Triggers
  • 0

    posted a message on Converting Java to SC2 code

    @SoulTaker916: Go

    Its not so much actually converting the code verbatim into galaxy, but to convert it in a way that works with galaxy.

    If I'm understanding you correctly, you can't do that. Am I right?

    Posted in: Triggers
  • 0

    posted a message on Converting Java to SC2 code

    I am really interested in creating dungeons and junk. Right now the skeletons of the system at set up. Walls can be placed, I have my doors at the ready ect, but the meat of this code is really hard for me.

    Is there a cool guy on here who might be willing to help me out? I can sorta see where the coder is going with it...in chunks. But then again chunks do me little good.

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @LosTacos: Go

    EDIT: haha I'm such a dork, I forgot to add the planets to their group. DERP.

    Fixed, try it yourself (go to int trigger). I'll be tinkering with the settings.

    EDIT+: Alright, fixed that by removing planets from the collidebounce trigger.

    Thanks again, you've been a great help!

    Alright, well I be closin' the thread me mates. Thanks again for everyone's help, and I'll be attaching my modified physics engine for everyone to peruse and what have you.

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @LosTacos: Go

    Edit: Wait...no. I'll PM my map to you and maybe you'll be able to make heads or tails of this. Warning, it's rather messy.

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @LosTacos: Go

    I'll try it, but I'm not trying to pull the planets together. Rather, I'm trying to pull units toward the planets. The distance conditions are where the unit will orbit. Being mostly arbitrary for now.

    I'll get back with an edit on how it went.

    Also, I'm not seeing the distance squared function, I take it that's one I should do?

    Posted in: Triggers
  • 0

    posted a message on RNG and Player Specific triggers??

    @KingOfFate: Go

    Not a problem and don't worry, I know the feeling sometimes. You'll find SC2mapster to be fast and generally helpful when you post questions as no doubt you'll see your other questions answered either within the day or the next couple.

    There are times where you might need to bump or won't get a full answer, but there's also the IRC channel where most of the more advanced users hang and if you can tolerate waiting for a few hours there's generally help to be had there too.

    Posted in: Triggers
  • 0

    posted a message on RNG and Player Specific triggers??

    @KingOfFate: Go

    Well, you could make an event that if a unit enters the proximity of the unit it will cast it. AI is a lot more difficult for me than most other things.

    Really, if you're just looking at a basic auto-cast, though, order the unit to move and such (or create your own little AI brain) and then if a unit is within range cast abilities based on priority.

    As far as priority goes, all you need to do is create an array of abilities, add each ability in (again, according to priority [so an ability that you want to be cast over all others would be [1]), and then have the computer cast at the prioritized unit.

    Advanced AI isn't my bag so if that's what you're looking for I won't be able to help you. There are a couple of people on here who I am sure can create an advanced AI or help even, but they are few and far between and don't regularly check the forums to the best of my knowledge.

    Posted in: Triggers
  • 0

    posted a message on RNG and Player Specific triggers??

    @KingOfFate: Go

    Give control of a unit in proximity, like the Warcraft taverns

        Events
            Unit - Any Unit Enters a distance of 1.0 from Unit
        Local Variables
        Conditions
        Actions
            Unit - Change ownership of (Triggering unit) to player 1 and Change Color
    

    Make the computer cast spells, I made snipe cost nothing and removed attack and the computer still wouldn't use snipe

    Basically

        Events
    THING THAT IS SUPPOSED TO HAPPEN
        Local Variables
        Conditions
        Actions
            Unit - Order (Triggering unit) to (**Ability** targeting (Triggering unit)) (Replace Existing Orders)
    

    Random Number Generator? Seems to me cycle is the RNG thing but haven't got to test it out yet

        Local Variables
            Untitled Variable 001 = 0 <Integer>
        Conditions
        Actions
            Variable - Set Untitled Variable 001 = (Random integer between 0 and 100)
    

    That's all I really know how to do, and I'm sure someone else knows the rest.

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @LosTacos: Go

    EDIT: fixed most everything, still a little laggy but less noticeable now.

    So I'm using this code:

    Unit - Set (Picked unit) custom value 2 to 0.0
          General - If (Conditions) then do (Actions) else do (Actions)
                  If
                     (Picked unit) != Star [53.18, 59.46]
                     (Picked unit) != Home Planet [71.99, 40.00]
                     ((Picked unit) is alive) == True
                     (Distance between (Center of (Unit group((Picked unit)))) and (Center of (Unit group(Star [53.18, 59.46])))) > 5.0585
                     (Distance between (Center of (Unit group((Picked unit)))) and (Center of (Unit group(Home Planet [71.99, 40.00])))) > 3.0351
                   Then
                     ApplyForcePolar((Picked unit), -0.001, (Angle from (Center of (Unit group((Picked unit)))) to (Center of (Unit group(Home Planet [71.99, 40.00])))))
                   Else
    

    Just a snippet of your move units section with my custom code. Since this takes place in space there is no friction or Z gravity.

    So now the units get pulled but oftentimes they don't get pulled toward the star but toward the edge of the map...what the heck? Any ideas?

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @willuwontu: Go

    I'm trying my hardest to try to figure out how to use these practically in the trigger editor, but I'll be honest changing practical equations to coding language that works (especially for sc2) was never my strong suit.

    I believe I need to know the acceleration due to gravity to know how fast it's going and then the vector to (understand?) where the unit will be in, say, one second relative to both.

    Am I missing something here? Is there any chance I could get a "Physics to SC2 for Dummies" explanation? ;^.^

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @willuwontu: Go

    Well I had tried that but I can only go to .000x and I don't believe I can multiply by numbers with a ^x value or multiply by negative numbers. So I can't use the correct value of gravity.

    I tried to use much smaller numbers for other values to try to make up for it but everything moved too fast or didn't work. If you have a coded version that works you'd like to show me I'm all eyes but as far as I know the actual gravity equation (by itself at least) doesn't work in SC2.

    Also if you could explain how vectors work a little so I can sorta get an idea of how to code it I'd appreciate that. I looked at the explanation of vectors in the physics tut from 2010 but it didn't really explain it how it relates to the actual coding process. Simply what they were.

    Posted in: Triggers
  • 0

    posted a message on Random role

    @fishy77: Go

    I suggest you make a variable which saves the hero value.

    Do something like:

        Variables
            Hero int = 0 <Integer>
            HERO IS TAKEN = False <Boolean[MAXIMUM NUMBER OF HEROES HERE]>
        Conditions
        Actions
            Variable - Set Hero int = (Random integer between 0 OR 1 DEPENDING ON WHICH YOUR SYSTEM STARTS and MAXIMUM NUMBER OF HEROES HERE)
            General - Repeat (Actions) forever
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            HERO IS TAKEN[Hero int] == False
                        Then
                            Variable - Set HERO IS TAKEN[Hero int] = True
                            Trigger - Run DO WHATEVER IT IS YOU DO TO SPAWN UNITS  (Check Conditions, Don't Wait until it finishes)
                            General - Break
                            General - Skip remaining actions
                        Else
                            Variable - Set Hero int = (Random integer between 0 OR 1 DEPENDING ON WHICH YOUR SYSTEM STARTS and MAXIMUM NUMBER OF HEROES HERE)
    

    It is a little sloppy but with a few more lines of code that suit your fancy you could also stop the trigger from trying to randomize to the same number. I just don't feel like doing actual coding right now.

    Posted in: Triggers
  • 0

    posted a message on Help a noob !

    @MacSC2: Go

    Have you tried saving and reentering the editor? Making sure to open the trigger editor in a fresh map first?

    You're using a Mac if I'm not mistaken and this is not a problem I've ever experienced, but I'll try to help as best I can.

    Posted in: Triggers
  • 0

    posted a message on Mimicing the pull of gravity and orbits [SOLVED]

    @AstralCV: Go

    I modified my orbit trigger accordingly but no dice. Really I'm looking for some kind of..."pull" trigger I suppose. Something that is similar to Orbit Library, but since I can't see any of the triggers or their dependencies I need a way to do this myself. Beside that fact it isn't exactly what I want.

    @XLIIVI: Go

    So far I haven't had a problem with that, but I'll keep it in mind.

    Just so everyone is aware, I tried to move the orbit library over when I noticed I could see the stuffs I needed to, but I got an error with the function declarations and so I couldn't go any farther.

    I am struggling with how to implement this, because honestly I don't even know where to start, but I'll keep you peeps as updated as possible with any future problems/breakthroughs.

    I have semi-fixed the problem with force data values. I would prefer a trigger gravity system as it is more flexible so please continue suggesting.

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