Home   Help Search Login Register  

Author Topic: Returning vehicle seat positions  (Read 5414 times)

0 Members and 1 Guest are viewing this topic.

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Returning vehicle seat positions
« 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?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Returning vehicle seat positions
« Reply #1 on: 05 Jul 2009, 04:48:26 »
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...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Returning vehicle seat positions
« Reply #2 on: 05 Jul 2009, 21:49:12 »
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.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Returning vehicle seat positions
« Reply #3 on: 05 Jul 2009, 22:03:30 »
 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 .

 

I love ofp

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Returning vehicle seat positions
« Reply #4 on: 05 Jul 2009, 22:20:45 »
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?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Returning vehicle seat positions
« Reply #5 on: 06 Jul 2009, 11:54:01 »
Quote
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.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Returning vehicle seat positions
« Reply #6 on: 06 Jul 2009, 13:34:46 »
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...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Returning vehicle seat positions
« Reply #7 on: 06 Jul 2009, 19:31:31 »
Well, dogs cannot be put into seats as you can with a man.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Returning vehicle seat positions
« Reply #8 on: 07 Jul 2009, 13:11:34 »
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.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Returning vehicle seat positions
« Reply #9 on: 07 Jul 2009, 18:54:54 »
 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.

 
Code: [Select]
  class Animal : Man
    {
      vehicleClass = "Animals";
      isMan = 0;

 and further down
Code: [Select]
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 .

I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Returning vehicle seat positions
« Reply #10 on: 07 Jul 2009, 19:26:13 »
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?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Returning vehicle seat positions
« Reply #11 on: 07 Jul 2009, 19:54:30 »
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.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Returning vehicle seat positions
« Reply #12 on: 07 Jul 2009, 21:30:43 »
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).

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Returning vehicle seat positions
« Reply #13 on: 08 Jul 2009, 02:30:17 »
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?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Returning vehicle seat positions
« Reply #14 on: 08 Jul 2009, 03:01:24 »
Reckon it's worth raising as a bug?