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.
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.
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).
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.
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.
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.
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.