OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: DMarkwick on 05 Jul 2009, 01:49:29
-
Thanks to the emptyPositions command I can discover if there are empty positions on any given vehicle.
Does anyone know how I can get the positional info, relative to the vehicle, of those empty seats?
-
Not as far as I'm aware. You might get somewhere putting people into them and checking where they are relative to the vehicle, but I'm not sure you'll get anywhere with that. Might be some new A2 trick to it though...
-
Hmm. I wonder how the game engine handles, it, I suppose there must be a way of interrogating the config to get the positions, and a way to tell if each position is occupied or not.
-
its been along time since i looked into this problem but i used to measure the distance from the driver to the occupied seat( occupied by a logic in a script) and then i am almost sure someone came up with a better solution with a new arma command or config refference. for your own addon you could creat a different crew anim name for each pos i guess and check that .
-
If you put a logic into the seat, then the player hears a "click" and the door is opened/closed. Thus, it is mostly not appropriate unless you create a vehicle specially to measure.
The positions aren't in the config, but in the model, so it can't be queried in-game.
I assume you need this so you know where to attachTo them so that they can fire weapons in a moving vehicle?
-
The positions aren't in the config, but in the model, so it can't be queried in-game.
They (BIS) must be able to query it ingame, otherwise how does the game assign units to available positions? :)
But, I guess I get the point.
The reason I'm looking at this problem is for the tracker dog addon. It's working really well now (some great improvements) and I need a way to move the dog with vehicles. I thought I might attachTo the dog (in a sitting animation) to a vehicle. As I don't wish to have either a restriction on vehicle type, nor masses of handmade vehicle case code, I thought I'd use whatever logic the game uses.
-
Get used to it! There are literally 1000s of things that can be queried by the engine that isn't available to scripters. Some can be found out via workarounds , though some workarounds are often little more than guesses...
Why not just put the dog on a seat by moving him into the vehicle just as you would a man? If you attachTo a dog into a seat position, then that wouldn't stop a man from sitting in the seat at the same time
It is often best to explain what you need something for ("How do I put dog in a car seat?"), rather than asking for an abstract technique ("how do I find out seat positions?") which may not actually be the right way. That way, we can guide you on a better path.
A general comment about attachTo (not directed at original poster): Although this command is absolute gold to everyone who struggled without it in A1, it isn't the answer to all problems...
-
Well, dogs cannot be put into seats as you can with a man.
-
Oh, I am surprised by that, since you can put gamelogics in seats and animals are of class Man (although not of CaManBase). If you end up having to attachTo then, ensure you put a game-logic into the seat so that no-one can sit there.
-
Yeah i got excited about them inheriting from man but soon began to unravel and it became clear that
the following changes post inheritance meant they were not gonna work as i hoped.
class Animal : Man
{
vehicleClass = "Animals";
isMan = 0;
and further down
moves = "CfgMovesDog";
woman = 0;
Hope you get these dogs out there real good fun , the ones i linked very early on work very nicely with ai already so i hope you can fix the human element .
-
Oh, I am surprised by that, since you can put gamelogics in seats and animals are of class Man (although not of CaManBase). If you end up having to attachTo then, ensure you put a game-logic into the seat so that no-one can sit there.
Can you please explain a little more on the game logic thing? How do you place a game logic into a vehicle seat?
-
Same as you would for a man (or how I expected you to for a dog ;) ). It is, of course, invisible, but does take up the space, so no-one can sit there.
-
I'm trying moveInCargo and assignAsCargo to a game logic I placed in the editor, but as far as I can tell it's not entering the vehicle (monitoring the game logic's position).
-
Sorry, you are right. In A2 it doesn't like you putting logics or animals in cars. Putting logics in cars was always fine in A1, but maybe they don't want us "misusing" logics any more?
-
Reckon it's worth raising as a bug?
-
Could be. Not a clue what prevents them entering vehicles any more (that is, whether it is a bug or an intentional limitation that BIS have imposed to make something else work).
-
Is there the possibility that a modified game logic could be derived from the default one, with the old abilities reinstated? Say as a CBA project?
As you say the default one might have been fixed to prevent problems somewhere else, but this might not apply to a derivative?
-
I don't know if there is a good reason to have prevented insertion of logics, but if there is a way around it, it sounds appropriate for CBA. Please ticket it and we can look into it when we aren't so busy with other things ;)
-
It may be an actual bug, the new animals are derived from the Man class, and BIS probably deliberately excluded everything without a proper animation from doing things that need animations, or that need appropriate AI (like driving).
It might be the case that GLs have come into this exclusion because of that.
-
Sounds good to me.