Home   Help Search Login Register  

Author Topic: whole army fleeing  (Read 2309 times)

0 Members and 1 Guest are viewing this topic.

Offline M!StAkE id11479

  • Members
  • *
whole army fleeing
« on: 16 Mar 2009, 04:21:48 »
Hi all,
i maked an easy no addons map with defense for guerilla vs US army, the last thing i need is making the whole attack stopped by a condition, i want all troops attacking fleeing when they are under a certain number of survivors... I look in the forum since 2 days and i had find some answers but for make what i want exactly i dont get it, i tried different possibilitys and now as no one work im confused lol

My last try is with 3 censors :

- one who have for condition the ennemy number under 100 and on activation FLE=true (this censor work perfectly, he give "FLE" when needed)
- one censor have for condition FLE and in activation : infsquad1 setcombatmode"blue";armorsquad1 setcombat"blue" etc etc for each groups...
- another censor with same condition than the first and in activation {_x allowfleeing 0} foreach thislist (set on "west / présent" in the censor perimeter taking all west units).

...it dont work!  :dunno:
Maybe somebody have a classic formula for help me?

I have another problem but easy to solve : there are no one body remover script in ofpec (for arma yes), where can i find a good one?
« Last Edit: 16 Mar 2009, 10:24:53 by M!StAkE id11479 »

Offline dr. seltsam

  • Members
  • *
Re: whole army fleeing
« Reply #1 on: 16 Mar 2009, 10:27:07 »
I would try it with switch triggers...

Place a trigger on the field (radius 0,0), set it to type "switch", write under condition: FLE
Now we have your combat groups. They may have cycle waypoints, guard waypoints, etc.

Give them new waypoints (after their last one) for fleeing away from the combatzone, connect all the last old waypoints with your switch trigger.

When the condition is met, the switch trigger let all the connected groups jump over their current waypoint to the first new waypoint. You can use certain types of combatmode and behaviour settings there.

It is possible to have subsequent switch triggers in a row. It may is possible that you can jump over other switch triggers, and i guess that you can backswitch to older waypoints...

Try, and tell us how it works.

:)

Edit: connect all the last old waypoints to the switch trigger
« Last Edit: 16 Mar 2009, 12:38:53 by dr. seltsam »

Offline M!StAkE id11479

  • Members
  • *
Re: whole army fleeing
« Reply #2 on: 16 Mar 2009, 22:47:39 »
Hi and thanks for your time   :)

The prob with your idea is that the groups need to reach their last way point before fleeing, and if some have not when some have already do it then not everybody will fleeing in same time...
I think its possible to do without probs with a marker to join and a censor for give the order, ill look for it now, but im sad cause im sure that a classic script exist for it!
And about a body remover script? Anyone got it please? (i have read again that there are one in ofpec Editor Depot, but i see only one for arma, no one for ofp  :( )
« Last Edit: 17 Mar 2009, 08:11:35 by M!StAkE id11479 »

Offline ProfTournesol

  • Members
  • *
  • OFP Addict
Re: whole army fleeing
« Reply #3 on: 18 Mar 2009, 20:55:27 »
Hi,

your third trigger cannot work because "_x allowfleeing 0" means maximum courage, so it provides units from fleeing...you should use "_x allowfleeing 1" instead. It won't make units fleeing immediately (there is no such command...) but it will set the probability of fleeing to its maximum.

About deleting bodies script, there a very nice one done by ChaosStudios, i post it here, you'll have to copy and paste it, and name it "Chsbrs.sqs".

Code: [Select]
;------------------------------------------------------------------;
;--- Scripted by Chaos --- for Operation Flashpoint RESISTANCE ----;
;-------------------------- in February 2006 ----------------------;
;------------------------------------------------------------------;
;------------------------------------- http://www.ofpmdb.net ------;
;------------------------------------------------------------------;
; Information:
; Einheit            = Einheit (Initzeile) oder Name der Einheit (script). Bei Gruppen ist es nur der
;                      Anführer in deren Initzeile ober über dessen Namen das Script auszulösen ist !
; Zeit               = Schalter - 1 für kurz - 90 sek. max., 2 mittel - 300 sek, 3 für lange (über 600 sek.).
; Animationsdistanz  = bei welcher Entfernung vom Spieler soll das Script die Animationen ausfürhen ?
;                      Schalter 1 für nah (bis 75 Metern), 2 für weit (bis 150 Metern), 3 sehr weit
;                      (bis zu 300 Meter). Dabei ist 1 am besten für dicht bebautes oder zugewachsenes
;                      Gebiet und 3 für Kampf aus Stellungen bei großer Sichtweite am besten.
; Distanz            =  ab welcher Entfernung vom Spieler kann die Einheit gleich gelöscht werden ?
;
; Syntax: 
; [this,1,2,600] exec "Chsbrs.sqs"
; [Einheit,Zeit,Animationsdistanz,Distanz] exec "Chsbrs.sqs"
;

_t = _this select 0
_l = _this select 1
_d = _this select 2
_deR = 0
? (count _this > 2) : _e = _this select 3; _deR = 1

? _l == 1 : _l1a = 15; _l1b = 15; _l2a = 35; _l2b = 15; _l3a = 25; _l3b = 15
? _l == 2 : _l1a = 75; _l1b = 40; _l2a = 65; _l2b = 25; _l3a = 80; _l3b = 15
? _l == 3 : _l1a = 115; _l1b = 75; _l2a = 95; _l2b = 55; _l3a = 145; _l3b = 115

? _d == 1 : _d1 = 25; _d2 = 35; _d3 = 55; _d4 = 75
? _d == 2 : _d1 = 55; _d2 = 95; _d3 = 125; _d4 = 150
? _d == 3 : _d1 = 145; _d2 = 205; _d3 = 265; _d4 = 315

_grp = group _t
_n = 0

~.5
? _t != leader _grp : goTo "nxt"

#loopX
_men = units _grp select _n
? _deR == 1 && _men != leader group _t : [_men,_l,_d,_e] exec "Chsbrs.sqs"
? _deR != 1 && _men != leader group _t : [_men,_l,_d] exec "Chsbrs.sqs"
~1
_n = _n + 1
? _n >= count units _grp : goTo "nxt"
goto "loopx"

#nxt
@ !alive _t
~3
? _deR == 1 && _t distance player > _e : goTo "deleting"
_x = getPos _t select 0
_y = getPos _t select 1
_z = getPos _t select 2
_dir = getDir _t
? getPos _t select 2 > .05 : exit

~_l1a+random _l1b
@ player distance _t > _d1

#loopy
_t setPos [(_x),(_y),(_z)]
_z = _z -.001
~.001
? _z > -.4 : goTo "loopy"

? _deR == 1 && _t distance player > _e : goTo "deleting"

_grab="Body" camcreate [(_x),(_y),(_z)-.39]
_grab setDir _dir+90
_grab setPos [(getPos _t select 0),(getPos _t select 1),(getPos _t select 2)]
deletevehicle _t

#loop0
_grab setPos [(_x),(_y),(_z)]
_z = _z +.001
~.001
? _z < -.0018 : goTo "loop0"

~_l2a+random _l2b
@ player distance _grab > _d2

? _deR == 1 && _grab distance player > _e : goTo "deleting"

#loop1
_grab setPos [(_x),(_y),(_z)]
_z = _z -.001
~.001
? _z > -.4 : goTo "loop1"

? _deR == 1 && _grab distance player > _e : goTo "deleting"

deletevehicle _grab
~.01
_grab="Grave" camcreate [(_x),(_y),(_z)-.39]
_grab setDir _dir+180

@ player distance _grab > _d3

#loop2
_grab setPos [(_x),(_y),(_z)]
_z = _z +.001
~.001
? _z < -.02 : goTo "loop2"

? _deR == 1 && _grab distance player > _e : goTo "deleting"

~_l3a+random _l3b
@ player distance _grab > _d4

#loop3
_grab setPos [(_x),(_y),(_z)]
_z = _z -.001
~.001
? _z > -.4 : goTo "loop3"

#deleting
~10
_x = getPos _t select 0
_y = getPos _t select 1
_z = getPos _t select 2
_dir = getDir _t
~.1
deletevehicle _grab

#loopEND
_t setPos [(_x),(_y),(_z)]
_z = _z -.001
~.001
? _z > -.35 : goTo "loopEND"

deletevehicle _t

Here's part of the readme in english :
Code: [Select]
Copy this line into the Init - Line of the units that shall disappear
[this,1,2,600] exec "ChsBRS.sqs"

Of course you have to copy the script into the mission folder.

The script waits a few seconds and replaces the bodies by bodies wrapped in a sheet - while this happens
the object is coming out of the earth till it reached te height of the corpse; after some time this object
dissappears as well and a tomb is shown. After a long break this tomb also dissappears. 


 Information:
 unit = Unit you write the line given above in or unitname (in case you start it via script). Bei Gruppen
        ist es nur der Anführer in deren Initzeile ober über dessen Namen das Script auszulösen ist !

 time = trigger - "1" for short times - 90 Seconds maximum, "2" for medium times - to 300 Seconds,
         "3" for long times ca. 600 seconds.
 animdistance = On which distance to the player shall the script be executed ?
                Trigger 1 for near (> 75 Meters), 2 for far(> 150 Meters), 3 very far
                (> 300 Meters). You use 1 the best for urban and jungle terrain and 3 for places wih a
                great view distance.
 distance = On which distance from the player shuld the unit be deleted ?  You don't need to do this
            if you don't want - it is optional.

 Example: 
 [this,1,2,600] exec "ChsBRS.sqs"
 [unit,time,anidistance,distance] exec "ChsBRS.sqs"

Units in vehicles and turrets etc will be automatically excluded from the script.
OFP Napoleonic Mod leader - OFP WW1 Mod leader

Offline M!StAkE id11479

  • Members
  • *
Re: whole army fleeing
« Reply #4 on: 19 Mar 2009, 00:56:09 »
Hi ProfTournesol,
i was wrong for allowfleeing 0, i meaned 1 of curse (as i got one with fleeing 0 for start i was confused and maked a misunderstanding)...
For the script you give me i think its the same that we see in ED for Arma, then it work for ofp too i guess, but the prob is that i dont want the tombs!
I want only body (not vehicles) removing as lot of missions coops have but i cant remember or find one with it in :(
Maybe its easy to remove the tombs part? If yes what i have to erase or change?
That part? :

deletevehicle _grab
~.01
_grab="Grave" camcreate [(_x),(_y),(_z)-.39]
_grab setDir _dir+180
« Last Edit: 19 Mar 2009, 01:01:13 by M!StAkE id11479 »

Walter_E_Kurtz

  • Guest
Re: whole army fleeing
« Reply #5 on: 19 Mar 2009, 02:36:12 »
The script ProfTournesol provided would need more editing than that, because covered corpses appear and disappear.

Why not use a "killed" eventHandler?

In the init line for a single unit:
this addEventHandler ["killed", {_this exec "deaddude.sqs"}]

for a group:
morituri = group this; {_x addEventHandler ["killed", {_this exec "deaddude.sqs"}]} forEach units morituri

I wouldn't recommend adding it to every unit, as I assume you want to leave evidence that a battle has taken place and maybe the opportunity for the player to rearm.

Then deaddude.sqs:
Code: [Select]
_corpse = _this select 0

~120    <--- time in seconds that corpses are set to remain

@player distance _corpse > 300   <--- distance in metres player has to be away for body to be removed

deleteVehicle _corpse

exit

You could have a number of these scripts running under different names with different delay times (or distances), just make sure you update the path defined in the eventHandler.

Since these scripts are going to be running on an attacking force (who are assaulting a fixed position), I suggest you set the distance as the average kill point up 'til now - thus the bodies of anyone getting closer will remain, to remind the player how close the enemy has gotten. If the enemy are attacking in waves, make the distance for early waves lower - so that fewer of their bodies remain.
« Last Edit: 19 Mar 2009, 03:30:53 by Walter_E_Kurtz »

Offline M!StAkE id11479

  • Members
  • *
Re: whole army fleeing
« Reply #6 on: 19 Mar 2009, 07:38:28 »
Thanks Walter!
It work fine exactly as i want now... :clap:
Thanks anyway too profTournesol, your script will serve me a day, the tombs stuff are fun but not for the map i maked now...
If somebody want my mission ask for it in private*
"co 3-24 ONE STEP IN HELL", no addons.
You play guerilla vs US advance in Nogova NW mountain road, the map looks easy to make but its not so, i needed big hours for calculate angles and making coherent and well synchronised attacks, plus making special protections for tanks and machineguns, or setting weapons/objects... It use spectator script by Kegetys.
Long life to Ofpec! :D
« Last Edit: 19 Mar 2009, 07:40:06 by M!StAkE id11479 »