• 0

    posted a message on Physics

    @PillowFort: Go

    You can change the mover in the unit, if you take the colossus mover it's kind of gliding up and down cliffs, I wonder if this is optimizable trough triggers or even data.
    And no, a flying unit is definitely not necessary.

    Posted in: Triggers
  • 0

    posted a message on Physics

    @PillowFort: Go

    I did some research and I'm pretty sure that it's impossible to use the Blizzard physic engine.
    Also, I think that we have to use movers to make the unit go over cliffs.

    Posted in: Triggers
  • 0

    posted a message on Physics

    Hm, doesn't work for me. Did you do anything else? edit: I fixed it, I had my phsics deactivated. This sure is awesome!
    Now I have to find a way to control it. Any Ideas?

    Posted in: Triggers
  • 0

    posted a message on Physics

    @PillowFort: Go

    As I've said, my trigger only has the acceleration/deceleration too. I haven't figured out a way yet to make it fall over cliffs and I was planning to ask that later here.You could add the reaper jump to every unit if it doesn't need to be realistic.

    Posted in: Triggers
  • 0

    posted a message on Physics

    I think I got the part with acceleration/decelerating down now. Now I've got a problem with something that might be more complicated:
    If a ball rolls up a ramp diagonally it will eventually make a curve that looks something like this:


    How can I do this?

    Posted in: Triggers
  • 0

    posted a message on Physics

    @Juxtapozition: Go

    OK so I've tried it with the unit group:

    accelerate / decelerate
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            General - Repeat (Actions) 20 times
                Actions
                    Unit - Create 1 Zergling for player 1 at nord using default facing (No Options)
                    Unit Group - Add (Last created unit) to zergling group
            Unit Group - Add Zergling [62.11, 64.09] to zergling group
            General - Repeat (Actions) forever
                Actions
                    Unit Group - Pick each unit in (Last created units) and do (Actions)
                        Actions
                            Variable - Set Z Zergling = (Ground height at (Position of (Picked unit)))
                            General - Wait 0.1 Game Time seconds
                            Variable - Set Z Zergling 2 = (Ground height at (Position of (Picked unit)))
                            Variable - Set difference = (Z Zergling - Z Zergling 2)
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    difference != 0.0
                                Then
                                    Unit - Set (Picked unit) Movement Speed to (((Picked unit) Movement Speed (Current)) + difference)
                                Else
                                    Unit - Set (Picked unit) Movement Speed to ((Picked unit) Movement Speed (Default))
    

    But I'm having a problem with this. The trigger itself works, but it is not picking every unit at once. As far as I've seen through testing, it picks Zergling 1 from the zerglinggroup and does [Actions], after that picks Zergling 2 and does [Actions] etc. What do I need to change so that the trigger picks every Unit at once and does actions?
    I hope you understand my problem.

    @PillowFort: Go

    He didn't create the second post, that was gerudobombshell.

    Posted in: Triggers
  • 0

    posted a message on Physics

    @Juxtapozition: Go

    Wouldn't it be enough to add all units into a Unit Group,and then rewrite the trigger so it cycles through the Unit Group?
    Why do you need this part?

    Quote:

    Then you need to create a way to organize your zerglings so that each zergling is appropriately marked to a specific number.
    This number will be the number that corresponds to its position in the variable arrays you just made. I suggest using the unit's custom values. Make each one's custom value for 0, into this unique specific number.
    You can do this by using the Action - Set Unit Custom Value.

    Posted in: Triggers
  • 0

    posted a message on Physics

    @PillowFort: Go

    Don't take me for granted on that one, but I think you'd have to create one trigger for each unit. Somebody correct me here please if I'm wrong.

    Posted in: Triggers
  • 0

    posted a message on Physics

    You made the same misstake as me:

    You took the element "Height of Unit":

    • Set Z Zergling = (Height of Zergling [61.50, 63.50])
      

    But you need to take "Height at point"(not Height of Point!):

    •  Set Z Zergling = (Ground height at (Position of Zergling [62.11, 64.09])) 
      

    In your trigger, the variables Z Zergling and Z Zergling 2 are both 0 because the height of the Zergling (relative to the ground) is 0. This took me quite a while too to figure out. edit: Thank you for the << code>> info!

    Posted in: Triggers
  • 0

    posted a message on Physics

    @gerudobombshell

    I'm having trouble understanding what your trigger does. Could you please explain it a little?

     *  Set **Ball** Property **Movement Speed** to (**XYSpeed** / **16**)

    Why divide by 16?

    * Unit Issue Order (Ball to (Move Targeting (Point With Offset Polar **(Position Of (Ball), XYSpeed, XYAngle)))
    **
    I don't understand the offset.

    * Change Unit Height (Ball, BallZ + ZSpeed, 0.625)

    I can't make sense of these 4 variables.

    Thank you in advance

    @gerudobombshell

    Do you mean like when the Zergling moves  down/up it continuously  accelerates/decelerates and as soon as it stops it reaches it's Original movement speed? If so, i think this trigger might help you:

    periodic
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            General - While (Conditions) are true, do (Actions)
                Conditions
                    (Owner of Zergling [62.11, 64.09]) == 1
                Actions
                    Variable - Set Z Zergling = (Ground height at (Position of Zergling [62.11, 64.09]))
                    General - Wait 0.1 Game Time seconds
                    Variable - Set Z Zergling 2 = (Ground height at (Position of Zergling [62.11, 64.09]))
                    Variable - Set difference = (Z Zergling 2 - Z Zergling)
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            difference > 0.0
                        Then
                            Unit - Add 1 deceleration to Zergling [62.11, 64.09] from player 1
                        Else
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            difference < 0.0
                        Then
                            Unit - Add 1 acceleration to Zergling [62.11, 64.09] from player 1
                        Else
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            difference == 0.0
                        Then
                            Unit - Remove 1000 acceleration from Zergling [62.11, 64.09]
                            Unit - Remove 1000 deceleration from Zergling [62.11, 64.09]
                        Else

    I set 3 variables for this Trigger:

    difference = 0.0 <Real>
    Z Zergling = 0.0 <Real>
    Z Zergling 2 = 0.0 <Real>

    and 2 behaviors (acceleration and deceleration) which both have a max stack count of 1000 and the duration of both is 5 seconds.
     The acceleraton behavior adds 0.05 movement speed to the unit and the deceleration behavior adds -0.05.

    I've tested this trigger and it works just as intended.

    Also,in terms of text formation, how can i make a trigger look like the one from gerudobombshell?

    Posted in: Triggers
  • 0

    posted a message on Physics

    Hello, I have the following problem: I'm trying to create a ball with physics. When it rolls down a ramp it accelerates, when it rolls over a cliff it falls down etc. Basically everything a real ball would do. I have no idea how to do this and I would really appreciate it if anyone could tell me if this is even possible / how to get it working.

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