Forum Jump :

Author Message


Posts: 26
Rank:


Level: Member

Country: us
Location: Dallas, Tx
Occupation:
Age: 49
In-game name:

 
#1 Posted at 2012-03-23 15:36        
     
Game: Armed Assault with Queen's Gambit

My Description.ext looks like this

respawn = "Base";
respawndelay = 5;
onLoadMission = "Combat 101 Sakakah";
showGPS=1;
showCompass=1;
showradio=1;
showNotePad=0;
aikills=1;

class Header
{
        gameType = Team; 
	minPlayers = 1;
	maxPlayers = 20;
};

In the editor I have a trigger set to repeatedly

..there is a trigger like this for each soldier in my squad, EastSlot2 to EastSlot20
all playable, so that they repsawn when they die.

Cond
not alive EastSlot2;

On Act
"E02Mkr" setMarkerColorLocal "ColorBlue";"E02Mkr" setmarkerpos (getpos EastSlot2);
sqf = [EastSlot2] execvm "EAIReset.sqf";

On Dea
sqf = EastSlot2 execvm "gear.sqf";  //Give this unit a random weapon when he becomes alive again

EAIReset.sqf
_Unit= _this select 0;

waitUntil {alive _Unit};

sleep 10;

_Unit setbehaviour "AWARE";

//Assuming the two evac's are sitting on their pads, _HVEH will store the name of the
//closest evac to _Unit, within 100m.
_TempList = (nearestObjects [_Unit, ["PRACS_AB212"], 100]);

//If the above condition is met with results greater than 0...
if (count _TempList > 0) then
{
  //Assign _HVEH the name of the closest evac.
  _HVEH = _TempList select 0;
   sleep 2;

  //Ask politely that _Unit enters into closest evac.
  _Unit assignascargo _HVEH;
  //Give him permission as well
  [_Unit] ordergetin true;

  //Extra
  //shoot _Unit in the head for not obeying me
};

exit

Above referenced PRACS_AB212 is created through an addaction menu which makes a
call to an sqs file named EXS03Heli05.sqs.

_HVEH = "PRACS_AB212" createvehicle getmarkerpos "e1resptmp";

Does anyone know why this works in the editor but not MP...

All I want is when any of the men under me die, and respawn for them to get in either of the
two evac's, and I'll take care of the rest... Any ideals, please?

This post was edited by harold5187 (2012-03-28 22:28, ago)

As many of us do, I as well, come from a Flashpoint, Resistance and Arma background. I was a member of the original DSF clan for about two months, back when Hatcher was in charge, along with Deaddog, Joker, Thatcher, two german dudes, and my callsign was, and still is FullMetal.

Author Message

palyarmerc  

I live inside the editor


Posts: 753
Rank:


Level: Member

Country: uk
Location:
Occupation: *Retired from ArmA*
Age:
In-game name: Paly

 
#2 Posted at 2012-03-23 17:12        
     
Not sure which bit you are saying doesn't work and where (when you say it works in the editor, do you mean on Preview, but not when hosting? - not sure how that would be the case)

Here an example of a similar problem and how I solved it - solution highlighted in bold


the exit is redundant at the end of EAIReset.sqf - or it should be if (true) exitwith{};

Also, the creatVehicle can be fickle in arma depending on the version or the map in use (I have found)
For exapmle I wanted to create a script that placed emty vehciles near every gas station on any map.
It only worked with the Arma1 mod maps for arma2 - arma 2 maps it didn't like it - "cannot create non-ai vehicle"



...so that if I were writing
_HVEH = "PRACS_AB212" createvehicle getmarkerpos "e1resptmp";
it would be written
_HVEH = "PRACS_AB212" createvehicle (getmarkerpos "e1resptmp");

....that's all folks....!

Advertisement


Author Message


Posts: 26
Rank:


Level: Member

Country: us
Location: Dallas, Tx
Occupation:
Age: 49
In-game name:

 
#3 Posted at 2012-03-25 01:57        
     
After many, many hours of coding, trashing, and pumping out regergatated code, mixed with
hours of online reference... I finally figured out what was going on, and would like to
share this solution with everyone else.

If you are reading this now, it only means that you've been everywhere, looking for some
sort of solution.

It's the common Pilot Bug as explained in many other topics here and there.

I advise upon NOT using any of the MoveIn commands, such as MoveInGunner,
MoveInDriver, etc... Or you will be rewritting code as myself, and many others have,
trying to debug your scripts.

IN DETAIL

I had a script that created an "Mi17_MG", afterwhich I created a SoldierEPilot, then I
used the MoveInDriver command, and simple enough, it just teleported him into the pilot
seat. In reality, this is bad, because the AI is totally unaware that he is even in a
vehicle.

So after some time, I decided to add more features to my mission... One such feature
was upon respawn of any of my AI teammates, they would spawn back at base, then
use the Nearestobjects command to look for the nearest object of class "Mi17_MG", at
which time, I would tell the respawning unit to board his respective helicopter,
being Evac1 for soldiers EastSlot2 through EastSlot10, then Evac2 for soldiers
EastSlot11 through EastSlot20.

They would not get into either of the evac's. I rewrote the code, as many times,
testing as many methods as I could, before I realized the MoveInDriver was causing
all my problems.

SOLUTION

I re-edited the file that created the "Mi17_MG", took out the MoveIn commands,
and replaced it with this...

_UnitR action ["getInPilot",_HVEH];
_UnitG action ["getIngunner",_HVEH];

Then I went to my new script, and took out all the MoveInCargo commands,
replaced it with...

_Unit action ["getIncargo",_HVEH];

PROBLEM SOLVED

I hope this helps anyone going through the Pilot Bug...

Sincere thanks to all that have replied to this,

FullMetal

This post was edited by harold5187 (2012-03-25 14:52, ago)

As many of us do, I as well, come from a Flashpoint, Resistance and Arma background. I was a member of the original DSF clan for about two months, back when Hatcher was in charge, along with Deaddog, Joker, Thatcher, two german dudes, and my callsign was, and still is FullMetal.