Jump to content
nikiller

Nikiller's scripts pack

Recommended Posts

NIKILLER'S SCRIPTS PACK

hi,

There's quite some time that I am scripting/editing for my own missions or for the others. Then I decided to publicly release my or other autors's scripts modified/recoded by me. I will try to be clearer as possible to explain how to install stuffs in your missions but if you have questions I will gladly answer it. I will ignore all editing questions not related to the topic like how I activate a trigger and so on. Please keep it clean for the others, thanks to understand it.

The community can participate by making scripts requests or by giving opinion.

NB: I always use nik_host for local server and nik_client for local player in order to avoid local server and local player repetition in each scripts. Like that it saves a bit performance. Don't forget to define those variables at start of the init.sqs with nik_host=local server and nik_client=local player or some scripts will not work.

I will organize scripts in differents categories (FX, AI, vehicle, misc, mission test...) to easily find what you need. I will modify this list if needed.

IMPORTANT: I will update scripts if bugs are found or if suggestions are made then be sure to have the last version.

Categories list

- FX:

Fire efect

Blood effect

Dynamic weather

Force AA to fire

Force Mg fire D-day style

Force tank to fire in defined area

Random voices

Voice "reloading!"

Controled chopper crash

- AI:

AI crouch

Spawn squad

Spawn squad UPS

Random set pos inside building

Random set face

AI kidnap player

- Player:

Firstaid kit

Friendly fire

Increase/decrease projectile speed

- Weapon:

WW4 HD conversion

- Vehicle:

- Performance:

Delete dead bodies

Delete destroyed vehicle

Delete trigger

- Miscellaneous:

Minefield

- Mission test:

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

hey u really share this treasury? ;)

:yay::yay::yay: and when?

PS: are MadMax' scripts in it?

Share this post


Link to post
Share on other sites

hi,

I start with a modified version of BAS fire effect script.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Mad Max and Nikiller

Credits: all credits go to BAS team

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script will replace BIS fire effect by a new one (fire and smoke particules + random explosions)

installation: put the fx folder in your mission folder, place a game logic named server somewhere on the map, give the vehicle a name and write in the vehicle init field or in the init.sqs vehicleName exec "fx\fire_effect\Check.sqs"

Note: for performance purpose I strongly recommand to make an array to define the vehicles name (i.e nik_bmp=[eastbmp1,eastbmp2,eastbmp3]) in the init.sqs

Note2: If you use the WW4modpack 2.5 don't forget to put the WW4 game logic to disable fire effect.

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_host=local server
nik_client=local player
nik_bmp=[EastBmp1,EastBmp2,EastBmp3]

;-----------------------------------------------------------------------------------------
; fire effect
;-----------------------------------------------------------------------------------------
{_x exec "fx\fire_effect\Check.sqs"} forEach nik_bmp

exit

Check.sqs

; Check modified by Nikiller

_v=_this
_d=1+random 2
~_d

# W
~1
? alive _v: goto "W"
? nik_host: _v exec "fx\fire_effect\RandomExp.sqs"
? nik_client: [_v,160] exec "fx\fire_effect\FireSmoke.sqs"
exit

RandonExp.sqs

; *****************************************************
; ** Bombs
; *****************************************************

_u=_this
~0.1
_p=getpos _u; {_b=_x createVehicle _p} foreach ["shell120","heat120"]
? fx_norandomexplosions : exit
~3
_max=50+random 30
_z=0
# Loop
~2
if (random 1 > 0.94) then {_p=getpos _u; {_b=_x createVehicle _p} foreach ["mortarshell","grenadehand","heat120"]}
_z=_z+1
? _z<_max : goto "Loop"
exit

FireSmoke.sqs

; FireSmoke

_v=_this select 0
_t=_this select 1
~3
_t2=_time+_t
_cr=true
# Loop
~0.25
_ra=random 0.1
_rc=random 0.1
_r1=random 2
_r2=random 24
_rt=random 16
drop ["cl_fire","","Billboard",1,1.2+random 0.4,[-1+random 2,-1+random 2,-2],[-0.4+random 0.8,-0.4+random 0.8,0.4+random 0.4],1,0.005,0.004,0.038,[2+_r1,3+_r1,4+_r1*2],[[0.9,0.5+_rc,0.5+_rc,0],[0.2+_rc,0.2+_rc,_rc,0.3+_ra],[0.9,0.9,_rc,0.3+_ra*2],[0.9,0.9,0.3,0]],[0,1],0.5,0.05,"","",_v]
drop ["cl_fire","","Billboard",1,4+random 2,[0,0,-2],[-0.6+random 1.2,-0.6+random 1.2,random 0.4],1,0.005,0.0042,0,[0.12],[[1,1,1,1],[0,0,0,0]],[0,1],0.5,1,"","",_v]
drop ["cl_basic","","Billboard",1,16+_rt,[-1+random 2,-1+random 2,-1],[-0.2+random 0.4,-0.2+random 0.4,0.4+random 0.4],2+random 4,1.12+random 0.08,1,0.036+random 0.008,[2+_r1*2,8+_r2,16+_r2*2,120+_rt*6],[[0.1+_rc,0.1+_rc,0.1+_rc,0],[0.1+_rc,0.1+_rc,0.1+_rc,0.2+random 0.08],[0.1+_rc,0.1+_rc,0.1+_rc,0.18+random 0.04],[0.1+_rc,0.1+_rc,0.1+_rc,0.1+random 0.04],[0.1+_rc,0.1+_rc,0.1+_rc,0]],[0,1],4+random 4,0.8+random 0.8,"","",_v]
? vehicle player == player && player distance _v < 10 : player setdamage ((damage player)+0.025); if _cr then {player exec "fx\fire_effect\Cry.sqs"; _cr=false}
? _time < _t2 : goto "Loop"
~0.75
drop ["cl_fire","","Billboard",1,2,[0,0,0],[-0.3+random 0.6,-0.3+random 0.6,1],2,0.014,0.004,0,[1,3,1],[[0.8,0.6,0.6,0],[0.8,0.6,0.6,0.6],[0.5,0.1,0.1,0.6],[0.01,0.01,0.01,0]],[0,1],1,0,"","",_v]
exit

Cry.sqs

; Cry by Nikiller

_u=_this
~0.3
_u groupchat "Aaaaarrrgh... I AM BURNING !!!"
if (side _u == west) then {_u say "ENG22"}
if (side _u == east) then {_u say "RUS13"}

exit

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

Here's a blood effect script.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Mad Max and Nikiller

Credits: Mad Max and Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script increase BIS blood effect (blood particules). To save performance the blood can be seen if the unit bleeds <500m of the player.

installation: put the fx folder in your mission folder, give the unit a name and write in the unit's init field or in the init.sqs [unitName] exec "fx\blood\blood.sqs" you also have to preprocess a function in the init.sqs (don't worry it's nothing difficult) with nik_fblood = preprocessFile "fx\blood\blood.sqf"

Note: for performance purpose I strongly recommand to make an array to define the units name (i.e nik_east_ai=[e1,e2,e3]) in the init.sqs

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************
nik_east_ai=[e1,e2,e3]

;-----------------------------------------------------------------------------------------
; Blood
;-----------------------------------------------------------------------------------------
nik_fx="player"
nik_fblood = preprocessFile "fx\blood\blood.sqf"
{[_x] exec "fx\blood\blood.sqs"} forEach nik_east_ai

exit

blood.sqf

// Blood

private [{_u},{_m},{_c},{_v},{_a},{_s}];

_u = _this select 0;

_m=12+random 4;
_c=0;

while {_c < _m} do
{
	_v=random 2;
	_a=-90+random 180;
	_s=[random 0.2,random 0.6,random 1];
	drop ["cl_water","","Billboard",1,random 2,[0,0,0.75],[_v*sin _a,_v*cos _a,random 3],0.5,10,0,0,_s,[[random 1,0,0,random 1],[random 1,0,0,random 1],[random 1,0,0,0]],[0],1,0,"","",_u];
	_c=_c+1;
};

true
[/spoiler]

blood.sqs

; *****************************************************
; ** Blood
; *****************************************************

_u = _this select 0

~1

_dis=500

#wait
~3
if (alive _u) then {if (vehicle (call nik_fx) distance _u > _dis) then {goto "wait"}} else {goto "ende"}

_d=damage _u

#fx
@ (damage _u > _d) or (not alive _u)
if (vehicle (call nik_fx) distance _u < _dis) then {[_u] call nik_fblood} else {goto "wait"}
if (alive _u) then {_d=damage _u; goto "fx"}

#ende

exit

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

I think SP/MP dynamic weather script would be useful.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Mad Max and Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script randomly change overcast and rain during the mission. It is MP compatable it means that the weather is synchronized between server and clients.

installation: put the fx folder in your mission folder, place a game logic named server somewhere on the map and write in the init.sqs [minimumChangeDelay,maximumChangeDelay] exec "fx\condition\dynamic_weather.sqs". minimumChangeDelay and maximumChangeDelay mean that the weather will change between this two delay. i.e if I set the script to [300,600] exec "fx\condition\dynamic_weather.sqs" the weather will change beween 5min and 10 min and so on.

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_host=local server
nik_client=local player

;-----------------------------------------------------------------------------------------
; Dynamic weather
;-----------------------------------------------------------------------------------------
[30,60] exec "fx\condition\dynamic_weather.sqs"

exit

dynamic_weather.sqs

;******************************************************************
;Dynamic weather Script by Nikiller v0.9b
;Randomly change the weather during mission
;Note: Place a game logic named server somewhere on the map
;contact: nikillerofp@hotmail.fr
;[minimumChangeDelay,maximumChangeDelay] exec "dynamic_weather.sqs"
;******************************************************************

_min = _this select 0
_max = _this select 1

nik_weather_interval=-1
nik_weather_overcast=-1
nik_weather_rain=-1

;to set the delay in minutes uncomment the 2 next lines
;_min=_min*60
;_max=_max*60

~30

# main
~1
if nik_host then {nik_weather_interval=_min+random (_max-_min); nik_weather_overcast=random 1; nik_weather_rain=random 1; {publicvariable ("nik_weather_"+_x)} forEach ["interval","overcast","rain"]}

# wait1
~3
if ((nik_weather_interval < 0) || (nik_weather_overcast < 0) || (nik_weather_rain < 0)) then {goto "wait1"}
_interval=nik_weather_interval
_overcast=nik_weather_overcast
_rain=nik_weather_rain
~1
_interval setOvercast _overcast
~1
_interval setRain _rain
~1
nik_weather_interval=-1
nik_weather_overcast=-1
nik_weather_rain=-1
if nik_host then {goto "wait2"}
goto "wait1"

# wait2
~_interval
goto "main"
[/spoiler]

Here's a demo to show how it works: DEMO LINK

NB: in the demo I set the delay between 30 and 60 sec to easily see the weather change.

cya.

Nikiller.

Edited by Nikiller
updated dead link

Share this post


Link to post
Share on other sites

hi,

Here's the final version of my heal script.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Mad Max and Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: Give firstaid kit action when the player damage > 0.2

installation: put the player folder in your mission folder and write in the init.sqs [] exec "player\heal\check_dammage.sqs". Don't forget to put a delay before the script execution since I use player value and it may needs a little delay to be defined, 1 second delay should be enough.

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

;-----------------------------------------------------------------------------------------
; Firsaid kit 
;-----------------------------------------------------------------------------------------
~5
nik_heal=false
[] exec "player\heal\check_dammage.sqs"

exit

check_dammage.sqs

;*****************************************************
;FirstAid Script by Nikiller v1.0
;Give action firstaid kit when the player damage > 0.2
;Note: this script is only for player not AI
;contact: nikillerofp@hotmail.fr
;[] exec "scriptName.sqs"
;*****************************************************

#loop
~5
if (alive player) then {} else {exit}
if (getDammage player>0.2) then  {nik_ac_heal = player addaction ["firstaid kit","player\heal\heal.sqs"]; nik_heal=true; goto "wait"}
goto "loop"

#wait
~5
if (alive player) then {} else {exit}
if (nik_heal) then {goto "wait"}
goto "loop"

exit[/spoiler]

heal.sqs

;*****************************************************
;FirstAid Script by Nikiller v1.0
;Give action firstaid kit when the player damage > 0.2
;Note: this script is only for player not AI
;contact: nikillerofp@hotmail.fr
;[unitName] exec "scriptName.sqs"
;*****************************************************

_u = _this select 0

if ((_u != vehicle _u) || !(alive _u)) then  {_u removeAction nik_ac_heal; goto "ende"}

_u removeAction nik_ac_heal
_u action ["HEAL"]

#healing
~1
if (alive _u) then {} else {goto "ende"}
_u setdammage (getdammage _u - 0.1)
if (getdammage _u > 0) then {goto "healing"}

#ende
nik_heal=false

exit[/spoiler]

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

A lot of mission makers are asking if there's a way to make AI crouch in ofp. Here's a script who solve the problem.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: Force AI to be in crouch position

installation: put the ai folder in your mission folder and write in the unit's init field or in the init.sqs [unitName] exec "ai\crouch\crouch.sqs".

Note: for performance purpose I strongly recommand to make an array to define the units name (i.e nik_crouch_ai=[e1,e2,e3]) in the init.sqs

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_crouch_ai=[e1,e2,e3]

;-----------------------------------------------------------------------------------------
; AI crouch
;-----------------------------------------------------------------------------------------
{[_x] exec "ai\crouch\crouch.sqs"} forEach nik_crouch_ai

exit

crouch.sqs

;*****************************************
;Unit Crouch Script by Nikiller v0.9b
;Make a unit in crouch position
;contact: nikillerofp@hotmail.fr
;[unitName] exec "crouch.sqs"
;*****************************************

_u = _this select 0

if (local _u) then {} else {goto "ende"}

if (alive _u) then {_u setUnitPos "UP"; _u setBehaviour "COMBAT"}
_d=2
_a="crouch"

#crouch
~_d
if (canStand _u) then {if (speed _u == 0) then {_u playMove _a}; goto _a}

#ende

exit[/spoiler]

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

This script was written by request. It could be in the vehicles categorie but it's more effect. I suggest to use it in intro/outro or in a plane/chopper insertion/extraction under AA fire. AA will fire in the sky just for effect.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script force AA to fire in the sky.

installation: put the fx folder in your mission folder and write in the unit's init field or in the init.sqs [unitName] exec "fx\force_fire\aa_fire.sqs".

Note: for performance purpose I strongly recommand to make an array to define the vehicles name (i.e nik_shilka=[EastShilka1,EastShilka2,EastShilka3,EastShilka4,EastShilka5,EastShilka6,EastShilka7,EastShilka8]) in the init.sqs

Note2: If you really want that AA blindly fire in the sky without firing on enemy target put _u setCombatMode "BLUE" just after _u setBehaviour "COMBAT"

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_shilka=[EastShilka1,EastShilka2,EastShilka3,EastShilka4,EastShilka5,EastShilka6,EastShilka7,EastShilka8]

;-----------------------------------------------------------------------------------------
; Force AA to fire
;-----------------------------------------------------------------------------------------
{[_x] exec "fx\force_fire\aa_fire.sqs"} forEach nik_shilka

exit

aa_fire.sqs

;********************************************
;AA Fire Script by Nikiller v0.9b
;Force AA to fire in the sky
;Note: This script is for effect purpose only
;contact: nikillerofp@hotmail.fr
;[unitName] exec "aa_fire.sqs"
;********************************************

~1+random 3

_u = _this select 0

if (local _u) then {} else {goto "ende"}

_u setBehaviour "COMBAT"
_g=gunner _u
_m=(magazines (_u) select 0)
_d=0.3

#l
~_d
if ((alive _u) && (alive _g)) then {} else {goto "ende"}
_aim=getPos _u
_ax=_aim select 0
_ay=_aim select 1
_az=_aim select 2
_az=_az+15
_u doWatch [(_ax)-10+random 20,(_ay)-10+random 20,(_az)-5+random 5]
_u fire (weapons (_u) select 0)
if (someAmmo _u) then {goto "l"}

#add
~2
if ((alive _u) && (alive _g)) then {_u removeMagazines _m; _u addMagazine _m; goto "l"}

#ende

exit[/spoiler]

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

This script makes AI say random stuffs. It's very good for mission ambiance since player hear enemy saying stuff (calling a medic, giving orders...). Even unit's lips are moving when it says something. It works for east west and resistance because the script detect which side is the unit. You also can use custom sounds if you want.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script make unit say random stuffs every 40<x<100 sec.

installation: put the fx folder in your mission folder and write in the unit's init field or in the init.sqs [unitName] exec "fx\voice\voice.sqs".

Note: for performance purpose I strongly recommand to make an array to define the unit name (i.e nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]) in the init.sqs

NB: Here's the ofp voices list in case you want to change the voice array.

ofp voices list

ENG1 Bastards!

ENG2 Bastards!

ENG3 Bastards!

ENG4 Commie!

ENG5 Commie!

ENG6 Cover me!

ENG7 Cover me!

ENG8 Die!

ENG9 Die!

ENG10 Die!

ENG11 Don't shoot we're unarmed!

ENG12 Enemy spotted, open fire!

ENG13 Everyone out!

ENG14 Everyone out!

ENG15 Forward!

ENG16 Get out of here!

ENG17 Get out of here!

ENG18 Get to your positions!

ENG19 Get to your positions!

ENG20 Go, go, go!

ENG21 Go, go, go!

ENG22 Help!

ENG23 Help!

ENG24 Hey, what are you doing there?

ENG25 Hey, what are you doing there?

ENG26 Hey, what are you doing there?

ENG27 Let them have it!

ENG28 Let them have it!

ENG29 Look out!

ENG30 Look out!

ENG31 Look out!

ENG32 Medic, I am hit!

ENG33 Medic, I am hit!

ENG34 Medic, I am hit!

ENG35 Sector clear, take it easy

ENG36 Sector clear, take it easy

ENG37 Stay sharp, they're all around us

ENG38 We surrender!

ENG39 We're under attack. Return fire!

ENG40 Who's there?

ENG41 Who's there?

RUS1 American devils

RUS2 Run away, all, run away!

RUS3 Devil's dogs!

RUS4 Damn!

RUS5 Damn!

RUS6 Hey you. What are you doing there?

RUS7 I surrender!

RUS8 Mamo...

RUS9 Don't shoot. We're unarmed

RUS10 Fire!

RUS11 Cease fire

RUS12 Get out!

RUS13 Help!

RUS14 Freeze!

RUS15 Alarm!

RUS16 Vodka!

RUS17 Vodka?

RUS18 Forward!

RUS19 Sector clear

RUS20 Die, bastard!

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_client=local player
nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]

;-----------------------------------------------------------------------------------------
; Voice
;-----------------------------------------------------------------------------------------
{[_x] exec "fx\voice\voice.sqs"} forEach nik_west_ai

exit

voice.sqs

;**********************************************
;Voice Script by Nikiller v0.9b
;Make unit say random stuffs every 40<x<100 sec
;Note: unit is moving lips since say commmand
;contact: nikillerofp@hotmail.fr
;[unitName] exec "scriptName.sqs"
;**********************************************

if nik_client then {} else {goto "ende"}
~1
_u = _this select 0

_vw=call loadFile "fx\voice\voice_west.sqf"
_ve=call loadFile "fx\voice\voice_east.sqf"

? (side _u==west): _v=_vw
? ((side _u==east) or (side _u==resistance)): _v=_ve

_c=count _v

#loop
_d=40+random 60
~_d
if (alive _u) then {_r=random _c; _r=_r-_r mod 1; _u say (_v select _r); goto "loop"}

#ende

exit

voice_east.sqf

[

"RUS1",
"RUS2",
"RUS3",
"RUS4",
"RUS5",
"RUS6",
"RUS7",
"RUS8",
"RUS9",
"RUS10",
"RUS11",
"RUS12",
"RUS13",
"RUS14",
"RUS15",
"RUS16",
"RUS17",
"RUS18",
"RUS19",
"RUS20"

]

voice_west.sqf

[

"ENG1",
"ENG2",
"ENG3",
"ENG4",
"ENG5",
"ENG6",
"ENG7",
"ENG8",
"ENG9",
"ENG10",
"ENG11",
"ENG12",
"ENG13",
"ENG14",
"ENG15",
"ENG16",
"ENG17",
"ENG18",
"ENG19",
"ENG20",
"ENG21",
"ENG22",
"ENG23",
"ENG24",
"ENG25",
"ENG26",
"ENG27",
"ENG28",
"ENG29",
"ENG30",
"ENG31",
"ENG32",
"ENG33",
"ENG34",
"ENG35",
"ENG36",
"ENG37",
"ENG38",
"ENG39",
"ENG40"

]

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

This script equip WW4mod 2.5 units with HD mags and AI HD mags switch to regular mags when picked up by player. It's very good if you want longer firefight with AI or avoid head shot from nowhere. Moreover, you can now set WW4 AI skill to 1 without facing terminator, it means that you will profite by full WW4 AI potential (good tactics, nice spoting range...) without one shot=head shot inconvenience. This script was originaly made by Fox2 and sqf'ed, simplified by Mad Max. I just coded the rearm script. It can be adapted to JAM or any HD mags addons.

I suggest you to try the demo even if you are not interested by mission editing. IMHO it taking WW4 AI to the next level.

Addon needed: WW4 modpack 2.5

Addon suggested: WW4 modpack 2.5 sound replacement mod

Version: 1.0

By: Nikiller and Mad Max

Credits: Fox2, Mad Max and Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script switch AI's HD mags to regular mags when picked up by player.

installation: put the equip folder in your mission folder and write in the unit's init field or in the init.sqs [unitName] exec "equip\eq_ai_hd\eq_east_airborne_hd.sqs". (the script call is just an example)

Note: for performance purpose I strongly recommand to make an array to define the unit name (i.e nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]) in the init.sqs

NB: For space reason (and since I am too lazy) I will not copy and paste all WW4 factions rearm scripts in this post. I will just cover east army and west army. You can find all WW4 factions rearm scripts in the demo. Pick what you need and delete the rest (i.e if you make a mission with east mercenary and west insurgency, keep only eq_east_mercenary_hd.sqs and eq_west_insurgency_hd.sqs)

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12]
nik_east_ai=[e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12]

;-----------------------------------------------------------------------------------------
; HD converter
;-----------------------------------------------------------------------------------------
eq_convert=[call loadFile "equip\convert_hd\mags.sqf",call loadFile "equip\convert_hd\mags_hd.sqf"]
eq_count=count (eq_convert select 0)
eq_index=preprocessFile "equip\convert_hd\index.sqf"
{[_x] exec "equip\eq_ai_hd\eq_east_army_hd.sqs"} forEach nik_east_ai
{[_x] exec "equip\eq_ai_hd\eq_west_army_hd.sqs"} forEach nik_west_ai

exit

equip folder

convert_hd folder

equip_ai.sqs

; *****************************************************
; ** equip_ai
; *****************************************************

_u=_this select 0
_a=_this select 1
_b=_this select 2
~1
_w=weapons _u
_m=magazines _u
{_u removeMagazine _x} foreach _m
{_u removeWeapon _x} foreach _w
~1
_c=count _m
_i=0
while {_i < _c} do {_r=[_a,_m select _i] call eq_index; if (_r >= 0) then {_m set [_i,eq_convert select _b select _r]}; _i=_i+1}
{_u addMagazine _x} foreach _m
{_u addWeapon _x} foreach _w
_p=_w select 0
if (alive _u) then {_u selectWeapon _p}
exit[/spoiler]

index.sqf

// Index

private [{_n},{_m},{_a},{_s},{_i},{_j}];

_n=_this select 0;
_m=_this select 1;

_a=eq_convert select _n;
_s=true;
_i=-1;
_j=0;
while {_s and _j < eq_count} do
{
	if (_m == _a select _j) then
		{
			_i=_j;
			_s=false;
		};
	_j=_j+1;
};

_i[/spoiler]

mags.sqf

[

"WW4_W556_30Bmag",
"WW4_WLR30mag",
"WW4_W556_30mag",
"WW4_W556_30BSDmag",
"WW4_WLR30SDmag",
"WW4_W556_30SDmag",
"WW4_MP5SAmag",
"WW4_MP5SASDmag",
"WW4_W556M_200mag",
"WW4_W556M_200SDmag",
"WW4_W762M_200mag",
"WW4_W762Sniper_5mag",
"WW4_W762Sniper_20SDmag",
"WW4_W127_10mag",
"WW4_E545_30mag",
"WW4_ELR_30mag",
"WW4_E9x39_20mag",
"WW4_E545_30SDmag",
"WW4_ELR_30SDmag",
"WW4_E9x39_20SDmag",
"WW4_E545M_75mag",
"WW4_E545M_75SDmag",
"WW4_E762M_200mag",
"WW4_E762_10mag",
"WW4_E127_10mag",
"WW4_W762_20mag",
"WW4_W762_20SDmag",
"WW4_E762_30mag",
"WW4_E762_30SDmag",
"WW4_E762M_40mag"

][/spoiler]

mags_hd.sqf

[

"WW4_W556_30BHDmag",
"WW4_WLR30HDmag",
"WW4_W556_30HDmag",
"WW4_W556_30BSDHDmag",
"WW4_WLR30SDHDmag",
"WW4_W556_30SDHDmag",
"WW4_MP5SAHDmag",
"WW4_MP5SASDHDmag",
"WW4_W556M_200HDmag",
"WW4_W556M_200SDHDmag",
"WW4_W762M_200HDmag",
"WW4_W762Sniper_5HDmag",
"WW4_W762Sniper_20SDHDmag",
"WW4_W127_10HDmag",
"WW4_E545_30HDmag",
"WW4_ELR_30HDmag",
"WW4_E9x39_20HDmag",
"WW4_E545_30SDHDmag",
"WW4_ELR_30SDHDmag",
"WW4_E9x39_20SDHDmag",
"WW4_E545M_75HDmag",
"WW4_E545M_75SDHDmag",
"WW4_E762M_200HDmag",
"WW4_E762_10HDmag",
"WW4_E127_10HDmag",
"WW4_W762_20HDmag",
"WW4_W762_20SDHDmag",
"WW4_E762_30HDmag",
"WW4_E762_30SDHDmag",
"WW4_E762M_40HDmag"

]

eq_ai_hd folder

eq_east_army_hd.sqs

;*************************************************
;WW4mod Rearm HD Script by Nikiller v0.9b 
;contact: nikillerofp@hotmail.fr
;[unitName] exec "scriptName.sqs"
;*************************************************
_u = _this select 0

if (local _u) then {} else {goto "ende"}

_m = magazines _u
_w = weapons _u
_r = "rearm"

{_u removeMagazine _x} foreach _m
{_u removeWeapon _x} foreach _w

;****************************************
;Weapons
;****************************************
_ak74mpso      = "WW4_AK74MPSO"
_ak74mkobra    = "WW4_AK74MKobra"
_ak74mkobragp25= "ww4_AK74MKobraGP25"
_ak74mkobrasd  = "WW4_AK74MKobraSD"
_rpk74kobra    = "ww4_RPK74Kobra"
_pkm           = "WW4_PKM"
_svd           = "ww4_SVD"
_v94           = "WW4_V94"
_rpg           = "WW4_RPGLauncher"
_at4           = "WW4_AT4Launcher"
_vympel        = "WW4_VympelLauncher"
_aa            = "9K32Launcher"


;****************************************
;Magazines
;****************************************
_ak74m  = "WW4_E545_30HDmag"
_elr    = "WW4_ELR_30HDmag"
_ak74msd= "WW4_E545_30SDHDmag"
_rpk74m = "WW4_E545M_75HDmag"
_pkmm   = "WW4_E762M_200HDmag"
_svdm   = "WW4_E762_10HDmag"
_v94m   = "WW4_E127_10HDmag"
_gren   = "WW4_VOG25grenade"
_vest   = "WW4_VOG25Vest"
_rpgm   = "WW4_RPGLauncher"
_at4m   = "WW4_AT4Launcher"
_vympelm= "WW4_VympelMag"
_he     = "HandGrenade"
_smoke  = "SmokeShell"
_bomb   = "PipeBomb"
_mine   = "Mine"

;****************************************
;Equipment
;****************************************
_bino= "Binocular"
_nvg = "NVGoggles"

_m = []
_w = []

_typeof = typeof _u
goto _typeof

;hint "Error: unit(s) you are trying to rearm is not covered by this script"

;****************************************
;East Woodland Army
;****************************************
#WW4_MOTRifleman
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_he,_he]
_w = [_ak74mkobra,_nvg]
goto _r

#WW4_MOTGrenadier
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_vest]
_w = [_ak74mkobragp25,_nvg]
goto _r

#WW4_MOTMedic
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_he,_he]
_w = [_ak74mkobra,_nvg]
goto _r

#WW4_MOTAutorifleman
_m = [_rpk74m,_rpk74m,_rpk74m,_rpk74m,_rpk74m]
_w = [_rpk74kobra,_nvg]
goto _r

#WW4_MOTMachinegun
_m = [_pkmm,_pkmm,_pkmm,_pkmm,_pkmm]
_w = [_pkm,_nvg]
goto _r

#WW4_MOTRocket
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_rpgm,_rpgm,_rpgm]
_w = [_ak74mkobra,_rpg,_nvg]
goto _r

#WW4_MOTAT
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_at4m]
_w = [_ak74mkobra,_at4,_nvg]
goto _r

#WW4_MOTATH
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_vympelm]
_w = [_ak74mkobra,_vympel,_nvg]
goto _r

#WW4_MOTAA
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_aam]
_w = [_ak74mkobra,_aa,_nvg]
goto _r

#WW4_MOTMarksman
_m = [_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm]
_w = [_svd,_nvg]
goto _r

#WW4_MOTSniper
_m = [_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m]
_w = [_v94,_nvg]
goto _r

#WW4_MOTDemolition
_m = [_ak74msd,_ak74msd,_ak74msd,_ak74msd,_bomb,_bomb,_bomb]
_w = [_ak74mkobrasd,_bino,_nvg]
goto _r

#WW4_MOTEngineer
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_mine,_mine,_mine]
_w = [_ak74mkobra,_nvg]
goto _r

#WW4_MOTSquadLeader
_m = [_elr,_elr,_elr,_elr,_elr,_elr,_elr,_he,_he,_smoke]
_w = [_ak74mpso,_bino,_nvg]
goto _r

#WW4_MOTOfficer
_m = [_elr,_elr,_elr,_elr,_elr,_elr,_elr,_he,_he,_smoke]
_w = [_ak74mpso,_bino,_nvg]
goto _r

;****************************************
;East Desert Army
;****************************************
#WW4_DMOTRifleman
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_he,_he]
_w = [_ak74mkobra,_nvg]
goto _r

#WW4_DMOTGrenadier
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_vest]
_w = [_ak74mkobragp25,_nvg]
goto _r

#WW4_DMOTMedic
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_ak74m,_he,_he]
_w = [_ak74mkobra,_nvg]
goto _r

#WW4_DMOTAutorifleman
_m = [_rpk74m,_rpk74m,_rpk74m,_rpk74m,_rpk74m]
_w = [_rpk74kobra,_nvg]
goto _r

#WW4_DMOTMachinegun
_m = [_pkmm,_pkmm,_pkmm,_pkmm,_pkmm]
_w = [_pkm,_nvg]
goto _r

#WW4_DMOTRocket
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_rpgm,_rpgm,_rpgm]
_w = [_ak74mkobra,_rpg,_nvg]
goto _r

#WW4_DMOTAT
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_at4m]
_w = [_ak74mkobra,_at4,_nvg]
goto _r

#WW4_DMOTATH
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_vympelm]
_w = [_ak74mkobra,_vympel,_nvg]
goto _r

#WW4_DMOTAA
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_aam]
_w = [_ak74mkobra,_aa,_nvg]
goto _r

#WW4_DMOTMarksman
_m = [_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm,_svdm]
_w = [_svd,_nvg]
goto _r

#WW4_DMOTSniper
_m = [_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m,_v94m]
_w = [_v94,_nvg]
goto _r

#WW4_DMOTDemolition
_m = [_ak74msd,_ak74msd,_ak74msd,_ak74msd,_bomb,_bomb,_bomb]
_w = [_ak74mkobrasd,_bino,_nvg]
goto _r

#WW4_DMOTEngineer
_m = [_ak74m,_ak74m,_ak74m,_ak74m,_mine,_mine,_mine]
_w = [_ak74mkobra,_nvg]
goto _r

#WW4_DMOTSquadLeader
_m = [_elr,_elr,_elr,_elr,_elr,_elr,_elr,_he,_he,_smoke]
_w = [_ak74mpso,_bino,_nvg]
goto _r

#WW4_DMOTOfficer
_m = [_elr,_elr,_elr,_elr,_elr,_elr,_elr,_he,_he,_smoke]
_w = [_ak74mpso,_bino,_nvg]
goto _r

#rearm
{_u addMagazine _x} forEach _m
{_u addWeapon _x} forEach _w
_u selectWeapon primaryWeapon _u
_u addEventHandler ["killed",{[(_this select 0),1,0] exec "equip\convert_hd\equip_ai.sqs"}]

#ende

exit[/spoiler]

eq_west_army_hd.sqs

;*************************************************
;WW4mod Rearm HD Script by Nikiller v0.9b 
;contact: nikillerofp@hotmail.fr
;[unitName] exec "scriptName.sqs"
;*************************************************
_u = _this select 0

if (local _u) then {} else {goto "ende"}

_m = magazines _u
_w = weapons _u
_r = "rearm"

{_u removeMagazine _x} foreach _m
{_u removeWeapon _x} foreach _w

;****************************************
;Weapons
;****************************************
_m16acog = "WW4_M16Acog"
_m16aim  = "WW4_M16Aim"
_m16m203 = "WW4_M16M203"
_m16refsd= "WW4_M16RefSD"
_m249aim = "WW4_M249Aim"
_m240    = "WW4_M240"
_m24     = "WW4_M24"
_m82     = "WW4_M82"
_smaw    = "WW4_SMAWLauncher"
_carl    = "WW4_CarlGustaveLauncher"
_jav     = "WW4_JavelinLauncher"
_aa      = "AALauncher"

;****************************************
;Magazines
;****************************************
_m16m  = "WW4_W556_30BHDmag"
_wlr   = "WW4_WLR30HDmag"
_m16msd= "WW4_W556_30BSDHDmag"
_m249m = "WW4_W556M_200HDmag"
_m240m = "WW4_W762M_200HDmag"
_m24m  = "WW4_W762Sniper_5HDmag"
_m82m  = "WW4_W127_10HDmag"
_gren  = "WW4_M433grenade"
_vest  = "WW4_M433Vest"
_smawm = "WW4_SMAWMag"
_carlm = "WW4_CarlGustaveLauncher"
_javm  = "WW4_JavelinMag"
_aam   = "AALauncher"
_he    = "HandGrenade"
_smoke = "SmokeShell"
_bomb  = "PipeBomb"
_mine  = "Mine"

;****************************************
;Equipment
;****************************************
_bino= "Binocular"
_nvg = "NVGoggles"

_m = []
_w = []

_typeof = typeof _u
goto _typeof

;hint "Error: unit(s) you are trying to rearm is not covered by this script"

;****************************************
;West Woodland Army
;****************************************
#WW4_WARRifleman
_m = [_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_he,_he]
_w = [_m16aim,_nvg]
goto _r

#WW4_WARGrenadier
_m = [_m16m,_m16m,_m16m,_m16m,_m16m,_vest]
_w = [_m16m203,_nvg]
goto _r

#WW4_WARMedic
_m = [_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_he,_he]
_w = [_m16aim,_nvg]
goto _r

#WW4_WARAutorifleman
_m = [_m249m,_m249m,_m249m,_m249m,_m249m]
_w = [_m249aim,_nvg]
goto _r

#WW4_WARMachinegun
_m = [_m240m,_m240m,_m240m,_m240m,_m240m]
_w = [_m240,_nvg]
goto _r

#WW4_WARRocket
_m = [_m16m,_m16m,_m16m,_m16m,_smawm,_smawm,_smawm]
_w = [_m16aim,_smaw,_nvg]
goto _r

#WW4_WARAT
_m = [_m16m,_m16m,_m16m,_m16m,_carlm]
_w = [_m16aim,_carl,_nvg]
goto _r

#WW4_WARATH
_m = [_m16m,_m16m,_m16m,_m16m,_javm]
_w = [_m16aim,_jav,_nvg]
goto _r

#WW4_WARAA
_m = [_m16m,_m16m,_m16m,_m16m,_aam]
_w = [_m16aim,_aa,_nvg]
goto _r

#WW4_WARMarksman
_m = [_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m]
_w = [_m24,_nvg]
goto _r

#WW4_WARSniper
_m = [_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m]
_w = [_m82,_nvg]
goto _r

#WW4_WARDemolition
_m = [_m16msd,_m16msd,_m16msd,_m16msd,_bomb,_bomb,_bomb]
_w = [_m16refsd,_bino,_nvg]
goto _r

#WW4_WAREngineer
_m = [_m16m,_m16m,_m16m,_m16m,_mine,_mine,_mine]
_w = [_m16aim,_nvg]
goto _r

#WW4_WARSquadLeader
_m = [_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_he,_he,_smoke]
_w = [_m16acog,_bino,_nvg]
goto _r

#WW4_WAROfficer
_m = [_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_he,_he,_smoke]
_w = [_m16acog,_bino,_nvg]
goto _r

;****************************************
;West Desert Army
;****************************************
#WW4_DWARRifleman
_m = [_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_he,_he]
_w = [_m16aim,_nvg]
goto _r

#WW4_DWARGrenadier
_m = [_m16m,_m16m,_m16m,_m16m,_m16m,_vest]
_w = [_m16m203,_nvg]
goto _r

#WW4_DWARMedic
_m = [_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_he,_he]
_w = [_m16aim,_nvg]
goto _r

#WW4_DWARAutorifleman
_m = [_m249m,_m249m,_m249m,_m249m,_m249m]
_w = [_m249aim,_nvg]
goto _r

#WW4_DWARMachinegun
_m = [_m240m,_m240m,_m240m,_m240m,_m240m]
_w = [_m240,_nvg]
goto _r

#WW4_DWARRocket
_m = [_m16m,_m16m,_m16m,_m16m,_smawm,_smawm,_smawm]
_w = [_m16aim,_smaw,_nvg]
goto _r

#WW4_DWARAT
_m = [_m16m,_m16m,_m16m,_m16m,_carlm]
_w = [_m16aim,_carl,_nvg]
goto _r

#WW4_DWARATH
_m = [_m16m,_m16m,_m16m,_m16m,_javm]
_w = [_m16aim,_jav,_nvg]
goto _r

#WW4_DWARAA
_m = [_m16m,_m16m,_m16m,_m16m,_aam]
_w = [_m16aim,_aa,_nvg]
goto _r

#WW4_DWARMarksman
_m = [_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m,_m24m]
_w = [_m24,_nvg]
goto _r

#WW4_DWARSniper
_m = [_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m,_m82m]
_w = [_m82,_nvg]
goto _r

#WW4_DWARDemolition
_m = [_m16msd,_m16msd,_m16msd,_m16msd,_bomb,_bomb,_bomb]
_w = [_m16refsd,_bino,_nvg]
goto _r

#WW4_DWAREngineer
_m = [_m16m,_m16m,_m16m,_m16m,_mine,_mine,_mine]
_w = [_m16aim,_nvg]
goto _r

#WW4_DWARSquadLeader
_m = [_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_he,_he,_smoke]
_w = [_m16acog,_bino,_nvg]
goto _r

#WW4_DWAROfficer
_m = [_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_wlr,_he,_he,_smoke]
_w = [_m16acog,_bino,_nvg]
goto _r

#rearm
{_u addMagazine _x} forEach _m
{_u addWeapon _x} forEach _w
_u selectWeapon primaryWeapon _u
_u addEventHandler ["killed",{[(_this select 0),1,0] exec "equip\convert_hd\equip_ai.sqs"}]

#ende

exit

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
Fixed dead link

Share this post


Link to post
Share on other sites

hi niki,

can u make or share if you have a script with

spawn of enemies with editable/changable:

-unit class name

-weapon class name

-face class name

-behave

-wp(s)

please?

i mean the script can spawn a group (1-12) of enemy AIs with editable

possibilities above.

not so difficult pls, im not so good in scripting :)

thanks

:moto:

Share this post


Link to post
Share on other sites

hi,

Here we go Inc! This script spawn a custom squad you can set behaviour, combat mode, formation, direction, skill, make it move where mission maker wants and init the spawned unit. I also made a random face script initialized in the spawned unit's init, faces array can of course be changed with addon faces list without any problem. A custom rearm script can be initialized in the unit's init aswel I suggest to have a look in this rearm script. Spawned units are also deleted after 2min when they die, the delete delay can be modified in spawnsquad.sqf.

IMPORTANT: To avoid spawn lags be sure that one model of each units spawned is placed somewhere on the map. This units don't need to be alive then put them in the sea if you want.

Addon needed: N/A

Addon suggested: WW4 modpack 2.5

Version: 1.0

By: Nikiller

Credits: Surpher and Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script spawn a custom squad and mission maker can set skill, behaviour, formation, combat mode and so on.

installation: put the ai folder in your mission folder and download the demo to see how it works (sorry to be lazy).

Note: for performance purpose I strongly recommand to put the spawned unit model somewhere on the map to avoid spawn lag.

NB: Here's the ofp faces list in case you want to change the faces array.

ofp faces list

"face1"=Peter P.

"face2"=Victor B.

"face3"=Bohous

"face4"=Mirek

"face5"=Peter S.

"face6"=Charles

"face7"=Peter V.

"face8"=Richard B.

"face9"=Charles M.

"face10"=Ian O'Hara

"face11"=Vojta N.

"face12"=Adam B.

"face13"=Peter B.

"face14"=Francesco F.

"face15"=Bill O.

"face16"=Colin F.

"face17"=Darren I.

"face18"=Eric J.

"face19"=Phill D.

"face20"=Graham U.

"face21"=Henry G.

"face22"=Ivan B.

"face23"=Ghulam K.

"face24"=Kevin B.

"face25"=Robert

"face26"=Martin

"face27"=John A.

"face28"=Bill G.

"face29"=Peter O.

"face30"=Henry H.

"face31"=William G.

"face32"=Arnold T.

"face33"=Michael H.

"face34"=John Fox

"face35"=George MacArthur

"face36"=Peter Sun

"face37"=Robert S.

"face38"=John Way

"face39"=Jack C.

"face40"=J.C.

"face41"=Mel D.

"face42"=John M.

"face43"=Jirka M.

"face44"=Honza K.

"face45"=John A.

"face46"=Ondrey N.

"face47"=Ondrey S.

"face48"=Gabriel K.

"face49"=Oliver S.

"face50"=Radan D.

"face51"=George J.

"face52"=Ota B.

"custom"=custom face

"faceR01"

"faceR02"

"faceR03"

"faceR04"

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_host=local server

;-----------------------------------------------------------------------------------------
; Spawn squad
;-----------------------------------------------------------------------------------------
nik_fspawnsquad=preprocessFile "ai\spawn_manager\spawnsquad.sqf"
nik_sq1=[["OfficerW",1,"sld","[this] exec {ai\misc\face.sqs}",0.9,"SERGEANT"],["SoldierWB",4,"sld","[this] exec {ai\misc\face.sqs}",0.7,"CORPORAL"],["SoldierWG",4,"sld","[this] exec {ai\misc\face.sqs}",0.7,"CORPORAL"],["SoldierWMG",2,"sld","[this] exec {ai\misc\face.sqs}",0.7,"CORPORAL"]]
nik_sq2=[["SoldierWSaboteurPipe",12,"sld","[this] exec {ai\misc\face.sqs}",0.9,"SERGEANT"]]
nik_sq3=[["SoldierWG36a",2,"sld","[this] exec {ai\misc\face.sqs}",0.95,"SERGEANT"],["SoldierWG36a",8,"sld","[this] exec {ai\misc\face.sqs}",0.9,"CORPORAL"],["SoldierWSniper",2,"sld","[this] exec {ai\misc\face.sqs}",0.9,"CORPORAL"]]

exit

init_spawnsquad.sqs

;*******************************************************
;Spawn Squad Init Script by Nikiller v0.9b
;Note: Place a game logic named server on the map
;contact: nikillerofp@hotmail.fr
;[] exec "scriptName.sqs"
;*******************************************************

if nik_host then {} else {goto "ende"}

[nik_sq1,"sq1_mark",nik_dummy,combat,red, vee,"sq1move_mark",270] call nik_fspawnsquad
~0.5
[nik_sq2,"sq2_mark",nik_dummy,combat,yellow,wedge,"sq2move_mark",270] call nik_fspawnsquad
~0.5
[nik_sq3,"sq3_mark",nik_dummy,combat,red,line,"sq3move_mark",270] call nik_fspawnsquad

#ende

exit

spawnsquad.sqf

private ["_squadtype","_location","_group","_behaviour","_combatmode","_formation","_itemnum","_unit","_unitClass","_unitCount","_unitType","_unitInit","_unitSkill","_unitRank","_count","_dir"];

_squadtype = _this select 0;
_location = _this select 1;
_group = _this select 2;
_behaviour = _this select 3;
_combatmode = _this select 4;
_formation = _this select 5;
_move = _this select 6;
_dir = _this select 7;
_itemnum = 0;

if (nik_host) then
{
 while {_itemnum < count _squadtype}
Do
{
 	_unit = _squadtype select _itemnum;
_unitClass = _unit select 0;
_unitCount = _unit select 1;
_unitType = _unit select 2;
_unitInit = _unit select 3;
_unitSkill = _unit select 4;
_unitRank = _unit select 5;
_count = 0;
While {_count < _unitCount}
Do
{
 	_unitClass createUnit [getmarkerPos _location, _group, _unitInit, _unitSkill, _unitRank];
_count = _count + 1;
if (_count == 1 && _itemnum == 0) then 
{
	_newLeader = nearestObject [getmarkerPos _location, _unitClass];
	[_newLeader] join GrpNull; _group = _newLeader;
};
};
_itemnum = _itemnum + 1;
};
{
_x setcombatmode _combatmode;
_x setbehaviour _behaviour;
_x removealleventhandlers "killed";
_x setformation _formation;
_x setdir _dir;
_x addEventHandler ["killed", {[(_this select 0),120] exec "performance\del_unit.sqs"}]
}
forEach units _group;
group _group move getmarkerPos _move;
true
}
Else
{
 false
};

_group

del_unit.sqs

;*******************************************************
;Delete Dead Bodies Script by Nikiller v0.9b
;Delete dead bodies
;Note: Place a game logic named server on the map
;[unitName,delay] exec "scriptName.sqs"
;*******************************************************

if nik_host then {} else {goto "ende"}

_b = _this select 0
_d = _this select 1

_ac="hidebody"
~_d
if (alive gravedigger) then {gravedigger action [_ac,_b]}
~10
_b setPos [0,0,0]
~1
deleteVehicle _b

#ende

exit

face.sqs

;**********************************************
;Random Face Script by Nikiller v0.9b
;Set random face
;contact: nikillerofp@hotmail.fr
;[unitName] exec "scriptName.sqs"
;**********************************************

_u = _this select 0

_f=call loadFile "ai\misc\face.sqf"
_c=count _f
if (alive _u) then {_r=random _c; _r=_r-_r mod 1; _u setFace (_f select _r)}

exit

face.sqf

[

"face1",
"face2",
"face3",
"face4",
"face5",
"face6",
"face7",
"face8",
"face9",
"face10",
"face12",
"face13",
"face14",
"face15",
"face16",
"face17",
"face18",
"face19",
"face20",
"face21",
"face23",
"face24",
"face25",
"face26",
"face27",
"face28",
"face29",
"face30",
"face31",
"face32",
"face33",
"face34",
"face35",
"face36",
"face37",
"face38",
"face39",
"face40",
"face41",
"face42",
"face43",
"face44",
"face45",
"face46",
"face47",
"face48",
"face49",
"face50",
"face51",
"faceR01",
"faceR02",
"faceR03",
"faceR04"

]

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
Demo reupload

Share this post


Link to post
Share on other sites

wiii thanks Niki u said yesterday u need a week :)

of so i can modify faces to insert oriental or african, arabian faces.

sweet, thanks again

Share this post


Link to post
Share on other sites

hi,

This script delete dead bodies after certain delay (choosen by mission maker). It saves a lot of performance in middle/big size missions.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nagual and Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: This script delete dead bodies after certain delay

installation: put the performance folder in your mission folder and write in the unit's init field or in the init.sqs unitName addEventHandler ["killed", {[(_this select 0),delayNumber] exec "performance\del_unit.sqs"}]

Note: for performance purpose I strongly recommand to make an array to define the unit name (i.e nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]) in the init.sqs

NB: gravedigger don't need to be a unit it can be a game logic.

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_host=local server
nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]

;-----------------------------------------------------------------------------------------
; Delete dead bodies
;-----------------------------------------------------------------------------------------
{_x addEventHandler ["killed", {[(_this select 0),10] exec "performance\del_unit.sqs"}]} forEach nik_west_ai

exit

del_unit.sqs

;*******************************************************
;Delete Dead Bodies Script by Nikiller v0.9b
;Delete dead bodies
;Note: Place a game logic named server on the map
;[unitName,delay] exec "scriptName.sqs"
;*******************************************************

if nik_host then {} else {goto "ende"}

_b = _this select 0
_d = _this select 1

_ac="hidebody"
~_d
if (alive gravedigger) then {gravedigger action [_ac,_b]}
~10
_b setPos [0,0,0]
~1
deleteVehicle _b

#ende

exit

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

wiii thanks Niki u said yesterday u need a week :)

of so i can modify faces to insert oriental or african, arabian faces.

sweet, thanks again

Yes it was faster than I thought. You can set addon faces by editing the face.sqf array with addon face name of your choice. No more than 100 elements in the array or it could be problematic in matter of performance. If you have any question on how to use the script tell me and I will try to answer it.

NB: There was an error in del_unit.sqs. It's now corrected. Download the new demo.

cya.

Nikiller.

Share this post


Link to post
Share on other sites

hi,

This script delete destroyed vehicles after certain delay (choosen by mission maker). It saves a lot of performance in middle/big size missions.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: This script delete destroyed vehicles after certain delay

installation: put the performance folder in your mission folder and write in the unit's init field or in the init.sqs unitName addEventHandler ["killed", {[(_this select 0),delayNumber] exec "performance\del_vehicle.sqs"}]

Note: for performance purpose I strongly recommand to make an array to define the vehicle name (i.e nik_east_bmp=[EastBmp1,EastBmp2,EastBmp3]) in the init.sqs

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_host=local server
nik_east_bmp=[EastBmp1,EastBmp2,EastBmp3]

;-----------------------------------------------------------------------------------------
; Delete destroyed vehicles
;-----------------------------------------------------------------------------------------
{_x addEventHandler ["killed", {[(_this select 0),10] exec "performance\del_vehicle.sqs"}]} forEach nik_east_bmp

exit

del_vehicle.sqs

;*************************************************
;Delete Destroyed Vehicle Script by Nikiller v0.9b
;Delete destroyed vehicle and crew
;Note: Place a game logic named server on the map
;[vehicleName,delay] exec "scriptName.sqs"
;*************************************************

if nik_host then {} else {goto "ende"}

_v = _this select 0
_delay = _this select 1

_d=driver _v
_g=gunner _v
_c=commander _v
_all=[_v,_d,_g,_c]
~_delay
_v setPos [0,0,0]
~1
{deleteVehicle _x} forEach _all

#ende

exit

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
updated demo link

Share this post


Link to post
Share on other sites

hi,

This script makes unit says "reloading!" when his magazine is empty. It works for player and AI. Even unit's lips are moving when it says something. It works for east, west and resistance because the script detect which side is the unit. There's 5 "reloading!" sounds per side and the script randomly choose one. Sounds are in US english, russian and CZ.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script makes unit says "reloading!" when his magazine is empty.

installation: put the fx and sound folders in your mission folder and write in the unit's init field or in the init.sqs [unitName] exec "fx\voice\voice_reloading.sqs".

Note: for performance purpose I strongly recommand to make an array to define the unit name (i.e nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]) in the init.sqs

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_client=local player
nik_west_ai=[w1,w2,w3,w4,w5,w6,w7,w8,w9]

;-----------------------------------------------------------------------------------------
; Voice reloading
;-----------------------------------------------------------------------------------------
{[_x] exec "fx\voice\voice_reloading.sqs"} forEach nik_west_ai

exit

description.ext

class CfgSounds
{
	sounds[] = {east_reloading_01,east_reloading_02,east_reloading_03,east_reloading_04,east_reloading_05,res_reloading_01,res_reloading_02,res_reloading_03,res_reloading_04,res_reloading_05,west_reloading_01,west_reloading_02,west_reloading_03,west_reloading_04,west_reloading_05};

	class east_reloading_01
		{
			name = "east_reloading_01";
			sound[] = {"east_reloading_01.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class east_reloading_02
		{
			name = "east_reloading_02";
			sound[] = {"east_reloading_02.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class east_reloading_03
		{
			name = "east_reloading_03";
			sound[] = {"east_reloading_03.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class east_reloading_04
		{
			name = "east_reloading_04";
			sound[] = {"east_reloading_04.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class east_reloading_05
		{
			name = "east_reloading_05";
			sound[] = {"east_reloading_05.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class res_reloading_01
		{
			name = "res_reloading_01";
			sound[] = {"res_reloading_01.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class res_reloading_02
		{
			name = "res_reloading_02";
			sound[] = {"res_reloading_02.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class res_reloading_03
		{
			name = "res_reloading_03";
			sound[] = {"res_reloading_03.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class res_reloading_04
		{
			name = "res_reloading_04";
			sound[] = {"res_reloading_04.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class res_reloading_05
		{
			name = "res_reloading_05";
			sound[] = {"res_reloading_05.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class west_reloading_01
		{
			name = "west_reloading_01";
			sound[] = {"west_reloading_01.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class west_reloading_02
		{
			name = "west_reloading_02";
			sound[] = {"west_reloading_02.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class west_reloading_03
		{
			name = "west_reloading_03";
			sound[] = {"west_reloading_03.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class west_reloading_04
		{
			name = "west_reloading_04";
			sound[] = {"west_reloading_04.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
	class west_reloading_05
		{
			name = "west_reloading_05";
			sound[] = {"west_reloading_05.ogg",db+0,1.0};
			titles[] =
				{
					0,""
				};
};
};

voice_reloading.sqs

;***********************************************
;Voice Reloading Script by Nikiller v0.9b
;Make unit says reloading! when his mag is empty
;Note: unit is moving lips since say commmand
;contact: nikillerofp@hotmail.fr
;[unitName] exec "scriptName.sqs"
;***********************************************

if nik_client then {} else {goto "ende"}
~5

_u = _this select 0

_vw=call loadFile "fx\voice\voice_west_reloading.sqf"
_ve=call loadFile "fx\voice\voice_east_reloading.sqf"
_vr=call loadFile "fx\voice\voice_res_reloading.sqf"


? (side _u==west): _v=_vw
? (side _u==east): _v=_ve
? (side _u==resistance): _v=_vr

_c=count _v
_d=1
_l="l"
_wa="wait"

#l
~_d
_w=primaryWeapon _u
_a=_u ammo _w
if (_a==0) then {_r=random _c; _r=_r-_r mod 1; _u say (_v select _r); goto _wa}
if (alive _u) then {goto _l} else {goto "ende"}

#wait
~_d
_w=primaryWeapon _u
_a=_u ammo _w
if (alive _u) then {} else {goto "ende"}
if (_a>0) then {goto _l} else {goto _wa}

#ende

exit

voice_east_reloading.sqf

[

"east_reloading_01",
"east_reloading_02",
"east_reloading_03",
"east_reloading_04",
"east_reloading_05"

]

voice_res_reloading.sqf

[

"res_reloading_01",
"res_reloading_02",
"res_reloading_03",
"res_reloading_04",
"res_reloading_05"

]

voice_west_reloading.sqf

[

"west_reloading_01",
"west_reloading_02",
"west_reloading_03",
"west_reloading_04",
"west_reloading_05"

]

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller
uploaded fixed demo

Share this post


Link to post
Share on other sites

hi,

This script makes controled AI chopper crash and cargo survive the crash.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: This script makes controled AI chopper crash and cargo survive the crash.

installation: put the fx folder in your mission folder and write in the unit's init field or in the init.sqs [unitName] exec "fx\misc\controled crash.sqs".

Note: I used this voice script (with modified voice array) for the pilot to make the crash more realistic.

NB: Be sure the crash zone is clear of concrete objects like houses, trees,rocks...

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_client=local player
nik_host=local server

~10
;-----------------------------------------------------------------------------------------
; Controled crash
;-----------------------------------------------------------------------------------------
[WestUH601] exec "fx\misc\controled_crash.sqs"
[] exec "fx\misc\black_screen.sqs"
[WestUH601] exec "fx\fire_effect\burn.sqs"
_d=driver WestUH601
[_d] exec "fx\voice\voice.sqs"

exit

controled_crash.sqs

;*******************************************************
;Controled Crash Script by Nikiller v0.9b
;Make a chopper crash and cargo survive
;Note: Place a game logic named server on the map
;[unitName] exec "scriptName.sqs"
;*******************************************************

if nik_host then {} else {goto "ende"}

_v = _this select 0

_rate=0
_velRnd=2 + random 2
_factor=2 + random 2
_d=driver _v
_g=gunner _v
_l="l"
_delay=0.01

#l
~_delay
if (alive _v) then {} else {goto "ende"}
_v setDir (getDir _v+_factor)
_v setVelocity [0,0,-(2+_velRnd+_rate)]
_rate = _rate + .01
if (getPos _v select 2>0.5) then {goto _l}

_v setFuel 0
_v setVelocity [0,0,-.5]
_v setDammage 0.9
~1
{_x setDammage 1} forEach [_d,_g]

#ende

exit

black_screen.sqs

;*******************************************************
;Black Screen Script by Nikiller v0.9b
;Make black screen effect during a chopper crash
;[] exec "scriptName.sqs"
;*******************************************************

if nik_client then {} else {goto "ende"}

_i=0

#lp
~1
cutText ["","BLACK OUT"]
~1
cutText ["","BLACK IN"]
_i = _i + .25
? _i < 3 : goto "lp"

#ende

exit

burn.sqs

;******************************************
;Basic fire effect Script by Nikiller v0.9b
;[unitName] exec "scriptName.sqs"
;******************************************

if nik_client then {} else {goto "ende"}

_object = _this select 0

_tmax=100+random 60
_max=_tmax/0.25
_z=0

# lp
~0.2
drop ["cl_fire", "", "Billboard", 1, 1, [random 1,random 1,0.2], [random 0.3, random 0.3, 3], 1, 0.004, 0.004, 0.1, [1,(1 + random 7),1], [[1,0.5,0.5,0], [0.2,0.2,0,0.7], [1,1,0,0.5], [1,1,0.1,0]], [0,1], 0.5, 0.05, "", "",_object ]

drop ["cl_fire", "", "Billboard", 1, 0.7, [- random 1,- random 1,0.35], [random 0.3, random 0.3, 3], 1, 0.004, 0.004, 0, [1,3,0], [[1,0.5,0.5,0], [1,1,0.8,0.7], [1,1,0,0.4], [1,1,0,0]], [0,1], 0.5, 0.05, "", "",_object ]

drop ["cl_fire", "", "Billboard", 1,  5, [0,0,1], [ random 1, random 1, random 3], 1, 0.005, 0.0042, 0, [0.15], [[1,1,1,1],[0,0,0,0]], [0,1], 0.5, 1, "", "",_object]

_vel= -1.0 + (random 2.0)
drop ["cl_basic", "", "Billboard", 1,  15+(random 5), [0,0,0.3], [ _vel, _vel, 1 + random 3], 1, 0.6, 1,1, [random 3 , 50 + random 15], [[0,0,0,0.80],[0,0,0,0.1 - Random 0.1]], [0,1], 0.2, 1.0, "", "",_object]

;drop ["cl_basic", "", "Billboard", 1, 15,[-1+random 2,-1+random 2,0], [ 0, 0,random 0.8], 1, 1.245, 1, 0.15, [random 5,15], [[random 0.1,random 0.15, random 0.1,0.7], [random 0.1,random 0.15,random 0.1,0.7], [random 0.1, random 0.15, random 0.1,random 0.7], [random 0.1, random 0.1, random 0.1,0]], [0,1], 8.5, 1, "", "", _object]

_z=_z+1
? _z<_max : goto "lp"

#ende

exit

Here's a demo to show how it works: DEMO LINK

There's 2 script versions in the archive v2 is more realistic as requested by Icarus.

cya.

Nikiller.

Edited by Nikiller
updated dead link

Share this post


Link to post
Share on other sites

Awsame scripts, Nikiller! :thumbsup:

Sorry if I am asking for too much, but is it possible to implement voice "reloading!" script to Dynamic Sound AI? :o

Take care, and get some rest :p

Share this post


Link to post
Share on other sites

hi,

Awsame scripts, Nikiller! :thumbsup:

Sorry if I am asking for too much, but is it possible to implement voice "reloading!" script to Dynamic Sound AI? :o

Take care, and get some rest :p

Sure you can use all the scripts in the topic just give deserved credits. If you modify the code please change the version number and write it is a modified version in the script header. Have fun! :)

Ho and if you need more type of reloading voice let me know I'll send you the ogg files. All you have to do is to modify the voice array.

@all: I'm working on a script where AI will be able to kidnap player, it still needs some work to make it MP compatable but it is promising. Stay tuned, happy mission editing and don't forget to support addon/mod makers by making missions with your favorite addon/mod!

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

@Nikiller

Sorry I if I misunderstood you, but I am not in any way related to Binmod team. :o

Share this post


Link to post
Share on other sites

hi,

@Nikiller

Sorry I if I misunderstood you, but I am not in any way related to Binmod team. :o

Hehe sorry my bad I just woke up from my nap and I was a bit confused -_-. I thought you were making an addon named dynamic sound AI and you wanted to implement the script in your addon :b.

What is dynamic sound AI BTW?

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

@voice "reloading""

This is awsame script!

I don't get it work fully however as I don't see AI lips moving at all.

Any thoughts? :confused:

Share this post


Link to post
Share on other sites

hi,

@Nikiller

Dynamic Sound AI is in fact (addon) an important part of ECP mod (Enhanced Configuration Project). ;)

Binmod also uses Dynamic Sound AI.

Icarus

Ok, I see. Sorry but I'm not going to modify ECP files. :(

@voice "reloading""

This is awsame script!

I don't get it work fully however as I don't see AI lips moving at all.

Any thoughts? :confused:

Yes I know what's wrong. I forgot to include the lip files (it makes unit's lips move when it says something). Many thanks for bug reporting Icarus. It's now fixed download link updated with fixed version. ;)

cya.

Nikiller.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×