Jump to content

Padjur

Member
  • Content Count

    94
  • Joined

  • Last visited

  • Medals

Posts posted by Padjur


  1. I now save my notepad text files as "all" file type and its saves them as an .sqs file properly now instead of a .sqs.txt

    This is also required when saving a file, of any type other than txt, in XP as well.

    Does Vista not allow you to uncheck the "Hide extensions for known file types" box in Folder Options (as in XP)? By doing so it will help avoid such errors by showing you exactly what the file extension is when saved.

    As for Windows 7? XP pro is still their best O/S I think but at least Windows 7 uses 2/3 less RAM (so your already on a winner over Vista), .


  2. The method that Tayln describes comes from Carrier Domination so its well tested, maybe the script spawns quicker or something. Myke's addon uses the same script (by armatech) so yea it should do the same job, maybe you could pm Myke about the issue, he'd be the best man to ask.

    For myself I'm with Talyn when it comes to not having or avoiding the need for clients to have addons,

    so I use scripts whenever I can unless its something like the Chinook, which is a great aircraft to have available.


  3. Tried search?

    You need to be a bit more precise in the question I think if you want an answer. When you say

    two 'playable' squads on our side
    what do you mean exactly; Are all the squad members playable or do you mean the squad leaders? Did you create them in the editor using groups or are they spawned by script? Are you hosting when your mate is trying to lead a squad?

  4. Thanks for the info Big_Daddy & tcp, very much appreciated.

    For what it is worth (probably in attempt to show I didn't dream it up) I got the idea you should not use

    if (!isServer) exitWith {};

    from a post by Big Dawg KS at the bottom of this page http://forums.bistudio.com/showthread.php?t=77397&highlight=(isserver)+exitwith+{};&page=3

    I see that in the BIKI in entry for isServer it gives, as the example the above code. I'm not being argumentative here you understand, I just want to get your opinion on it.

    I would have thought it would be better (especially if you are new to scripting) if it were put this way as a general rule.

     if (isserver) then {//do stuff on server only};

    Whereas exitWith would seem to have a more advanced use such as this (in mado's heliroute)

    if (!local _heli) exitWith {hint "mando_heliroute: vehicle must be local";};

    I realise this is not moving us towards a solution to your problem here ethne, sorry.

    I have my own HALO script that works but I haven't tested it on a dedicated server, so would be very interested if one could be found.


  5. Well I don't know why, as such Muklor, as I am not an expert

    but I understand, reading from the wikki http://community.bistudio.com/wiki/exitWith, that

    exitWith exits the execution of a loop defined by one of commands do, for, count or forEach.

    When you use exitWith not inside a loops, the behaviour is undefined - sometimes it may exit the script, sometimes some other scope

    but this is not intended and designed behaviour of this command, and it is not guaranteed to work reliably.

    It exits the loop only, not the script.

    I also remember reading several months ago in other threads reading the information that shk posted in this thread.

    I am of course prepared to be corrected (and if so would much appreciate it)

    especially if I have failed to understand the wikki entry properly but it certainly seems clear enough don't you think?


  6. As I understand it

    if (isserver) then {

    //do stuff on server only

    };

    effectively means, if this is the server then execute the script and that therefore if this is not the server, then do not execute the script.

    Conversely:

    if (!isServer) exitWith {};

    means if this is not the server then exit the script (which is more a sqs script method than sqf) but I am sure I have read that

    using this method can cause problems with certain scripts. Which is what I think you mean shk when you say not designed for?

    It would help to see the whole script and how you call it though.


  7. This is were you put the sqf file Romes.

    C:\Documents and Settings\(your) "User Name"\My Documents\ArmA 2\MPMissions OR missions folder\(the) "Mission Name Folder"
    Which is the normal path to the mission folder which should have inside it at least a mission SQM file.

    This is where all the sqf files, the int.sqf file, the description EXT.file and any other file relating to the mission must go.

    You should then be able to load this file from the editor preview, by calling the script as Tajin instructs.


  8. Place an empty marker on the editor and name it, for example: mkrObj3. Now in the missions folder you should have a folder named Briefings in which you should have your Briefing.sqf which is called at the start. make a new sqf file for example NewOrders.sqf.

    tskObj3 = player createSimpleTask ["Got another job for you"];
    
    
    tskObj3	setSimpleTaskDescription ["Your not finished yet lads
    go kill some more Dudes", "Got another job for you", "More stuff to Do"]; 
    
    //sets a marker on the map
    tskObj3 setSimpleTaskDestination (getMarkerPos "mkrObj3");
    
    player setCurrentTask tskObj3;

    and call it with a trigger condition e.g:

    taskCompleted tskObj1 AND taskCompleted tskObj2;

    and On Act

    nul=[] execVM "Briefings\NewOrders.sqf";

    or you could call in a waypoint if you want. So on activation what you get is, in the map a new task called "Got another job for you" and objective maker which is set as the current task and the HUD title "More stuff to Do" in game.


  9. Here is a basic script to get you started and more detail here http://forums.bistudio.com/showthread.php?t=80146&page=3

    if (isServer) then {
    
    GrpC130=CreateGroup WEST;
    C1= createvehicle ["C130J",[(getmarkerpos "C1Spawn") select 0, 	(getmarkerpos "C1Spawn") select 1,0], [],0,"FLY"];
    C1 flyinHeight 250;
    
    Pilot1=GrpC130 createunit ["USMC_Soldier_Pilot", [0,0,1], [], 0, 	"CAN_COLLIDE"];
    Pilot1 moveInDriver C1;
    Pilot1 flyInHeight 250;
    
    wp0=GrpC130 addwaypoint [(getmarkerpos "wp0") ,200];
    wp0 setwaypointspeed "FULL";
    wp0 setwaypointtype "MOVE";
    
    wp1=GrpC130 addwaypoint [(getmarkerpos "wp1") ,200];
    wp1 setwaypointspeed "FULL";
    wp1 setwaypointtype "MOVE";
    
    squad1=creategroup WEST;	
    for [{_i = 0}, {_i <= 24}, {_i = _i + 1}] do
    {
    _unit= squad1 createUnit ["USMC_Soldier", [0,0,2], [], 0, "form"];
    };
    {_x moveInCargo c1} foreach units squad1;
    };


  10. No I include the waypoints in the spawn script, just a move waypoint or two,when the chopper reaches the LZ a trigger calls the heli.sqf. , which brings it down to 2 meters (which is very nearly landing) and animates the ramp. You can then use the action menu to get in the chopper which then adds the action to get in the hummer and calls the unload.sqf which moves you into the hummer and lets you back it down the ramp and away from the chopper.

    if (isServer) then {
    RAF2=createGroup WEST;
    CM2= createVehicle ["RAF_Chin47",[(getmarkerpos "Ch2Spawn") select 0,(getmarkerpos "Ch2Spawn") select 1,0], [],0,"FLY"];
    CM2 allowDamage false;
    CM2 setSkill 1;
    
    p1=RAF2 createunit ["USMC_Soldier_Pilot", [0,0,1], [], 0, 	"CAN_COLLIDE"];
    p1 moveInDriver CM2;
    p1 setRank "COLONEL";
    
    
    p2=RAF2 createunit ["USMC_Soldier_Pilot", [0,0,2], [], 0, 	"CAN_COLLIDE"];
    p2 moveInCargo CM2;
    
    p3=RAF2 createunit ["USMC_Soldier_Pilot", [0,0,3], [], 0, 	"CAN_COLLIDE"];
    p3 moveInGunner CM2;
    sleep 2;
    
    Hu1=createGroup WEST;
    	Hume = "HMMWV" createVehicle getmarkerpos  "Huspawn";
    
    Hume attachTo [CM2,[0,0,0]];
    Hume allowDamage false;
    
    
    
    _waypoint0 = RAF2 addwaypoint[getmarkerpos"plot1",0];
    _waypoint0 setwaypointtype"Move";
    _waypoint0 setWaypointBehaviour "CARELESS";
    _waypoint0 setWaypointSpeed"NORMAL";
    
    _waypoint1 = RAF2 addwaypoint[getmarkerpos"Evac2",0];
    _waypoint1 setwaypointtype"Move";
    _waypoint1 setWaypointBehaviour "CARELESS";
    _waypoint1 setWaypointSpeed"LIMITED";
    
    
    };

    (I put the extra crew man so that when you get in the chopper you go to the cargo bay and not the front seat)


  11. Not sure what your wanting to do exactly but here's an example I have made for myself. I created a _helo with a script that include's

    _helo allowDamage false;

    to call a Chinook and with a separate createGroup a Hummer with

    _Hume attachTo [_helo,[0,0,0]];
    _Hume allowDamage false

    that sticks the hummer in the Chinook; Now! to get the hummer out at the LZ I used a script derived from one of JDog's

    heli.sqf

    if (isServer) then {
    _heli = _this select 0;
    _car = _this select 1;
    	_heli flyInHeight 2.25;
    	_heli animate ["Ani_Ramp",1];
    	_action = _heli addAction ["Move in Car", "unload.sqf", _car, 6, true, true, "", "_this in _target"];
    };
    

    unload.sqf

     if (isServer) then {
    
    _object = _this select 0;
    _caller = _this select 1;
    _id = _this select 2;
    _car = _this select 3;
    _object removeAction _id;
    _caller setPos position _caller;
    _caller moveIndriver _car;
    detach _car;
    
    sleep 15;
    _car allowDamage true;
    };
    

    This makes the Chinook hoover just above the ground so you can get in the choper and then the hummer and drive the hummer out of the chooper.

    for more see the http://forums.bistudio.com/showthread.php?t=73630&highlight=Practical+attachTo+command or countless other threads to do with attachTo


  12. I read somewhere but cannot remember where,

    (found the link :) http://community.bistudio.com/wiki/Locality_in_Multiplayer )

    A unit can change it's locality for example units or players entering or exiting vehicles. I'm not a 100% sure of the effects of locality, I know that if I spawn a chopper with a script and give it a global group name for example Chop1 and use joinSilent as in

     [unitArray] joinSilent chop1;
    {_x assignAsCargo chop1} foreach units [unitArray];
    [unitArray]orderGetIn true;

    It works. But what I haven't worked out is how to get the units to board a vehicle if I make the group of the vehicle local in the script e.g. _grp Ive tried putting

    	_grp = _this select 0;
    _veh = _this select 1;
    _grp= createGroup EAST;

    and calling the script with

    null= [A,jeep] execVM "Insconvoy1.sqf";
    [b]and then in a trigger[/b]
    [POW1,Guard,Guard] joinSilent A; 
    {_x assignascargo jeep} forEach [POW1,Guard,Guard];
    [POW1,Guard,Guard] orderGetIn true;

    but that doesn't work:stuck: back to search button unless a wise one can shed some light?

    But nothing new that scripted stuff doesnt behave like editor-placed stuff. :)

  13. Ah OK I see what your saying, thanks for the explanation. Question on the waypoints though

    you have

    	wp1 = TeamAlpha1 addwaypoint [position player, 0];
    TeamAlpha1 setbehaviour "aware";
    wp1 setwaypointtype "SAD";

    In the Wiki it says

    Syntax:waypoint setWaypointBehaviour mode

    Parameters:waypoint: Array - format Waypoint

    Where format for waypoint is [group, index]. Also in the Wiki it has the same Syntax

    for setwaypointtype. But you use wp1 :confused:

    To be perfectly honest this has puzzled me considerably over the past weeks.

    Example: In the wiki it gives as an example

    [_grp, 2] setWaypointBehaviour "AWARE"

    whereas you are using

     TeamAlpha1 setbehaviour "aware";

    and you use

    wp1 setwaypointtype "SAD";

    Where as in the Wiki it gives

     [_grp, 2]setwaypointtype "SAD";

    Any insight on this would much improve my sleep patterns, many thanks.


  14. I've been trying to make a sqf script for a convoy, with mixed results, but I'll post it anyway, see what you think.

    Any help, suggestions, improvements very welcome. :)

    First my sqf script based on Rohrkrepierer's sqs.

    I'm quite pleased with the results with this, seems to keep them in the proper station for the convoy.

    station.sqf

    if (isServer) then {
    
    _Veh1 = _this select 0;
    _Veh2 = _this select 1;
    
    while {true} do
    {
    	if ((_Veh2 distance _Veh1) >=10) then
    	{
    		if ((_Veh2 distance _Veh1) <30) then
    		{
    			_Veh2 limitSpeed 5;
    		}
    		else
    		{
    			_Veh2 forceSpeed -1;
    		};
    	}
    	else
    	{
    			 _Veh2 stop true;
    	};
    };
    };

    Now the second script which makes the convoy (inside the spoiler). I decided to spawn the vehicles with a script rather than place them in the Editor

    because I can create the convoy in one spot, instead of making a long line of vehicles etc.

    Place two markers name them (start and Fini) with axis a & b at 0 (put the name in the text box as well so you can find them)

    I tried calling a waypoint script using addWaypoint but they don't complete as well as they do with

    	_Veh doMove (getmarkerpos "Fini");
    _Veh setSpeedMode "LIMITED";

    I also made a "waypoint" script with doMove, to call in the convoy script, which works better.

    But (this is the main problem that I haven't really overcome yet) I find if you try and add any sort of complexity into the route

    then the chances of them messing up increases, but if you needed them to stop for a while you can do that.

    So for simplicities sake I just put a finish marker for the convoy to move to in the convoy.sqf with the above doMove code.

    One problem I did find with this is that if you come to a sharp corner where they can cut across the grass, they will and generally get stuck.

    Otherwise they will follow the main route to the destination. See inside the spoiler for the convoy script.

    convoy.sqf

    if (isServer) then {
    _grp = _this select 0;
    _grp= createGroup WEST;
    
    _Veh = "HMMWV_M2" createVehicle getmarkerpos "start";
    _Drive = _grp createunit ["USMC_Soldier", [0,0,1], [], 0,"NONE"];
    _Gunner =_grp createunit ["USMC_Soldier", [0,0,2], [], 0,"NONE"];
    _Veh setDir 56;//set the vehicle heading
    _Drive  moveInDriver _Veh;
    _Gunner moveInGunner _Veh;
    
    _Veh doMove (getmarkerpos "Fini");//instead of waypoints
    _Veh setSpeedMode "LIMITED";
    sleep 10;//lead vehicle moves of and the second vehicle spawns
    _Veh1 = "MTVR" createVehicle getmarkerpos "start";
    _Drive1 = _grp createunit ["USMC_Soldier", [0,0,1], [], 0,"NONE"];
    _Veh1 setDir 56;
    _Drive1 moveInDriver _Veh1;
    
    _Veh1 doMove (getmarkerpos "Fini");
    _Veh1 setSpeedMode "LIMITED";
    call { [_Veh,_Veh1] execVM "station.sqf"; } ;//calls the station sqf above
    sleep 10;
    _Veh2 = "MTVR" createVehicle getmarkerpos "start";
    _Drive2 = _grp createunit ["USMC_Soldier", [0,0,1], [], 0,"NONE"];
    _Veh2 setDir 56;
    _Drive2 moveInDriver _Veh2;
    
    _Veh2 doMove (getmarkerpos "Fini");
    _Veh2 setSpeedMode "LIMITED";
    call { [_Veh1,_Veh2] execVM "station.sqf"; } ;
    sleep 10;
    _Veh3 = "MTVR" createVehicle getmarkerpos "start";
    _Drive3 = _grp createunit ["USMC_Soldier", [0,0,1], [], 0,"NONE"];
    _Veh3 setDir 56;
    _Drive3 moveInDriver _Veh3;
    
    _Veh3 doMove (getmarkerpos "Fini");
    _Veh3 setSpeedMode "LIMITED";
    
    call { [_Veh2,_Veh3] execVM "station.sqf"; } ;
    //sets group leader and formation
    _Drive setunitrank "SERGEANT";
    _Drive=leader _grp;
    _grp setFormation "COLUMN";
    
    };

×