[SUGGESTION] Could OnHit event fire for Poles as well?

Talk about the map editor here

Moderator: English Moderator

Post Reply
bluemist1
Posts: 9
Joined: 02 Apr 2013, 15:21

[SUGGESTION] Could OnHit event fire for Poles as well?

Post by bluemist1 »

I would like to make a solo mode "shooting gallery" level. When looking through the Events, I saw the OnHit event. This looks perfect, but I think it only fires when Players or Bots are hit. If the Pole would generate an OnHit event if it was shot by the player, that would allow interesting levels, such as "Activate Checkpoint 3 if Pole 1 is shot"

And by "hit", I mean "The energy bolt fired by the Player intersects some small unique feature on the Pole, such as the light source" not "the energy bolt fired by the Player hits anywhere near the Pole". Otherwise, it's not much of a skill to hit it.

My goal was to combine target shooting (for example, gain 3 points when you hit a target, lose 1 point every shot you make) with a variety of TimeAttack, to make a timed shooting gallery, so solo players could practice speed and accuracy shooting. For example: Run through the level, turn on all 10 checkpoints (each of which activates when a Pole is hit) to reach the Finish.

What do you all think of this suggestion?
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: [SUGGESTION] Could OnHit event fire for Poles as well?

Post by steeffeen »

well i don't think that this would make sense as the OnHit events are intended to get only triggered when players have been hit

nevertheless you should be able to make a work around!
you can get the shooting direction of players and the position of poles, so you could calculate if the rocket is gonna hit the pole (you can't tell if a specific lighting spot of the pole will be hit of course)
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    bluemist1
    Posts: 9
    Joined: 02 Apr 2013, 15:21

    Re: [SUGGESTION] Could OnHit event fire for Poles as well?

    Post by bluemist1 »

    If I could get the X,Y,Z position of the pole and X,Y,Z position of the player, and both angles of the player's shot (X/Y and Y/Z axes) I could calculate if the shot will intersect the pole. But it would be a hitscan calculation, I think --- not "once the rocket hits the pole, it is 'hit'"

    Is there any way to get the position of a rocket? Then I could calculate its position relative to the pole's position, including the height, and score a hit when the position was "close enough" to the desired location. If I then know the height of the pole (how "tall" the pole itself is), I could calculate when the light fixture was hit, instead of just the pole itself.

    Thanks.
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [SUGGESTION] Could OnHit event fire for Poles as well?

    Post by steeffeen »

    bluemist1 wrote:If I could get the X,Y,Z position of the pole and X,Y,Z position of the player, and both angles of the player's shot (X/Y and Y/Z axes) I could calculate if the shot will intersect the pole.
    that's easily possible (i'm calculating head shots like that :p)
    look here: http://tmrankings.com/maniascript/html/annotated.html

    Code: Select all

    Player.Position;
    Player.AimDirection;
    BlockPole.Position;
    bluemist1 wrote:But it would be a hitscan calculation, I think --- not "once the rocket hits the pole, it is 'hit'"
    that's correct, if a player shoots in the right direction you can't tell if there is still something in between (like a wall), so i would suggest making it only possible in a range of 20m or something like that
    regarding the correct timing, just calculate the speed of rocket and you will be able to calculate the arrival time :mrgreen:

    p.s. i will calculate the speed of rockets real quick ...
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: [SUGGESTION] Could OnHit event fire for Poles as well?

      Post by steeffeen »

      Rocket Values:

      Flight Distance: Up to 150 meters
      Flight Speed: 36.1 - 36.3 m/s
      Flight Duration: Around 4 seconds
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        Post Reply

        Return to “Map Editor”

        Who is online

        Users browsing this forum: No registered users and 1 guest