Home   Help Search Login Register  

Author Topic: AI to open a door, how?  (Read 976 times)

0 Members and 1 Guest are viewing this topic.

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
AI to open a door, how?
« on: 08 Aug 2004, 01:08:10 »
Hi!

I'm making a mission where I want an AI-player to open a door in a building (or I want the door to be open from the start). Is that possible? Is there an Action-command for it? I haven't found any.

I'm also using an addon (a big plane) that you can open the rear on. Now, I can (of course) just stand next to it and use the menu to open the plane, but I have no idea how to get the AI to do it. The readme for the plane didn't list the action command needed to get the AI to open it. Do you guys have any suggestion? (I did email the guy who did the addon, but the addon is from 2002).

Thank you!

/Pelle

static

  • Guest
Re:AI to open a door, how?
« Reply #1 on: 08 Aug 2004, 01:30:57 »
im not sure if you can get them to open a door... for me they just run right on through  :o    um, wait for another response, its possible to make it more realistic but getting them to open the door but im not exactly sure
good luck


STATIC  :gunman:   :tomato:

Dubieman

  • Guest
Re:AI to open a door, how?
« Reply #2 on: 08 Aug 2004, 03:43:55 »
I have no idea on doors, aren't they open from the start like Victor Troska's house? :P

Give us the name of the addon, we can't do anything unless we know what it is...

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Re:AI to open a door, how?
« Reply #3 on: 08 Aug 2004, 13:39:16 »
OK. hmm. Well the door thing is fine. I'll manage without it.

Here's some info on the addon.

03/10-2002  Konyaks Antonov-124-Resistance Addon:  

Antonov.pbo
AntonovOpen.pbo

Antonov.pbo, is flyable. You can open the rear on it.
AntonovOpen.pbo, is static. You can open the front and the rear.

Now, what I want is for the rear to be open on the Antonov.pbo, when the game starts (or after a while, I figured that could be done with a trigger or similar). I also want to remove the "open rear / close" (don't remember the real name for the action) action from the players action menu. That way the player/players have no control of the rear thing. I only want it to be controlled by an AI or a trigger, or logic.

I supposed I can un-pbo it and change the config of the plane. The drawback is that I am clueless when it comes to addon configuration and un-pbo'ing. I have never made an addon.

Thanks!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:AI to open a door, how?
« Reply #4 on: 08 Aug 2004, 15:48:12 »
object animate [animation, phase]

Operand types:
object: Object
[animation, phase]: Array
Type of returned value:
Nothing
Description:
Process animation on object. Animation is defined in config file. Wanted animation phase is set to phase.

Example:
house animate ["doors1", 1]

comment »

General Barron  May 23, 2004, 23:26  
This has nothing to do with the switchmove/playmove commands, or unit animations. This command deals with animations built into objects, such as opening/closing doors, lowering goggles (as in BAS Rangers addon), etc.
 
 
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:AI to open a door, how?
« Reply #5 on: 08 Aug 2004, 16:13:14 »
Quote
Now, what I want is for the rear to be open on the Antonov.pbo, when the game starts (or after a while, I figured that could be done with a trigger or similar). I also want to remove the "open rear / close" (don't remember the real name for the action) action from the players action menu. That way the player/players have no control of the rear thing. I only want it to be controlled by an AI or a trigger, or logic
(afaik) you can not remove actions that are added in the action menu with other than addAction...
And in this case the action is (at least should be) added by the class userActions in the addon's config.cpp...

And yes, you can have the rear open in the beginning of the mission, but you don't necessarily need a trigger or such, just name the plane and put in the missions init.sqs nameOfPlane animate ["whateverTheAnimPartIsCalled",phase]...
Now this is a bit tricky as the addon's readme (if it has one) does not probably tell you the names of the animated parts, so you probably would need to unpbo the addon to get a look at it's config... :(
In there you would find the names...
The phase is usually like this: 0 = closed, 1 = open...

When AI is concerned you would need trigger(s) placed at the rear and have a quite small radius so that When an AI is close enough to the rear the trigger would then trig and open the 'hatch'...
If this should be done in mid-flight, it would probably need some scripting...

But, I do not have this addon so can't help much :(
« Last Edit: 08 Aug 2004, 16:14:16 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Re:AI to open a door, how?
« Reply #6 on: 08 Aug 2004, 16:27:33 »
(afaik) you can not remove actions that are added in the action menu with other than addAction...
And in this case the action is (at least should be) added by the class userActions in the addon's config.cpp...

And yes, you can have the rear open in the beginning of the mission, but you don't necessarily need a trigger or such, just name the plane and put in the missions init.sqs nameOfPlane animate ["whateverTheAnimPartIsCalled",phase]...
Now this is a bit tricky as the addon's readme (if it has one) does not probably tell you the names of the animated parts, so you probably would need to unpbo the addon to get a look at it's config... :(
In there you would find the names...
The phase is usually like this: 0 = closed, 1 = open...

When AI is concerned you would need trigger(s) placed at the rear and have a quite small radius so that When an AI is close enough to the rear the trigger would then trig and open the 'hatch'...
If this should be done in mid-flight, it would probably need some scripting...

But, I do not have this addon so can't help much :(
OK uhm, well the plane is on the ground so there shouldn't be any problems there. As for the unpboing, I'll get on it right now I guess.

*edit*

It's unpbod and I've got a whole bunch of things to look at.
Now this looks like the controls for the animation of the rear cargo door:

      class EventHandlers
      {
         gear = "if (_this Select 1) then {(_this Select 0) Animate [""LeftGear"", 0]; (_this Select 0) Animate [""LeftGdLow"", 0]; (_this Select 0) Animate [""LeftGdUp"", 0]; (_this Select 0) Animate [""RightGear"", 0]; (_this Select 0) Animate [""RightGdLow"", 0]; (_this Select 0) Animate [""RightGdUp"", 0]; (_this Select 0) Animate [""NoseGear"", 0]} else {(_this Select 0) Animate [""LeftGear"", 1]; (_this Select 0) Animate [""LeftGdLow"", 1]; (_this Select 0) Animate [""LeftGdUp"", 1]; (_this Select 0) Animate [""RightGear"", 1]; (_this Select 0) Animate [""RightGdLow"", 1]; (_this Select 0) Animate [""RightGdUp"", 1]; (_this Select 0) Animate [""NoseGear"", 1]}";
      };
   class UserActions
      {
         class OpenRear
         {
            displayName="Open Rear Cargo";
            position="pos cargo open";
            radius=45;
            condition="this animationPhase ""RearRamp"" < 0.5";
            statement="this animate [""RearDoor"", 1]; this Animate [""RearRamp"", 1]; this Animate [""RRdoor"", 1]; this Animate [""LRDoor"", 1]";
         };

         class CloseRear
         {
            displayName="Close Rear";
            position="pos cargo open";
            radius=45;
            condition="this animationPhase ""RearRamp"" >= 0.5";
            statement="this animate [""RearDoor"", 0]; this Animate [""RearRamp"", 0]; this Animate [""RRdoor"", 0]; this Animate [""LRDoor"", 0]";
         };
      };


Now for to the problem. "RearRamp" is (I think?) the command to open/animate the rear door. Now, is there any way I can remove the action from player control? You mentioned that only addaction actions can be removed, but now that I have the whole plane unpacked, how do I rewrite it so that the animation control for the rear door is controlled only by a certain trigger? What I mean is that the player/AI isn't going to have any control over the rear door.   :)
« Last Edit: 08 Aug 2004, 16:41:04 by Pellejones »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:AI to open a door, how?
« Reply #7 on: 08 Aug 2004, 16:54:57 »
I think you need all those RearXXXX to make the ramp animate right (??)

Quote
how do I rewrite it so that the animation control for the rear door is controlled only by a certain trigger?
Well, you just remove the class userActions...
Which would be this part:
Code: [Select]
class UserActions
      {
         class OpenRear
         {
            displayName="Open Rear Cargo";
            position="pos cargo open";
            radius=45;
            condition="this animationPhase ""RearRamp"" < 0.5";
            statement="this animate [""RearDoor"", 1]; this Animate [""RearRamp"", 1]; this Animate [""RRdoor"", 1]; this Animate [""LRDoor"", 1]";
         };

         class CloseRear
         {
            displayName="Close Rear";
            position="pos cargo open";
            radius=45;
            condition="this animationPhase ""RearRamp"" >= 0.5";
            statement="this animate [""RearDoor"", 0]; this Animate [""RearRamp"", 0]; this Animate [""RRdoor"", 0]; this Animate [""LRDoor"", 0]";
         };
    };

Then there should not be any actions available for the player...
Then just use a trigger with that animate command for those doors...

But why on earth would you want to go through all this trouble for a mission, because now you need to ask a permission from the author of that Antonov to modify and 'distribute' that modified version of the Antonov...

And all the people playing that mission would need to download that modified version in order to play the mission like you would want to, without the actions for the player(s)... ::)
« Last Edit: 08 Aug 2004, 16:55:52 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Pellejones

  • Members
  • *
  • Yes, well... what?
Re:AI to open a door, how?
« Reply #8 on: 08 Aug 2004, 17:04:47 »
Quote
But why on earth would you want to go through all this trouble for a mission, because now you need to ask a permission from the author of that Antonov to modify and 'distribute' that modified version of the Antonov...

And all the people playing that mission would need to download that modified version in order to play the mission like you would want to, without the actions for the player(s)...  

Well, the guys I play with keep messing around with stuff when we play hehe. If any one of them saw that you could open the rear door if you stand near the plane, they would. Even if we play this super cover ops. mission, they would   :)  

That's why I was hoping that there was a way to lock the actions without making changes to the .pbo.

The problem with the addon is that I emailed the maker of the addon a few days ago, and I haven't gotten any reply yet. I suppose I'll just keep the plane as it is, and trigger the anim, hope that my fellow players wont mess around with the action, and enjoy the mission :D