Jump to content

Horrace

Member
  • Content Count

    38
  • Joined

  • Last visited

  • Medals

Posts posted by Horrace


  1. It is possible to avoid using EXECS system by running two ArmA clients and joining the same server on your PC (could hurt performance). You do changes in one program and switch to the other see the if those changes are broadcast.

    Could you explain how to do this?

    Many thanks.

    ---------- Post added at 03:19 PM ---------- Previous post was at 03:10 PM ----------

    Sorry I just read your post about reportIp = "<>"; will that remove the duplicate client check then? I can't test at the moment.


  2. Here ya go.

    The original area.sqf had "Danger" had to change to "Sign_Danger" (for Arma 2)

    //3rd - y axis
    //4th - how many tables (markers) have to be placed
    //5th - angle of elipse
    
    _xPos = position (_this select 0) select 0;
    _yPos = position (_this select 0) select 1;
    
    _howBigA = _this select 1;
    _howBigB = _this select 2;
    _tablesC = _this select 3;
    _angle = _this select 4;
    
    _i = 0;
    
    while {_i < 360} do {
    _x = (_howBigA * (sin _i));
    _y = (_howBigB * (cos _i));
    _x_rot = _xPos + _x*(cos _angle) - _y*(sin _angle);
    _y_rot = _yPos + _x*(sin _angle) + _y*(cos _angle);
    _k = createVehicle ["Sign_Danger",[_x_rot, _y_rot,0], [], 0, "NONE"];
    _m = createMarker [format ["Marker" + str _i],[ _x_rot, _y_rot,0]];
    format ["Marker" + str _i] setMarkerType "Dot";
    _k setDir _i;
    format ["Marker" + str _i] setMarkerDir (_i - _angle);
    _i = _i + (360/_tablesC);
    };

    Oh and if you are after some sort of mine field once someone crosses the border, you'll need to setup some triggers.


  3. So the difference between createVehicle and createVehicleLocal is that createVehicle will propagate said object accross all MP machines? Will that be regardless of the machine it was called from?

    I also found this info on the Biki for createVehicleLocal "If the object that is created is of the type ammo, then it will created on all clients (tested only on VBS2)." Does that mean it will be created on all clients if run from the server or does it not matter which machine?

    MP Scripting = :confused: ;)


  4. Even without any code I can't access the crate but only when the mission is running on a dedicated server.

    If I start a new mission from scratch in the editor and place a player soldier and a US Basic Weapon crate, no init line or anything. When I preview it I can access the weapons that come default with that crate.

    If I then run the mission on a dedicated server I get no option to access the crate... The funny thing is, if I add an AI unit he will run over to the crate and crouch as if he is accessing the crate!?

    Are the crate contents only registered server side?


  5. Hi,

    I have some code that executes only on the server that randomly moves ammo crates around the map every 3 - 5 minutes.

    But for some reason once they've moved you can no longer access their contents.

    Any ideas?

    Regards,

    EDIT : Looks like I can't access the crates anyway. Even if I just drop a crate in from the editor. This only happens from a Dedi server by the way.


  6. Hi,

    I have a WIP DM mission that I'm having a few problems with.

    My init.sqf looks like this

    _units = [s1,s2,s3,s4,s5,s6];
    
    // 1st
    // add "killed" event handlers to each unit
    { _x addEventHandler ["killed", {nul=_this execVM "scripts\respawn.sqf"}]; } forEach _units;
    
    // 2nd
    // give random weapons to each unit
    { nul=[_x] execVM "scripts\randomweapons.sqf"; } forEach _units;

    I have read through some things in the BIKI about MP scripting and also 6thSense page on the BIKI but still need a few things clearing up.

    My questions are :

    1. Is it correct that that init.sqf runs on the server and then on each client and then for each JIP player?

    2. If so will the first piece of code add an extra event hander to every player/AI everytime someone JIPs? ( not good if true )

    3. Is it possible / are you supposed to add event handlers from the server?

    4. If I add an event handler to a unit that is initially controlled by AI and then a player JIPs and takes over that AI unit, will the player take on that eventhandler or will it be lost?

    5. When a player JIPs and takes over an AI unit. Is there an initial moment where (isPlayer unit) will return false?

    6. Can you check for (isPlayer unit) on the server?

    7. When you addWeapon to a player are you supposed to do that from the client or from the server?

    8. When you add a trigger in the editor. Does this trigger fire on the server aswell as each client? If so is it ok to use isServer in the condition field?

    Many thanks!


  7. Sorry I did ask this in another post but it's lost in a sea of topics now :(

    In my DM mission I have only added units set as playable ( which I believe is the correct way? )

    When the mission starts the player isn't given any weapons for some reason, however, any AI that are playing do seem to be given the weapons from the script.

    As a test I just replaced _unit with player in the script and now the player will be given the weapons but the AI not...

    This one is driving me mad.


  8. Hi,

    I've got a DM mission setup and I have 6 units set as playable.

    This code is set to run from the init line of each unit.

    _unit = _this select 0;
    
    removeAllWeapons _unit;
    
    switch (floor random 4) do
    {
    case 0:
    {
    	_unit addMagazine	"30Rnd_762x39_AK47";
    	_unit addMagazine	"30Rnd_762x39_AK47";
    	_unit addMagazine	"30Rnd_762x39_AK47";
    	_unit addWeapon	"AK_47_M";
    	_unit selectWeapon "AK_47_M";
    };
    case 1:
    {
    	_unit addMagazine	"30Rnd_556x45_Stanag";
    	_unit addMagazine	"30Rnd_556x45_Stanag";
    	_unit addMagazine	"30Rnd_556x45_Stanag";
    	_unit addWeapon	"M4A1";
    	_unit selectWeapon "M4A1";
    };
    case 2:
    {
    	_unit addMagazine	"30Rnd_556x45_Stanag";
    	_unit addMagazine	"30Rnd_556x45_Stanag";
    	_unit addMagazine	"30Rnd_556x45_Stanag";
    	_unit addWeapon	"M16A4";
    	_unit selectWeapon "M16A4";
    };
    case 3:
    {
    	_unit addMagazine	"30Rnd_545x39_AK";
    	_unit addMagazine	"30Rnd_545x39_AK";
    	_unit addMagazine	"30Rnd_545x39_AK";
    	_unit addWeapon	"AK_74";
    	_unit selectWeapon "AK_74";
    };
    };

    For some reason it only gives the weapons to the AI but not the player.

    Can you help?

    Regards,

×