Home   Help Search Login Register  

Author Topic: A simple question and a curiosity.  (Read 1128 times)

0 Members and 1 Guest are viewing this topic.

Javito

  • Guest
A simple question and a curiosity.
« on: 06 Aug 2006, 22:39:33 »
I'm playing with Liberation 1941 and using the Emisalo Winter island I've created a mock German defense in the woods which bears a striking similarity to some Moscow battles in late 1941. I have three squads and I give them all HOLD waypoints... and yet they do anything but. The squad leader remains holding but many of the soldiers advance forward and find places to take cover in the open, away from the tree line where my fortifications are placed. I keep the vehicles immobile by taking their fuel away, and I'm wondering how I can keep the infantry to stay in position as well?

Secondly I'm wondering if there are any trench addons or stationary fortifications that can be used for this kind of scenario. Specifically I'm referring to the type of trenches seen in the FDF WW2 mod. Is there anything like that which I can use?

Offline 456820

  • Contributing Member
  • **
Re: A simple question and a curiosity.
« Reply #1 on: 06 Aug 2006, 23:08:26 »
For the trench addons take a look about Ofp.info theres bound to be some there.

To stop the infantry advancing put
dodtop this;
in there init fields.
When you want the soldiers to move again use

soldier1 dofollow leader soldier1

This way you can also place soldiers in a bush or something aslong as there special box is "None" so they wont start running away they should remain were placed.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: A simple question and a curiosity.
« Reply #2 on: 07 Aug 2006, 15:28:27 »
Also making sure their combat mode is set to "open fire" instead of "open fire, engage at will" might help. Although they'll probably engage the enemy anyway. It's a thing.

Otherwise the previous suggestion sounds pretty good. The "Hold" waypoint...well. I'm not really sure what it's supposed to do, except being un-passable unless you switch-trigger it.  ???

*shrug* But yeah. As to trenches ; if I remember correctly, ofp.info featured this small WW2 map made by linkersplit (maybe?) which was really only a single high-lag town. Nonetheless, all the buildings, including several very cool-looking trenches and craters and stuff were available in the editor. What you can do is download that island and use the objects from there. Check it out, anyway.

Good luck! And good that someone's doing something with Libmod. Excellent stuff.

/Wolfrug out
"When 900 years YOU reach, look as good you will not!"

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re: A simple question and a curiosity.
« Reply #3 on: 07 Aug 2006, 15:36:52 »
If you really, really want them to stay where they are then experiment with disableAI "move" and disableAI "Target", can't remember exactly which does what.    Unfortunately ou cannot enable the AI later, although you can delete the unit and replace it with an identical one.

If they run away too soon use allowFleeing 0.

setUnitPos will allow you to control whether they stand or lie down.

456 made a typo in his excellent answer, its doStop.

Do you really need the hold waypoint?    If they are just going to stay there they may not need a waypoint at all.
Plenty of reviewed ArmA missions for you to play

Offline Pilot

  • Contributing Member
  • **
Re: A simple question and a curiosity.
« Reply #4 on: 07 Aug 2006, 22:26:24 »
The nature of OFP's AI will mean that the squad will rush out to meet an attack whether or not a hold waypoint is used.

Quote
Unfortunately ou cannot enable the AI later, although you can delete the unit and replace it with an identical one.
Actually, there is a way.  Anytime the game is saved, whether is be by clicking "Save", or by using the code, savegame, the AI are re-enabled.  Also, any time a game is loaded the AI is enabled.  I strongly suggest using DisableAI, I have found it to work in the past.  The problem with the save game bug is easily worked around, as I will explain.

The first thing you want to do is add all of the units in the trenches to an array.  This is easily done by creating a trigger over all of the units in the trenches, then setting the trigger to activate by that side being present.  In the On Activation field, put:
TrenchUnits = thislist;

Now the units are in an array, which will make our task much easier.

Moving on.  In order for this to work, the player can NOT use the Save button when the game is paused.  It is imperative that you tell the player this in the readme.  Using the Save button will break the mission.  However, there is a way for the player to save the game as long as he is the leader of his group.  To do this, create a trigger and make it activated with Radio Alpha (or whatever radio you want).  Then, in the On Activation field, put:
savegame; {_x disableAI "MOVE"} foreach TrenchUnits; {_x disableAI "TARGET"} foreach TrenchUnits;

Now when the player saves the game the units will have their AI re-disabled.

We're not done yet, though.  What happens if the player loads a game?  As I said earlier this will also break the game.  There is a solution.  Through a trigger or init.sqs, call a script called resave.sqs:
[] exec "resave.sqs"

Now create a new text document and name it resave.sqs.  Copy and paste the following code into the newly created script:
Code: [Select]
~1

#Loop
?time < 1: goto "reset"
~.01
goto "Loop"

#reset
{_x disableAI "MOVE"} foreach TrenchUnits
{_x disableAI "TARGET"} foreach TrenchUnits
goto "Loop"

Viola!  Then men in the trenches should now stay where they are.

-Pilot
« Last Edit: 07 Aug 2006, 22:30:07 by Pilot »

Javito

  • Guest
Re: A simple question and a curiosity.
« Reply #5 on: 08 Aug 2006, 00:37:47 »
Thanks a lot guys, I got it working fine now :-).