Page 1 of 5 123 ... LastLast
Results 1 to 10 of 50

Thread: Collision

  1. #1
    Developer
    Join Date
    Jun 2010
    Location
    Hungary
    Posts
    291

    Default Collision

    is it possible to add a command to detect the player, vehicle etc. collision?

    i mean for example:

    Code:
    self waittill collision
    and there is another thing. we can spawn script_object, add setsize and we will have a solid box. but no way to add to it a mask. i mean playerclip, metal mask, and all of these. i know so that mohaa engine always searching for the collisions and doesn't like the things without mask (like vehicles and others).

    i think we almost have everything what we need but maybe these things could be useful in some cases.

  2. #2

  3. #3

    Default

    masks would be good , may be too out of scope for the patch, think the information is done in .map compile?

    yes waittill touch, but you must have physics_on and I'm not sure it will work for a player, but the ent the player touches will work.

    What are you trying to do?

  4. #4
    Developer
    Join Date
    Jun 2010
    Location
    Hungary
    Posts
    291

    Default

    waittill touch doesn't work for players. it is loaded continuously. i only used this command for script_models.

    i made a collision script for vehicles. the base idea is to check the vehicle's position 2 times. the second is one frame after the first. if the 2 origins are the same, the vehicle is blocked. but not perfect. and i glued a trigger_vehicle to all players to check if they are touching a vehicle. but not perfect too and very bad when the vehicle doesn't have collision, only solid and setsized.

  5. #5
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,231

    Default

    Collisions in MoHAA are trace based as far as I know. You should take vehicles direction and send a trace in that direction each second of something. (And only when vehicle is moving).

  6. #6

    Default

    imo it's easier to stay clear of all mohaa physics, and script it yourself, this way you don't get any unpredictable behaviour.

    in order to use waittill touch, you can do $entity waittill touch and see if a player touched it, using parm.other. This will get what touched that object.

    If you can find my drivable car I did, that is a long the lines of how I would go.. Trace and see if the edges of the vehicle hit something and stop the driving right there.

    Trigger can work fine for detecting players, if the trigger turns ok with the thing, or you can check several little triggers, in the shape of the tank, or just scan the tanks area. or you can use "istouchign"

    if($player istouching $ent)
    {
    //works fine
    }


    tanks were always fun but the maps too laggy with them, the best way was to shrink the tanks to .2 and make script all movement from the start. They work quite well....the only problem Is that you lose wheel animations etc, now with the car I did, I demonstrated how you could fake stopping and starting wheels, using tiks and skins, animations, but I think you could actually do it with different tank models..like I did zombies.
    No one who ever scripted tanks ever did what I did for the car, for a tank.

  7. #7
    Developer
    Join Date
    Jun 2010
    Location
    Hungary
    Posts
    291

    Default

    i have the tanks and jeeps scripted because they are accelerating, decelerating. i think mohaa likes this much better than immediate stop. if i want to detect the touching players with trace, that means i need to start traces from hundreds of positions because we dont know in advance which point of tank will the player touch.

  8. #8

    Default

    no, you don't use trace to detect players, only collisions with walls and ents.

    to detect players, you have triggers, is touching, is just check if the players origin is within the area of the tank.

  9. #9
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,231

    Default

    Why do you want to detect players touching jeep? If you want to hurt players hit by the car, you should hurt them only if hit directly by the tank/car which means that you only have to trace in the direction that car/tank is moving. At least I think so.

  10. #10
    Developer
    Join Date
    Jun 2010
    Location
    Hungary
    Posts
    291

    Default

    I know it's an old thread but it would be another question. If i'm thinking well, we put a static ent on map and the compiling call its mask from the .map file in.
    I have my custom masks for vehicles in spearated .map files as well.
    Is it possible to add a command or make somehow to load those masks from .map files to existing maps so we can add custom vehicles with collision?

    I hope all of you understand my question. If not, just ask.

Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •