Jump to content
Maffa

Civilian module scripting proposal (COTVT63 BRA3 Illegal Mining v1)

Recommended Posts

Hello all

 

Yesteday i played the mission as per title for the first time. 

 

Luiz made a great job with the intreraction with civilians, and i think we could use more COIN operations in general, where you have to cope more with collateral damage control and urban warfare. 

 

I am but a rookie in scripting, my brain sweats bullets when i have to script, but i know i could use a packaged civilian module, maybe inside Olsen's framework, where you can automatically populate areas with random spawn civilians with arrayed outfits, and Luis' interaction control.

 

Back in Arma 2 i used several civilian scripts that allowed this, and a few also had interesting features like civilians driving around, sitting, chatting, and changing their pace, even though they were quite frame punishing (that was before headless clients were around tho). 

 

Now dont get me wrong, i am not planning an Alive COIN mission, but a prepackaged, tested and failproof civilian spawn module, civilian interaction modules and a civilian kill count could do a great good for mission scripting.

 

 

Share this post


Link to post

Hi Maffa. I'm glad you thought any of it added anything worthwhile to gameplay.

The scripts I use are very simple (more below). I think some parts of it could be easily made into a framework module, and I think Perfk had approached me about it too. The thing is: I have no idea what I'm doing, I'm pretty bad with scripting. Not only I have no clue how to do it (especially keeping the same standards), but also I'm sure I'd break all the other modules if I'd try messing with it.

But if anyone wants to use my stuff, be it code or ideas or whatever, go ahead. Also, I'd be more than happy to collaborate with anyone who'd be willing to work on it.

I'm not sure which parts you thought were good or useful. I think there are 3 main parts, as such (I'll put the core of the code here so people don't have to de-pbo stuff to know what we're talking about):

 

1) Interactions to check people's documents etc.

This is just an ACE interaction ran on all civs and indfor. It's super simple and just adds an ACE interaction (under the "Interactions" submenu). This is ran in all clients:

 

 

 

if (side player == resistance) exitwith {}; // Only blufor gets the interactions

_checkciv = ["Check","Check documents","",{ [] spawn { hint "Checking the documents..."; sleep 5; hint "This guy is clean. Just a civvie."}},{true}] call ace_interact_menu_fnc_createAction;

{ if (side _x == civilian) then { [_x, 0, ["ACE_MainActions"], _checkciv] call ace_interact_menu_fnc_addActionToObject; } } foreach allunits;

_checkno = ["Check","Check documents","",{ [] spawn { hint "Checking the documents..."; sleep 5; hint "This is one of the bad guys."}},{true}] call ace_interact_menu_fnc_createAction;

{ if (side _x == resistance) then { [_x, 0, ["ACE_MainActions"], _checkno] call ace_interact_menu_fnc_addActionToObject; } } foreach allunits;

 

 

 

 

2) The Interaction to yell at Civs to drop to the ground or put their hands up.

This is only slightly more complicated. This is (somewhat) already part of ACE3 but the ACE one doesn't work for 2 reasons:

 

a ) The interaction distance is too small. So if the civ keeps running you don't have time to interact with him before he gets out of range. You need to literally wait for him to stop running (some times takes minutes). To solve this I just created an interaction with the maximum distance allowed by ACE (not sure of numbers but I think it's around 20~30 meters). I've also put it as a 1st tier interaction so it's quicker and one doesn't need to fiddle with sub-menus just to yell at a guy.

 

b ) Most of the time the AI doesn't respond on a dedicated server. It works on SP/local server but not on dedicated. This took me a loooong while to debug and it seems that the problem is just that since the AI is not local it will not respond to anything new (including animations) until their waypoint queue is empty (even if you run the animation code server-side). If they're loitering the queue may be empty, but as soon as they get scared and running around they won't respond any more until they finish doing their thing (often takes several minutes). To solve this I just put in the code to create a new group every time the civ gets interacted with. Put the civ in the new group (clear of waypoints) and the civ will always respond immediately.

 

Anyway. These are two things that could be solved in ACE I suppose, rather than adding a redundancy to the framework. 

 

3) Civilian casualty count. 

Again, this one is super simple. I just run a "killed" eventhandler for all civilians. Once their killed I check for killer (it's passed on _this array) and his side, then keep adding each side's kills to a variable.
 
To show the civilian killings for each side on the framework endscreen without having to mess with the endscreen code I just used a format with the variables when calling for the function to end the mission:
 

_bottomline = format [ "Civilian events: Brazil killed %1 civs.; Thugs killed %2 civs.", BLU_CivKilled, GUE_CivKilled];

format ["Mission end message<br /><br />%1<br />", _bottomline] call FNC_EndMission;

 

 

 
 

Share this post


Link to post

2) The Interaction to yell at Civs to drop to the ground or put their hands up.

 

 

Just make a self interaction to yell out GET DOWN, which would make every civilian in ~30m range get down, could use a sound effect from swat 4 for extra value.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...