Bohemia Interactive Forums  

Go Back   Bohemia Interactive Forums > BI MILITARY GAMES FORUMS > ARMA 2 EDITING > ArmA 2 & OA - MISSION EDITING & SCRIPTING

ArmA 2 & OA - MISSION EDITING & SCRIPTING For discussing the technical aspects of creating custom ArmA 2 & the standalone expansion Operation Arrowhead missions as well as scripting.

Reply
 
Thread Tools Display Modes
Old 12-11-2009, 12:53 PM   #1
Monsada
Staff Sergeant
 
Monsada's Avatar
 
Join Date: Oct 2009
Posts: 210
UPSMON - Urban Patrol Script Mon

Versión 5.0.7

Project Space for Monsadas UPSMON at Dev-Heaven now available!
Please Register for an account at Dev-heaven.net and post all your suggestions, bug-reports, support-request, etc. in the UPSMON Project Space under "Issues"
Please open one Ticket for Feature-Request/Bug-Report/Support-Request only!

Wiki:http://dev-heaven.net/projects/upsmon/wiki

FAQ
Quote:
To turn of messages and marks on map edit init_upsmon.sqf and set debug to 0

KRON_UPS_Debug = 0;

Changes in version:
Quote:
// Added:
// nowp = No waypoints will be created for this squad UNTIL ENEMY DETECTED
// nowp2 = No waypoints will be created for this squad UNTIL ENEMY DETECTED AND DAMAGED
// nowp3 = No waypoints will be created for this squad in any way.
// Ambush2 Same as ambush but without using mines
// Added spawn support for vehicles in squad
// Modified:
// FORTIFY moves leader too and prevents from moving when hurt
// Solved bug in targetting of resistance
// Solved bug when respawning a template squad were creating a new template
// Solved bug that did exiting AI form vehicle when upsmon begins
// Solved bug of squads loosing group and gets stucked
// Avoid to take same position on buildings
This is a personal projet to enhance IA in combat and making easier mission edition. I have used the version 2.0.3 of Urban Patrol Script de Kronzky. I have to congratulate Kromzky for his script UPS.sqf that has inspired me for doing UPSMON.

With upsmon I don´t need to put any waypoints. My work area is in CHS Comunity so I will be pleased to meet you there

http://www.simulacion-esp.com/v3/top...87&#entry60687


//AI improvements
* There is a General commander that organize the attack and defence of all UPSMON squads in the same side:
o Squads of AI fights together as an army, so they comunicate each other by radio the enemy known positions.
o flanking manauvers are taken depending on friendly position.
o General commander can order to surrender entire side if army is seriously damaged
* AI has enhanced actions and movements in combat:
o AI can use smoke grenades.
o AI run crouched when enemy is near or under fire.
o AI does fire suppression and squad movement can be supressed by fire too.
o AI moves are influenced by morale, so in low morale they can retreat.
o AI can lay mines if enemy tanks are near.
o AI avoid snipers when fired by uknown enemy.
o AI paratroop near objectives if they take an hely.
* AI take use of enviroment:
o AI may use static weapons you place on map.
o AI may use empty land vehicles for moving and or to attack.
o AI may use empty helys for moving and or to attack.
o AI uses buildings to take defence position and patrol them when leader thinks than enemy is near or using it.

// Performance
UPSMON Script runs 1 time every 20 seconds for every group of IA, new movements calculates every 60 s or less depending of under fire, enemy knowns...
I have been implementing some functions in spawn mode to exploit the multithread of processors with very fast results.

UPSMON has been tested in CHS comunity with more than 30 people and more than 25 groups of IA with UPSMON and the conclusion was perfect performance.

//Download
Dev-heaven


//Installation
Copy folder "scripts" into your folder mission.

//How to Implement
In init.sqf you need to load init_upsmon.sqf
Code:
//Init UPSMON scritp
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";
In the mission editor run UPSMON script in the lider of each group exec UPSMON, sample:
Code:
nul=[this,"town", "move","reinforcement", "delete:",600] execVM "scripts\upsmon.sqf";
//Global variables of Init_UPSMON.sqf
Code:
//1=Enable or 0=disable debug. in debug could see a mark positioning de leader and another mark of the destinity of movement, very useful for editing mision
KRON_UPS_Debug = 1;

//Time that lider wait until doing another movement, this time reduced dinamically under fire, and on new targets
KRON_UPS_react = 60;

//Min time to wait for doing another reaction
KRON_UPS_minreact = 30;

//Max waiting is the maximum time patrol groups will wait when arrived to target for doing another target.
KRON_UPS_maxwaiting = 30;

// how long AI units should be in alert mode after initially spotting an enemy
KRON_UPS_alerttime = 90;

// how far opfors should move away if they're under attack
KRON_UPS_safedist = 300;

// how close unit has to be to target to generate a new one target or to enter stealth mode
KRON_UPS_closeenough = 300;

// how close units have to be to each other to share information, over this, will lose target
KRON_UPS_sharedist = 800;

//If enabled IA comunicating between them with radio defined sharedist distance, 
KRON_UPS_comradio = 2;

//Sides that are enemies of resistance
KRON_UPS_Res_enemy = [east];

//Frequency for doin calculations for each squad.
KRON_UPS_Cycle = 20;

//Height that heli will fly this input will be randomiced in a 10%
KRON_UPS_flyInHeight = 100;

//Max distance to target for doing paradrop, will be randomiced between 0 and 100% of this value.
KRON_UPS_paradropdist = 250;

//Enables or disables AI to use static weapons
KRON_UPS_useStatics = true;

//Enables or disables AI to put mines if armored enemies near
KRON_UPS_useMines = true;

//Distance from destination for seraching vehicles
KRON_UPS_searchVehicledist = 500;

//Percentage of units to surrender.
KRON_UPS_EAST_SURRENDER = 10;
KRON_UPS_WEST_SURRENDER = 10;
KRON_UPS_GUER_SURRENDER = 15;

//Efective distance for doing perfect ambush (max distance is this x2)
KRON_UPS_ambushdist = 50;

//Enable it to send reinforcements, better done it in a trigger inside your mission.
KRON_UPS_reinforcement = false; 

//Artillery support, better control if set in trigger
KRON_UPS_ARTILLERY_EAST_FIRE = false; //set to true for doing east to fire
KRON_UPS_ARTILLERY_WEST_FIRE = false; //set to true for doing west to fire
KRON_UPS_ARTILLERY_GUER_FIRE = false; //set to true for doing resistance to fire

//Parámeters of UPSMON.sqf
The same as UPS of Kronzky, only new "reinforcement" for allowing a group to go where is called for.

Code:
//  Required parameters:
//    unit        = Unit to patrol area (1st argument)
//    markername  = Name of marker that covers the active area. (2nd argument)
//    (e.g. nul=[this,"town"] execVM "ups.sqf")
//
//  Optional parameters: //    random      = Place unit at random start position.
//    randomdn    = Only use random positions on ground level.
//    randomup    = Only use random positions at top building positions. 
//    min:n/max:n = Create a random number (between min and max) of 'clones'.
//    init:string = Custom init string for created clones.
//    nomove      = Unit will stay at start position until enemy is spotted.
//    nofollow    = Unit will only follow an enemy within the marker area.
//    delete:n    = Delete dead units after 'n' seconds.
//    nowait      = Do not wait at patrol end points.
//    noslow      = Keep default behaviour of unit (don't change to "safe" and "limited").
//    noai        = Don't use enhanced AI for evasive and flanking maneuvers.
//    showmarker  = Display the area marker.
//    trigger     = Display a message when no more units are left in sector.
//    empty:n     = Consider area empty, even if 'n' units are left.
//    track       = Display a position and destination marker for each unit.
//    reinforcement  = Makes squad as reinforcement, when alarm KRON_UPS_reinforcement==true this squad will go where enemy were.
//    reinforcement:x  = Makes squad as reinforcement id, when alarm KRON_UPS_reinforcementx==true this squad will go where enemy were.
//    fortify = makes leader order to take positions on nearly buildings at distance 200 meters, squad fortified moves less than "nomove"
//	spawned = use only with squads created in runtime, this feature will add squad to UPSMON correctly.
//	nowp	= No waypoints will be created for this squad, so this squad will comunicate enemies but will not be moved, so you can do what you want with them using waypoints.
//	ambush	= Ambush squad will not move until in combat, will wait for incoming enemies stealth and ambush when near or discovered.
//	ambush:n	= Creates an anbush and wait maximun the especified time n in seconds. you can put 0 seconds for putting mines and go away if combined with "move" for example
//	aware,combat,stealth,careless defines default behaviour of squad
//	respawn = allow squad to respawn when all members are dead and no targets near
//	respawn:x = allows to define the number of times squad may respawn.
videos of youtube:
5.0.4 Ambush: http://www.youtube.com/watch?v=3n9gPJvh7I0
fortify and reinforcement: http://www.youtube.com/watch?v=fhobs...layer_embedded
Getin: http://www.youtube.com/watch?v=J73DIfbyjhw
Building Patrol: http://www.youtube.com/watch?v=JIYvsckQcRA
paradrop: http://www.youtube.com/watch?v=gJOvX1lENH8
combat: http://www.youtube.com/watch?v=PhbqlLRvchc

Last edited by Monsada; 04-21-2010 at 07:13 PM. Reason: Change version to 5.0.7
Monsada is offline   Reply With Quote
Old 12-11-2009, 01:09 PM   #2
MattXR
First Lieutenant
 
MattXR's Avatar
 
Join Date: Jan 2005
Location: United Kingdom
Posts: 5,839
very cool!
__________________



Coming Soon for OA: Desert Stronghold, Desert Rats, Desert Rats II, Desert Wolves, Desert Dogs
MattXR is offline   Reply With Quote
Old 12-12-2009, 02:11 AM   #3
mr.g-c
Warrant Officer
 
mr.g-c's Avatar
 
Join Date: Jan 2007
Location: Germany
Posts: 2,133
Amazing, sounds very cool.... will try it out for sure!
__________________
Marek Spanel: [...] Every single element is well taught so that it fits together. So this is a significant change, because with ArmA 1 it was just random, really.
We made some units because we had to. There wasn't much passion from our side with the first ArmA, to be honest. This time it's different. (Videogamer.com Interview

Please BIS: Arma2 must become a TRUE MASTERPIECE - Not a middle-heavy catastrophe!
mr.g-c is offline   Reply With Quote
Old 12-12-2009, 10:22 AM   #4
Cyborg11
Staff Sergeant
 
Cyborg11's Avatar
 
Join Date: Jun 2009
Location: Germany
Posts: 258
Thanks! The new reinforcement parameter is very very nice :>
And its cool that the AI uses vehicles if they are called for reinforcement

But one question: Do I have to give the reinforcement troop a patrol marker also?
Cyborg11 is offline   Reply With Quote
Old 01-08-2010, 02:44 AM   #5
Splicer
Sergeant
 
Splicer's Avatar
 
Join Date: Dec 2009
Location: USA
Posts: 198
Quote:
Originally Posted by Monsada View Post
Versión 4.1.1

In the mission editor run UPSMON script in the lider of each group exec UPSMON, sample:
Code:
nul=[this,"town", "move","reinforcement", "delete:",600] execVM "scripts\upsmon.sqf";
Hi Monsada,

Excellent script! I have tried it in a SP mission I'm creating and it is AWESOME!

One questions though.

I'm creating a lot of squads and teams, and it occurred to me that instead of having to read and execute the upsmon script (execVM "scripts\upsmon.sqf"), it would be more efficient to use either the call or spawn command to do so.

So in the init.sqf script I added the following code:

MyPatrol = compile preprocessFile "scripts\upsmon.sqf"

and in the leader use the following code:

nul=[this,"town", "move","reinforcement", "delete:",600] spwan MyPatrol;


However, so far this doesn't work. It only works using execVM "scripts\upsmon.sqf"

Could you or anybody give me a hand here and tell me what I am missing/doing wrong?

Thanks much. Splicer.
__________________
"We must either find a way or make one."
- Hannibal
Splicer is offline   Reply With Quote
Old 01-08-2010, 03:27 AM   #6
Inkompetent
Sergeant Major
 
Inkompetent's Avatar
 
Join Date: Mar 2007
Location: Sweden
Posts: 1,820
Unit init lines are run before init.sqf afaik, which means that a script precompiled in init.sqf won't be compiled when you try to spawn it.

Just name the leaders of the squads, like "cityPat1" and then run the script from init.sqf by nul=[cityPat1,"town","move","reinforcement","delete",60 0] spawn MyPatrol;
__________________



INKO Simple Firing Script (Mission script)
INKO Disposable v1.2 (Addon)
Inkompetent is offline   Reply With Quote
Old 01-08-2010, 04:30 AM   #7
Splicer
Sergeant
 
Splicer's Avatar
 
Join Date: Dec 2009
Location: USA
Posts: 198
Quote:
Originally Posted by Inkompetent View Post
Unit init lines are run before init.sqf afaik, which means that a script precompiled in init.sqf won't be compiled when you try to spawn it.

Just name the leaders of the squads, like "cityPat1" and then run the script from init.sqf by nul=[cityPat1,"town","move","reinforcement","delete",60 0] spawn MyPatrol;
Hi Inkompetent,

Thanks for that intel. Since it is not 100% clear that unit's init lines will be processed before the mission's init.sqf, I wonder if it would be possible to compile and load the script by placing a game logic in the map?

And if so, what code line would you enter in the game logic?

The point is to avoid the overhead of having to have a list of all units to be used in the mission.

Thanks much. Best, Splicer.
__________________
"We must either find a way or make one."
- Hannibal

Last edited by Splicer; 01-08-2010 at 05:31 PM. Reason: Mention "overhead".
Splicer is offline   Reply With Quote
Old 01-13-2010, 06:13 PM   #8
Manzilla
Second Lieutenant
 
Manzilla's Avatar
 
Join Date: May 2007
Location: In the lab cooking up some serious s#%t!
Posts: 4,410
Where is this? The links give me some spanish message boaed with nothing there.
__________________
(God damn bananas..... again)

Join the most rootin', tootin'est crew on these here forums! That's right folks we're darn tootin'.

Mike Tyson's ode to Manzilla's SP playing style:
Quote:
My style is impetuous. My defense is impregnable and I'm just ferocious.... I want your heart, I want to eat his children! Praise be to Allah!
Manzilla is offline   Reply With Quote
Old 01-13-2010, 06:23 PM   #9
Roe[31stMEU]
Sergeant
 
Join Date: Jun 2009
Posts: 118
Same here, I cant really sign up or navigate there since I don't know spanish, anyone able to put up a mirror if the creator will allow it? Thanks
__________________
Roe[31stMEU] is offline   Reply With Quote
Old 01-13-2010, 09:36 PM   #10
Splicer
Sergeant
 
Splicer's Avatar
 
Join Date: Dec 2009
Location: USA
Posts: 198
Hmm... Just checked and the links don't work anymore.

Bummer. I speak Spanish. I'll try to get a hold of Monsada to find out if a new hyperlink could be provided or get an official "blessing" about placing/mirroring his script somewhere else.

Hey Monsada , que paso con los links de tu script?

Splicer.
__________________
"We must either find a way or make one."
- Hannibal
Splicer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:34 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.