• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

point detecting problem

Status
Not open for further replies.
Level 15
Joined
Oct 29, 2012
Messages
1,474
I was and I am still working on a 2D map about Mario . I have some problems about the gravity and physics .
Well It's all about jump system . This trigger should probably detect what the terrain type is in the bottom of the jumper . But the problem is , It's not really fast enough not to hack the ground . I mean It should stop once the terrain is detected , But the problem is the jumper is stopping sometimes higher than the ground , and some times hacks it , and some times it stops exactly on the ground .
  • Set Velocity and Position
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set _IntegerFl_2D = 1
      • For each (Integer A) from 1 to _AmountPlayers_2D, do (Actions)
        • Loop - Actions
          • Set _tempPointDXD_2D = (Position of _Hero_2D[_IntegerFl_2D])
          • Set _tempPointD2_2D = (_tempPointDXD_2D offset by _BlockDistance2_2D towards 0.00 degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at _tempPointD2_2D) Not equal to _GroundStable_2D
            • Then - Actions
              • For each (Integer ForLoopIntegerC) from 1 to NumberOfJumpers, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Grounded[ForLoopIntegerC] Equal to False
                    • Then - Actions
                      • Set Jumpers_Y_Velocity[ForLoopIntegerC] = (Jumpers_Y_Velocity[ForLoopIntegerC] - (g_Acceleration x t_TimeStep))
                      • -------- Set the new position --------
                      • Unit - Move _Hero_2D[ForLoopIntegerC] instantly to ((Position of _Hero_2D[ForLoopIntegerC]) offset by ((Jumpers_X_Velocity[ForLoopIntegerC] x t_TimeStep), (Jumpers_Y_Velocity[ForLoopIntegerC] x t_TimeStep)))
                    • Else - Actions
            • Else - Actions
              • Do nothing
          • Set _IntegerFl_2D = (_IntegerFl_2D + 1)
      • Custom script: call RemoveLocation( udg__tempPointDXD_2D )
      • Custom script: call RemoveLocation( udg__tempPointD2_2D )
What would the problem be?

I can add this , It may be the cause of the problem :
This stops a jumper from jumping when reaching the ground .
  • Stop Jump Ground
    • Events
      • Unit - A unit enters H0 <gen>
      • Unit - A unit enters H1 <gen>
      • Unit - A unit enters H2 <gen>
      • Unit - A unit enters H5 <gen>
    • Conditions
    • Actions
      • Set Stop_Jump_Ground = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to _Hero_2D[Stop_Jump_Ground]
        • Then - Actions
          • -------- Find THE ground (if it hits the ground) --------
          • Set Jumpers_Y_Velocity[Stop_Jump_Ground] = 29.43
          • Set Grounded[Stop_Jump_Ground] = True
          • Set Jumping_No_Up[Stop_Jump_Ground] = False
        • Else - Actions
      • Set Stop_Jump_Ground = (Stop_Jump_Ground + 1)
SOLVED
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
create a location on the terrain at the point were the unit should stop.
Use get location Z and that will return the z at which you place the unit.
An example because I don't get u >.>
EDIT : The Unit doesn't fly . He keeps jumping on the ground , like XANID or Platform Escape ....
You
1. Have leaks.
2. Use Integer A and Do Nothing
What leaks? >.< I don't see any
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
What's the problem with Integer A? o_O

integer A / B can bug they are also slower and less efficient than using your own integer.

@TO
how are you making the units jump ? are you using the x and z axis or y and z axis to simulate a jump ?
when moving a unit on its z axis ( height) you simply create a location at the point you want the unit to stop. Then detect the locations z value. Then do SetUnitZ( unit, z) when the jump is complete
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
integer A / B can bug they are also slower and less efficient than using your own integer.

@TO
how are you making the units jump ? are you using the x and z axis or y and z axis to simulate a jump ?
when moving a unit on its z axis ( height) you simply create a location at the point you want the unit to stop. Then detect the locations z value. Then do SetUnitZ( unit, z) when the jump is complete


Probably X/Y axis only . They don't leave the ground such as Platform Escape map or XANID . So i just have to move unit , Also it's parabola but dunno what the hell bugs it .

The only solution is when the unit enters the region of ground I move him to the limit of the region . How do I get regions points axis? For example how do I get the Y coordinate of the top limit line of a region? I would be very thankful .

EDIT : Z axis not included , It's constant .
 
Status
Not open for further replies.
Top