Jump to content

Recommended Posts

Problem 1:

I got a weird bug (kinda). I got a Blackhawk land on the airstrip, and pilots exit them, and head for HMMWV (that is as intended), but when they get just by them, they turn around, get back to their Blackhawk and fly to a spot, where HMMWV was intended to carry them to. I synchronised load/get in waypoints, but this is what I get. That doesn't happen when HMMWV's crew is default (crew looks out of place so I tried to make them suitable with desert terrains, by placing to an empty HMMWV and inserting in them as a crew USMC MARPAT units, lead unit intended to get to the spot and then wait to load the HMMVW).

-SOLVED-

I placed a triger over final in-fly waypoint saying in on activation line: unassign vehicle unit1; unassign vehicle unit2.

Then on a waypoint in getin order's on activation line this assignascargo car1; unitname assignascargo car1

So it is solved. I suppose there are better ways, but that is how I solved "my way", so if somebody else experiences this might try my formula, but bear in mind this code might be annoying and very long with multiple units.

UPDATE: I presume it could say in on activation line "unassign vehicle groupname". I will test this for a comprehensive result.

Problem 2:

Another bug: In another mission, I make a blackhawk takeoff and head for a spot to unload troops, but when it gets into spot, it just floats in the air (unless I eject, then it starts to land). Yes, again synchronised, I tried both Unload and Unload Transport Cargo command, but the result is all the same (I placed an unload waypoint on road and with invisible H, but no effect, whatsoever). It does not use default crew (as it should be spawned with). Any help?

-DADY ANSWER (FOR THOSE KNOWING SCRIPTS)-

hi,

Choppers in ofp are a pain in the ass and are not 100% reliable. It also depend of your computer speed.

Here's a script to make a chopper move to an insertion point and unload the group in his cargo. This script is SP/MP friendly and can be used with multiple choppers at the same time. This script doesn't need waypoints or triggers.

chopperName=name of the chopper

Height=the height the chopper will fly after it has unloaded his cargo

groupName=the name of the group in cargo. To give a name to a group put in the initfield of every member (more safety for MP compatibility) GroupName=group this groupName is whatever you want WestGrp1 for example.

invisibleHname=invisible H name where the chopper will land. Can be found in empty/objects.

gamelogicName=Name of the gamelogic to make the chopper move after it has unloaded his cargo.

NB: the variable start_chopper must be turned to true start_chopper=true when you want that the chopper perform the insertion. It can be done with a script like this:

init.sqs

;-----------------------------------------------------------------------------------------
; Name of the players
;-----------------------------------------------------------------------------------------
nik_players=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12]
;-----------------------------------------------------------------------------------------
; Insertion chopper
;-----------------------------------------------------------------------------------------
start_chopper=false
[chop1,30,WestGrp1,H_1,gl_ins1] exec "Insertion.sqs"
;-----------------------------------------------------------------------------------------
; Check if all units are in the chopper
;-----------------------------------------------------------------------------------------
[chop1] exec "All_In.sqs"
exit

All_In.sqs

;[chopperName] exec "All_In.sqs"
if (local server) then {} else {goto "Ende"}
_chop = _this select 0

#getin
~2
_icount=0
_num=0
"if (alive _x) then {_num = _num + 1}" foreach nik_players
"if (vehicle _x == _chop) then {_icount = _icount + 1}" foreach nik_players
if (_icount == _num)  then {goto "takeoff"} else {goto "getin"}

#takeoff
~2
start_chopper=true; publicVariable "start_chopper"

#Ende
exit

Insertion.sqs

;[chopperName,Height,groupName,invisibleHname,gamelogicName] exec "insertion.sqs"
;example: [chop1,50,WestGrp1,H_1,gl_ins1] exec "insertion.sqs"

if (local server) then {} else {goto "Ende"}

@ start_chopper

_chop = _this select 0
_h    = _this select 1
_grp  = _this select 2
_pad  = _this select 3
_gl   = _this select 4

_units = Units _grp
_i = 0
_j = count _units
_c = 0
_pospad=getPos _pad
_posgl=getPos _gl

_chop setCaptive true
_chop setBehaviour "CARELESS"
_chop setCombatMode "BLUE"

_chop doMove _pospad
~0.5

#dist
~2
if (_chop distance _pad>=500) then {goto "dist"}

#brake
_s = speed _chop
if (_s < 90) then {goto "land"}
_f = ((_s - 10) / _s)
_vel = velocity _chop
_chop setvelocity[(_vel select 0) * _f, (_vel select 1) * _f, (_vel select 2) * _f]
~0.1
_c = _c + 0.1
if (_c < 3) then {goto "brake"}
~1

#land
_chop flyInHeight 1; _chop land "get out"; _smokes="smokeShellRed" createVehicle _pospad

@ (getPos _chop select 2 < 1.5)
~1
_ac="GETOUT"

#next
(_units select _i) action [_ac,_chop]
unassignVehicle (_units select _i)
_i=_i+1
~0.5
if (_j>_i) then {goto "next"}
~5
_chop flyInHeight _h; _chop doMove _posgl; _chop setSpeedMode "FULL"

@ UnitReady _chop

[_chop] exec "Del_vehicle.sqs"
{[_x] exec "Del_Trig.sqs"} forEach [_h,_gl]

#Ende
exit

A little script to delete the chopper after it has done his job. It saves performance in the mission.

Del_vehicle.sqs

;[chopperName] exec "Del_vehicle.sqs"
if (local server) then {} else {goto "Ende"}
_v = _this select 0
_d=driver _v
_g=gunner _v
_c=commander _v
_all=[_v,_d,_g,_c]
~30
{deleteVehicle _x} forEach _all

#Ende
exit

A little script to delete all related insertion stuffs like invisible H and gamelogic. This script can be used to delete triggers aswell.

Del_Trig.sqs

; [unitName] exec "Del_Trig.sqs"
if (local server) then {} else {goto "Ende"}
_t = _this select 0
~60
deleteVehicle _t

#Ende
exit

Copy and paste those scripts in the notepad, don't forget to save them .sqs and not .txt, and put them in your mission folder.

IMPORTANT: don't forget to put a gamelogic named server somewhere in your mission.

Good luck with choppers in ofp you will need it. :D

cya.

Nikiller.

Problem 3:

There's a third mission, where I made to assasinate a resistance leader, protected by SAS motorcade (and resistance leader's car is driven by one of those guys). The trigger (square, a axis 5000, b axis 5000) should give me a waypoint, when "Resistance" "Not Present", but even though the car is in the trigger's area, the trigger activates, thinking the leader is dead. How could I do it working properly?

-SOLVED-

I made in a trigger's condition "NOT (alive unitname)" and synched the waypoint. Not to make the limo raced by second HMMWV I added to second HMMWV in the init field "this commandfollow vehiclename; this commandfollow unitname" and made a resistance driver and grouped it to west leader.

Problem 4:

I got even another mission. I got a convoy of seven HMMWVs moving along the road, and they are supposed to be attacked by a couple of troops. Problem is: if at least single buller hits the HMMWV, all the passengers get out and engage in combat (they are not grouped to any part of the convoy's drivers, nor their leaders). Should I make smaller groups of let's say 3 HMMWVs and assign every passenger to commander or is any other way round?

-SOLVED-

Make one of the passengers a leader and give him a get out (synchronised) waypoint, where HMMWVs will stop, and for it set behaviour to careless. Simple.com!

Problem 5:

Here's my more recent mission. My men go out on patrol, they shoot few Naval Infantrymen, then they get a call from a tank, that they were disabled by IED and want me to escort a repair to truck to them. The mission is very short as I don't want repair truck being following the player. Question is: How to UN-join the unit from a team? That it would join a tank is good enough for me.

Problem 6:

Not really a problem, but too many triggers are annoying: How to write condition triger not (alive), without making a trigger for every unit/group? In other words in one single trigger? When I tried to put in condition: not (alive tank1); not (alive tank2),etc (there are 6 empty tanks required to destroy) it gave me an error message.

Above all, thanks for the guys who had patience to help with my editing problems.

Edited by Egodraco

Share this post


Link to post
Share on other sites

Now that I did it, one gets into HMMWV, and the other is forced to run behind it. It looks hilarious, but sad aswell, because it means, I have made something wrong. I am pretty new to the editor. You put it as a trigger or part of a waypoint?

EDIT: I solved the problem, but you guided me on the right lines, Zulu, thanks a lot.

Edited by Egodraco

Share this post


Link to post
Share on other sites
Problem 1:

Problem 3:

There's a third mission, where I made to assasinate a resistance leader, protected by SAS motorcade (and resistance leader's car isdriven by one of those guys). The trigger (square, a axis 5000, b axis 5000) should give me a waypoint, when "Resistance" "Not Present", but even though the car is in the trigger's area, the trigger activates, thinking the leader is dead. How could I do it working properly?

I cant help you with #2 (at least not with some more info) but as for this: Is the reistance leader grouped with the SAS? If he is grouped with them and is not the leader then he will be on the same side as the SAS troops. Essentially, I believe that the group's side is determined by the leader (just a guess)?

Share this post


Link to post
Share on other sites

I made that mission like that:

I grouped drivers and gunners, not passenger soldiers and resistance leader are without any group, essentially the leader is just sitting in the car. Either way, I didn't knew you can group together West/East units with any of Resistance units in OFP. Why I made it like that, is that I wanted the motorcade to follow at a same speed and that essentially the "limo" wouldn't be raced over by what are supposed to be guarding it.

Share this post


Link to post
Share on other sites
I made that mission like that:

I grouped drivers and gunners, not passenger soldiers and resistance leader are without any group, essentially the leader is just sitting in the car. Either way, I didn't knew you can group together West/East units with any of Resistance units in OFP. Why I made it like that, is that I wanted the motorcade to follow at a same speed and that essentially the "limo" wouldn't be raced over by what are supposed to be guarding it.

Hmm...I cant really think of anything off the top of my head. If the resistance leader is not grouped with anyone then there went my theory. Resistance is set to be friendly to west though correct? If they arent, then maybe the SAS is killing him at the start?

Another way to activate the trigger would be to use conditions. For example, name the reistance leader "ResLeader" (you can name him anything you want). Now, in the waypoint that occurs before the waypoint that the trigger is supposed to activate, put this in the condition line:

NOT (alive Resleader)

Therefore, when the resistance leader dies (not alive) the conditions for the waypoint are met and the waypoint next waypoint is revealed.

Hope this helps

Edited by Blitzen

Share this post


Link to post
Share on other sites

Thanks, but is that the exact condition? I keep getting "type bool, expect nothing"

And yes resistance is set to friendly to West.

Share this post


Link to post
Share on other sites
Thanks, but is that the exact condition? I keep getting "type bool, expect nothing"

And yes resistance is set to friendly to West.

I just tested it and it worked for me. Note that you have to name the resistance leader and that the syntax for the NOT command is correct. It needs the paranthesis, etc. Also, it needs to go into the waypoint's condition line.

Share this post


Link to post
Share on other sites

Now it works, but it still immediately switches the waypoint.

Does waypoint condition line looks like (and is that all):

Condition: NOT alive prince

Edited by Egodraco

Share this post


Link to post
Share on other sites
Now it works, but it still immediately switches the waypoint.

Does waypoint condition line looks like (and is that all):

Condition: NOT alive prince

Try NOT (alive prince)

Let me know if that works..

Share this post


Link to post
Share on other sites

For me it needed to add a few init field commands, to make motorcade look orderly and make a conditioned trigger (the way you shown me). Now it works beautiful. Thanks a lot for your help, Blitzen!

Share this post


Link to post
Share on other sites

No problem! Good luck with your missions and I hope someone comes along to help you with #2

:yay:

Share this post


Link to post
Share on other sites

There's another half-related problem:

Do you remember how to use OFPEditing? The application which creates mission briefings, because I get that "file is already open message". I know it is something simple and I was used to use it, but I completely forgot it by now.

Share this post


Link to post
Share on other sites
There's another half-related problem:

Do you remember how to use OFPEditing? The application which creates mission briefings, because I get that "file is already open message". I know it is something simple and I was used to use it, but I completely forgot it by now.

Someone else will have to help you with that one. I dont know squat about creating mission briefings as I dont feel like my missions are good enough to be released. :crazy_o: Anyways, I believe that there is some sort of template that you can use to create those.

Share this post


Link to post
Share on other sites

Ah, ok, and Q4 (Yea, one day the first post will be LONG, since I will keep it updated, for others' reference in case somebody would get similar problems)? Q4 says:

Problem 4:

I got even another mission. I got a convoy of seven HMMWVs moving along the road, and they are supposed to be attacked by a couple of troops. Problem is: if at least single buller hits the HMMWV, all the passengers get out and engage in combat (they are not grouped to any part of the convoy's drivers, nor their leaders). Should I make smaller groups of let's say 3 HMMWVs and assign every passenger to commander or is any other way round?

Share this post


Link to post
Share on other sites
Should I make smaller groups of let's say 3 HMMWVs and assign every passenger to commander or is any other way round?

it makes no difference how many HMMWVs you have. what happens is that the leader of the passenger group detects a threat and orders his units to unload and engage (if they are grouped, otherwise each units does it on it's own). once the unload order is given the HMMWV driver stops until the passengers are off, regardless if they belong to another group, and then continues on with his waypoints.

what you need to do is put the passengers into a couple of groups and set them to careless while they are inside the HMMWVs. 7 HMMWVs with 3 passengers each is 21 units so you'll need at least two groups.

a simple way to do it without triggers is to make a script and run this from the init line of each group leader

"_x exec {nameOfScript.sqs}" forEach units group this

the script should look something like this

#start
@vehicle _this != _this
_this setBehaviour "Careless"
@vehice _this == _this
_this setBehaviour "Aware"
goto "start"

this way the passengers inside the vehicles won't give a shit while inside, but will revert to aware mode once outside. One bug you might get (not sure cause I didn't test it) is if the leader is inside a vehicle he might set the behavior to careless for the entire group, even if some of the units are outside and should be aware. I think changing the leader's behavior changes the entire groups behavior but I don't really remember. you're gonna have to test it yourself...

Edited by SilverRanger

Share this post


Link to post
Share on other sites

hi,

Problem 2:

Another bug: In another mission, I make a blackhawk takeoff and head for a spot to unload troops, but when it gets into spot, it just floats in the air (unless I eject, then it starts to land). Yes, again synchronised, I tried both Unload and Unload Transport Cargo command, but the result is all the same (I placed an unload waypoint on road and with invisible H, but no effect, whatsoever). It does not use default crew (as it should be spawned with). Any help?

Choppers in ofp are a pain in the ass and are not 100% reliable. It also depend of your computer speed.

Here's a script to make a chopper move to an insertion point and unload the group in his cargo. This script is SP/MP friendly and can be used with multiple choppers at the same time. This script doesn't need waypoints or triggers.

chopperName=name of the chopper

Height=the height the chopper will fly after it has unloaded his cargo

groupName=the name of the group in cargo. To give a name to a group put in the initfield of every member (more safety for MP compatibility) GroupName=group this groupName is whatever you want WestGrp1 for example.

invisibleHname=invisible H name where the chopper will land. Can be found in empty/objects.

gamelogicName=Name of the gamelogic to make the chopper move after it has unloaded his cargo.

NB: the variable start_chopper must be turned to true start_chopper=true when you want that the chopper perform the insertion. It can be done with a script like this:

init.sqs

;-----------------------------------------------------------------------------------------
; Name of the players
;-----------------------------------------------------------------------------------------
nik_players=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12]
;-----------------------------------------------------------------------------------------
; Insertion chopper
;-----------------------------------------------------------------------------------------
start_chopper=false
[chop1,30,WestGrp1,H_1,gl_ins1] exec "Insertion.sqs"
;-----------------------------------------------------------------------------------------
; Check if all units are in the chopper
;-----------------------------------------------------------------------------------------
[chop1] exec "All_In.sqs"
exit

All_In.sqs

;[chopperName] exec "All_In.sqs"
if (local server) then {} else {goto "Ende"}
_chop = _this select 0

#getin
~2
_icount=0
_num=0
"if (alive _x) then {_num = _num + 1}" foreach nik_players
"if (vehicle _x == _chop) then {_icount = _icount + 1}" foreach nik_players
if (_icount == _num)  then {goto "takeoff"} else {goto "getin"}

#takeoff
~2
start_chopper=true; publicVariable "start_chopper"

#Ende
exit

Insertion.sqs

;[chopperName,Height,groupName,invisibleHname,gamelogicName] exec "insertion.sqs"
;example: [chop1,50,WestGrp1,H_1,gl_ins1] exec "insertion.sqs"

if (local server) then {} else {goto "Ende"}

@ start_chopper

_chop = _this select 0
_h    = _this select 1
_grp  = _this select 2
_pad  = _this select 3
_gl   = _this select 4

_units = Units _grp
_i = 0
_j = count _units
_c = 0
_pospad=getPos _pad
_posgl=getPos _gl

_chop setCaptive true
_chop setBehaviour "CARELESS"
_chop setCombatMode "BLUE"

_chop doMove _pospad
~0.5

#dist
~2
if (_chop distance _pad>=500) then {goto "dist"}

#brake
_s = speed _chop
if (_s < 90) then {goto "land"}
_f = ((_s - 10) / _s)
_vel = velocity _chop
_chop setvelocity[(_vel select 0) * _f, (_vel select 1) * _f, (_vel select 2) * _f]
~0.1
_c = _c + 0.1
if (_c < 3) then {goto "brake"}
~1

#land
_chop flyInHeight 1; _chop land "get out"; _smokes="smokeShellRed" createVehicle _pospad

@ (getPos _chop select 2 < 1.5)
~1
_ac="GETOUT"

#next
(_units select _i) action [_ac,_chop]
unassignVehicle (_units select _i)
_i=_i+1
~0.5
if (_j>_i) then {goto "next"}
~5
_chop flyInHeight _h; _chop doMove _posgl; _chop setSpeedMode "FULL"

@ UnitReady _chop

[_chop] exec "Del_vehicle.sqs"
{[_x] exec "Del_Trig.sqs"} forEach [_h,_gl]

#Ende
exit

A little script to delete the chopper after it has done his job. It saves performance in the mission.

Del_vehicle.sqs

;[chopperName] exec "Del_vehicle.sqs"
if (local server) then {} else {goto "Ende"}
_v = _this select 0
_d=driver _v
_g=gunner _v
_c=commander _v
_all=[_v,_d,_g,_c]
~30
{deleteVehicle _x} forEach _all

#Ende
exit

A little script to delete all related insertion stuffs like invisible H and gamelogic. This script can be used to delete triggers aswell.

Del_Trig.sqs

; [unitName] exec "Del_Trig.sqs"
if (local server) then {} else {goto "Ende"}
_t = _this select 0
~60
deleteVehicle _t

#Ende
exit

Copy and paste those scripts in the notepad, don't forget to save them .sqs and not .txt, and put them in your mission folder.

IMPORTANT: don't forget to put a gamelogic named server somewhere in your mission.

Good luck with choppers in ofp you will need it. :D

cya.

Nikiller.

Edited by Nikiller
corrected a little error

Share this post


Link to post
Share on other sites

Sorry guys for not being on for a few days. I not always have internet, but here is my reply:

TO: SilverRanger: It sounds pretty good. Well, over time I was away, I figured that out myself. Now that question sounds pretty stupid to me. All I did was making passengers one group and drivers/gunners the other, then I just simply placed the waypoints, to change their behaviour to careless and that was it. Good info, thou.

TO: Nikiller: I only learn scripts so far (and didn't tested any yet), and usually what I do is writing on-activation and condition fields... But I still might try something like this, I guess... It works with default helipocter crew 100% and perfect without any scripts. With changed... Disaster. I guess it has to do with one of incompatibilities when making an empty chopper with custom crew today I will try my own simple scripting, and when I will have a comprehensive idea of what I am doing I shall follow your advice. Thanks. I will update my first post now. Also here are more problems (wonder if I will run out of those, whether I will ask you how to solve real-life problems? JOKING:)).

Problem 5:

Here's my more recent mission. My men go out on patrol, they shoot few Naval Infantrymen, then they get a call from a tank, that they were disabled by IED and want me to escort a repair to truck to them. The mission is very short as I don't want repair truck being following the player. Question is: How to UN-join the unit from a team? That it would join a tank is good enough for me.

Problem 6:

Not really a problem, but too many triggers are annoying: How to write condition triger not (alive), without making a trigger for every unit/group? In other words in one single trigger? When I tried to put in condition: not (alive tank1); not (alive tank2),etc (there are 6 empty tanks required to destroy) it gave me an error message.

Thanks to all of you guys, for your support and patience.

-Simon

Edited by Egodraco

Share this post


Link to post
Share on other sites

hi,

Problem 5:

Here's my more recent mission. My men go out on patrol, they shoot few Naval Infantrymen, then they get a call from a tank, that they were disabled by IED and want me to escort a repair to truck to them. The mission is very short as I don't want repair truck being following the player. Question is: How to UN-join the unit from a team? That it would join a tank is good enough for me.

I don't fully understand what do you want here but here's the command to unjoin a unit from his group

UnitName join grpNull

Problem 6:

Not really a problem, but too many triggers are annoying: How to write condition triger not (alive), without making a trigger for every unit/group? In other words in one single trigger? When I tried to put in condition: not (alive tank1); not (alive tank2),etc (there are 6 empty tanks required to destroy) it gave me an error message.

Here's a script SP/MP friendly to check if your tanks are alive:

init.sqs

;-----------------------------------------------------------------------------------------
; Check if all tanks are dead
;-----------------------------------------------------------------------------------------
[] exec "check_tank.sqs"
exit

check_tank.sqs

alltankdead=false
~2
if (local server) {} else {goto "Ende"}
~20
_tank=[tank1,tank2,,tank3,tank4,tank5,tank6]
~3
_a=[]
{if (alive _x) then {_a=_a+[_x]}} foreach _tank

# Loop
~5
if ({alive _x} count _a > 0) then {goto "Loop"}
~2
alltankdead=true; publicVariable "alltankdead"

#Ende
exit

Copy and paste those scripts in the notepad as .sqs and put them in your mission folder.

Put in your trigger condition alltankdead and a game logic named server somewhere in your mission.

Another way but more performance hungry and can fail in MP is to put in your trigger condition:

!(alive tank1) && !(alive tank2) && !(alive tank3) && !(alive tank4) && !(alive tank5) && !(alive tank6)

cya.

Nikiller.

Edited by 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

×