Home   Help Search Login Register  

Author Topic: Problem: AI manning an M2 machine gun (solved)  (Read 1526 times)

0 Members and 1 Guest are viewing this topic.

Offline DerGreif

  • Members
  • *
Problem: AI manning an M2 machine gun (solved)
« on: 26 Jul 2009, 10:17:55 »
Hello together,

this is my first post here. I have toassed around the idea of making my own campaign for a while now and started Friday with designing and editing my first mission. Thanks to your ressources here I could solve a lot of problems, for exampl the "switch side issue". Sadly one of this problems I was unable to solve: I want an AI soldier to man an empty machine gun nest, the M2 machine gun, when he detects enemy forces (actually two soldiers and two different machine guns).

I tried everything I found here so far, but nothing worked. I used the init line of the soldier to assign him to the machine gun (which I named beach_gun_west): this assignAsGunner beach_gun_west
I tried also to write beach_guardian01 (which was the name I give the soldier unit) insterad of "this" and tried different versions of the "assignAs" command (assignAsDriver etc.). The trigger seems to work fine, at least all effects I connected with it are played (text message, sounds etc.). Into the on activation line I had written the following: [beach_guardian_01, beach_guardian02] allowGetIn true; [beach_guardian01, beach_guardian02] orderGetIn true

Since that did not work I tried waypoints (Get In-waypoint for example) also this meant I had to abstain from the trigger. Then I ungrouped the soldier, hoping that the group would be the cause of his inaction, but all to no avail. I do not get any error messages, those soldiers just will not move to the machine gun and enter it, although they fight the enemy. Then I tried the same with a newly put empty M113, but they did not like that vehicle also. All vehicles were unlocked. So please can somebody point me to my mistake and/or give me a hint what I can do to make this work. Otherwise I will have to put alerady manned mgs into the map but that would take some of the hectic relaistic feeling of the attack.

Kind regards,
G.

PS: Please excuse my writing mistakes, I am not a native English speaker but try to give my best.
« Last Edit: 31 Jul 2009, 00:51:34 by DerGreif »

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Problem: AI manning an M2 machine gun
« Reply #1 on: 26 Jul 2009, 10:27:13 »
Ahhhh this is simple

You have your soldier, with a hold or guard waypoint near the m2. Place a trigger with East detected by west and set it to switch. Place a synchronise line from your soldier's 'hold' waypoint to the trigger. Place another waypoint for the soldier to get in the m2. What happens now is that, if a russian soldier enters the trigger area, the soldier will get in the m2. If your soldier was part of a group then you could use the 'orderGetIn' command.

Hope this helps  :)

Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline NoMore

  • Members
  • *
  • Location: Denmark
Re: Problem: AI manning an M2 machine gun
« Reply #2 on: 26 Jul 2009, 10:32:31 »
Can you use a trigger synchronized with a get in waypoint activated by east detected by west?
Sometimes it's the easiest solution ;)
NoMore

lol Gruntage you was faster. hehe  :D
"He who stands with me shall be my brother." - Warhammer 40k: Dawn of War

Offline DerGreif

  • Members
  • *
Re: Problem: AI manning an M2 machine gun
« Reply #3 on: 26 Jul 2009, 11:31:51 »
Thank you guys for these very quick answers! Your hint worked well so far. But it seems the real problem is, that I put the machine gun into a fortress 2 (like it is in the original 1985 campaign, where you have to hold the port of Morton but then have to retreat). Without a fortress everything worked, but inside it did not. As a player I can man the machine gun inside the forress without a problem, but the AI seems to have difficulties with that. Must I put another get-in-waypoint to get the soldier into the fortress first, although this "fortress" are only some sandbags on three sides? Any further ideas how to solve this are greatly appreciated!

Kind regards,
G.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Problem: AI manning an M2 machine gun
« Reply #4 on: 26 Jul 2009, 11:56:15 »
I suppose the best way around that is to just add more waypoints. Unless it's essential that you see the soldier getting into the m2 then i suggest using this command in a trigger

Code: [Select]
m2gunner moveingunner fiftycal
where m2gunner and fiftycal are the names of the objects.

This way the AI will definately get into the gun and you dont have to worry about waypoints.

Regards,

Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline DerGreif

  • Members
  • *
Re: Problem: AI manning an M2 machine gun
« Reply #5 on: 26 Jul 2009, 12:52:25 »
Thank you very much! That is a great idea. I simply will put a move-to-waypoint as near as possible, and then have him there perform first the move-into-animation and then your suggested command. That should do it. I will try it out within the next hour.

Edit: I tried this and it worked generally. I did not find a move-into-animation so I abstained from that and just did what you suggested. But it seems that one unit has problems with following its waypoints and I do not know why. I cannot get the soldier near the machine gun. He just will not move there. The other one just does fine. And there is really no difference in the genereal setuot, I checked thos carefully. The soldier will just lie there wait for some time and then suddenly disappaer and reappaer in the machine gun (as you proposed). Although that means that he somehow must have reached the last waypoint, because I included the code line you suggested in the on-activation -tab there. But if the waypoint is far away from the machine gun he will walk in there.

The other one walks to his waypoint near the gun first, then appaers in the machine gun, which looks quiet ok for me (could of course always have been better if it worked the real way).

Had someone else the same problems? Can there be something done about it?

Kind regards,
G.

« Last Edit: 26 Jul 2009, 14:29:58 by DerGreif »

Offline DerGreif

  • Members
  • *
Re: Problem: AI manning an M2 machine gun
« Reply #6 on: 31 Jul 2009, 00:51:21 »
Ok, I solved the waypoint issue. If I set the behaviour of the soldier to "Careless" he does not ignore the waypoint and moves there. So everything is fine now. Thanks for the great help!

Kind regards,
G.