Spikekid 0 Posted March 14, 2006 I want a script who can spawn friendly soldiers(parachuting) and join them to me. I want to activate that with the radio (0-0-1). So when I call the command 0-0-1 there will be parachuting frendly soldiers coming to join me(Repidiately)! Is that possible and how can I do it?? Singleplayer!!! 10x Share this post Link to post Share on other sites
Spikekid 0 Posted March 15, 2006 Guys, I realy need that one. Im part of the ofp comunity too, so please help me with that script! Share this post Link to post Share on other sites
thobson 38 Posted March 15, 2006 A couple of points: 1. < 24 hours is not overlong to have to wait 2. I am not clear how much help you need. I presume you know how to create a repeating 0-0-1 radio trigger and to make it run a script. The script should: - create a parachute at the location you want  - do you know how to do this? - create a soldier - do you know how to do this? - put the soldier into the parachute using the command moveInDriver - do you know how to do that? - the soldier should then join you [unitname] join player You see the problem?  Someone could spend quite a long time explaining a lot of stuff to you that you already know - and so waste their own time. I think you would get a better response if you asked these questions individually.  I presume you don't want someone to write the whole script fo you - that would be like making a meal but subcontracting the cooking , and where's the fun in that? Share this post Link to post Share on other sites
5133p39 14 Posted March 15, 2006 i think that you would certainly found the answer if you would search the forums - and that's probably the case nobody posted the answer to your question yet, but here it goes: Make a 'repetitive' trigger activated by "RADIO ALPHA", and put the following into it's "On activation" field: [] exec "paradrop.sqs" Then into the misison init.sqs script, put this line: 1 SetRadioMsg "Call in the reinforcements" Now make a script named "paradrop.sqs" which contains this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? ParaInProgress : exit ParaInProgress = true _i = Count Units Group Player _grp = Group Player #drop ? _i > 11 : ParaInProgress = false; exit _x = (getPos Player select 0) - 150 + Random 300 _y = (getPos Player select 1) - 150 + Random 300 _z = 200 PARA = "ParachuteWest" CreateVehicle [_x,_y,_z] "SoldierWB" CreateUnit [[_x,_y,_z], _grp, "this moveInDriver PARA", Random 1, "PRIVATE"] PARA setPos [_x,_y,150] ~.1 _i = _i + 1 goto "drop" Share this post Link to post Share on other sites
SoldierIsNotHistory 0 Posted March 15, 2006 Create a radio trigger which calls this script. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;[group] exec "paraBackup.sqs" ;group: name of group to join ;init _grp = _this select 0 _nbFreeSlot = 12 - (count units _grp) _x = -60 _y = -60 ;call backup creating unit #backup _unit = "ParachuteWest" createVehicle [(getPos leader _grp select 0)+_x,(getPos leader _grp select 1)+_y,200] "SoldierWB" createUnit [[(getPos leader _grp select 0)+_x,(getPos leader _grp select 1)+_y,200], _grp] nearestObject [_unit, "SoldierWB"] moveInDriver _unit _nbFreeSlot = _nbFreeSlot -1 _x = _x + 10 _y = _y + 10 ~1 ?(_nbFreeSlot > 0):goto "backup" exit I wrote this quickly, so i am not sure it works, but you can modify it and clear bugs... I think it's the way to solve your problem. Share this post Link to post Share on other sites
Spikekid 0 Posted March 15, 2006 Yeah It works. Im very very grateful to you!! Share this post Link to post Share on other sites
Spikekid 0 Posted March 21, 2006 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? ParaInProgress : exitParaInProgress = true _i = Count Units Group Player _grp = Group Player #drop ? _i > 11 : ParaInProgress = false; exit _x = (getPos Player select 0) - 150 + Random 300 _y = (getPos Player select 1) - 150 + Random 300 _z = 200 PARA = "ParachuteWest" CreateVehicle [_x,_y,_z] "SoldierWB" CreateUnit [[_x,_y,_z], _grp, "this moveInDriver PARA", Random 1, "PRIVATE"] PARA setPos [_x,_y,150] ~.1 _i = _i + 1 goto "drop" How can I spawn random soldiers?(LAW,granade,MG) Share this post Link to post Share on other sites
XCess 0 Posted March 21, 2006 try making an array of the different classnames (which I don't know so I'm just going top put an example: //////////////////////////////////////////////////// _unitArray = [soldier,soldierLaw,soldierMG,Engineer,Medic] _Ax = 1+ random 4 _unit = _unitArray select _Ax _unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver PARA", Random 1, "PRIVATE"] PARA setPos [_x,_y,150] ///////////////////////////////////////////////////// This is totally untested If it doesn't work the first thing I'd suggest is speech marks in every classname in the array. also, you will need to change the classnames in the array for their real in game counterparts.. those were just an example. Search around for COMREF and you will find a list of all classnames. Share this post Link to post Share on other sites
Spikekid 0 Posted March 21, 2006 ? ParaInProgress : exit ParaInProgress = true _i = Count Units Group Player _grp = Group Player #drop ? _i > 11 : ParaInProgress = false; exit _x = (getPos Player select 0) - 150 + Random 300 _y = (getPos Player select 1) - 150 + Random 300 _z = 200 _x = 1+ random 4 _unit = _unitArray select _x _unitArray = ["SoldierWB","SoldierWLaw","SoldierWMG","SoldierWMiner& quot;,"SoldierWMedic"] PARA = "ParachuteWest" CreateVehicle [_x,_y,_z] _unit CreateUnit [[_x,_y,_z], _grp, "this moveInDriver PARA", Random 1, "PRIVATE"] PARA setPos [_x,_y,150] ~.1 _i = _i + 1 goto "drop" /////////////////////////////////////////////////////////// This is my .sqs file! As you see I fixed the class names. Now when I call the radio I see the soldiers in my command window,but they are somewhere in A55! Where is the problem? Share this post Link to post Share on other sites
XCess 0 Posted March 21, 2006 SpikeKid, you would have a conflict between the postion varibale _x and the array selector variable _X. Rename the array selector variable to _Ax. _Ax = 1+ random 4 _unit = _unitArray select _Ax So I'm guessing my script worked.. I've been writing mainly in theory the past few days since I haven't actually been into ofp.. might implement a couple of the scripts I've created for others into my invasion mission.. Share this post Link to post Share on other sites
Spikekid 0 Posted March 21, 2006 SpikeKid, you would have a conflict between the postion varibale _x and the array selector variable _X. Rename the array selector variable to _Ax. _Ax = 1+ random 4 _unit = _unitArray select _Ax So I'm guessing my script worked.. I've been writing mainly in theory the past few days since I haven't actually been into ofp.. might implement a couple of the scripts I've created for others into my invasion mission.. Yeah Its all right now. Thank you for everything you did for me. Only one question remains now - I wanna spawn only one medic in the group? How can I do that? Share this post Link to post Share on other sites
XCess 0 Posted March 21, 2006 take medic out of the array and create him without any randomness. Create the medic before the others or after, and make sure it's not in the loop. Share this post Link to post Share on other sites