Thank you very much for this tutorial. Though, some things are a bit unclear at times, it was very usefull for my first addon attempts.
Anyway, you might wanna complete your tutorial regarding doors and AI actually useing them! (I've burned some hours to figure it out... I guess I grow old, hrhr)
So: the following ingredients are lacking, to make AI use your doors:
1) We absolutely need a PATHS LOD. If you don't have any, AI might completely refuse to enter it/walk through it -> Bad.
2) An ordinary PATHS LOD consisting Inn- and Posn-selections is NOT enough (or the AI wallhacks through your door). What we need is something like this:
Code:
. Pos1
/\
/ \
/ \
.________. -> both points: ActionEnd1
| |
| |
| | --> horizontal door position |----|
| |
.|______|. -> both points: ActionBegin1
\ /
\ /
\/
. In1
This is exactly what can be found in the "KBud" model from the ARMA_SampleModelsEnvironmentOther-Pack.
Now, I don't know exactly why, but this didn't really work for me (it's for a wall-fragment and not a complete building as in KBud, so exactly like in the tutorial). Maybe I've placed the In1 and Pos1 too close or whatever.
Anyway, I ended up with this variation which works very nice for my maze (thread 89926):
Code:
. In2
/\
/ \
/ \
.________. Pos1 (one single point)
| |
| |
| |
.________. -> both points: ActionEnd1
| |
| |
| | --> door position |----|
| |
.|______|. -> both points: ActionBegin1
\ /
\ /
\/
. In1
^^ I don't know if the Pos1 is really needed. I started without it (just In1 and In2) and it didn't work. Don't know why, maybe because again placed too close, or maybe because min. one Posn is needed. (btw. exactly this makes it so hard to do anything: one never really knows how and/or why stuff exactly works. What are the exact rules? We can only guess :/)
All needed then is to add the following to your class-definition in you Config.cpp:
Code:
class CfgVehicles
{
class LAND_theObject : inheritFromThisObject
{
...
class UserActions
{
class OpenDoors1
{
// open door animation definition
};
};
...
ActionBegin1 = OpenDoors1;
ActionEnd1 = OpenDoors1;
};
...
};
If you've ever wondered for what ActionBegin1, resp. ActionEnd1 are for while studying the official examples... well, that's what they are for: to trigger AI-Action if they cross a certain line (the two points).
The thing is: if you don't do this (that is no ActionStuff and only ordinary In/Pos PATHS) then the AI will happily wallhack through your door - while the player can't, hehe. I guess the PATHS will force the AI to wallhack in this situation, and thatswhy we have ActionBegin1 and ActionEnd1..
I guess it's important that they have exactly this name-schema (like In/Pos-Selections).
Hope this helps a bit, because IMHO it's very important that AI can handle your stuff/addons well too!