Jump to content

alexluthor

Member
  • Content Count

    20
  • Joined

  • Last visited

  • Medals

Posts posted by alexluthor


  1. Thanks for the clarification and for the framework. They`ll be good additions to my library : )

    I`ve remembered that I`ve read here that the triggers send the commands to all machines, so I figure it might solve my problem.

    I`ve changed the idea from the addactions to radio activated triggers. For that, I`ve placed the following code into the activation field of a radio activation trigger

    nul = [(Instructor), 8] execVM "ContatoFrente.sqf";

    Whereas Instructor is the name of the Instructor model. And I`ve pretty much copied Kylania`s script as follows.

    if (isServer) then {
    
    // Select instructor and number of enemies
    _sourcePoint = _this select 0;
    _enemyCount = _this select 1;
    
    // Select random enemy position in front of player.
    _randDir = getDir vehicle _sourcePoint - 45;
    _randDir = _randDir + random(90);
    _randDist = (random 100) + 200;
    _enemyLoc =	[(getPos vehicle _sourcePoint select 0) + (_randDist * sin(_randDir)), (getPos vehicle _sourcePoint select 1) + (_randDist * cos(_randDir)), 0];
    
    // Create group and reveal players position
    grp = [_enemyLoc, east, _enemyCount] call BIS_fnc_spawnGroup;
    null = [grp,(getPos vehicle _sourcePoint)] call BIS_fnc_taskAttack;
    grp reveal _sourcePoint;
    
    };

    It is working in my machine again. Once I test it on a dedicated server I`ll post the results below.

    Thanks again for the help.


  2. Guys, I'm having some problems using a script in multiplayer. My intent is to use this on a training mission, where the instructor would be able to spawn units in front of the players in a somewhat random position. He should be able to do it by using an addaction

    I've built a script using samples from Kylania (http://www.kylania.com/site/) and it works fine in my machine, but when I play it on the dedicated server the units never spawn. Below follow the code:

    Addaction placed on the init of the instructor

    this addAction ["ContactFront","ContactFront.sqf",(3)];

    ContactFron.sqf in the mission folder

    // Select the user of the addaction and the number of enemy units.
    _sourcePoint = _this select 1;
    _enemyCount = _this select 3;
    
    // Select random direction in front of the addaction’s user.
    _randDir = getDir vehicle _sourcePoint - 45;
    _randDir = _randDir + random(90);
    _randDist = (random 100) + 200;
    _enemyLoc =	[(getPos vehicle _sourcePoint select 0) + (_randDist * sin(_randDir)), (getPos vehicle _sourcePoint select 1) + (_randDist * cos(_randDir)), 0];
    
    // Create attack group and lead them to the player’s location.
    grp = [_enemyLoc, east, _enemyCount] call BIS_fnc_spawnGroup;
    null = [grp,(getPos vehicle _sourcePoint)] call BIS_fnc_taskAttack;
    grp reveal _sourcePoint;

    Does anyone have a clue why it is not working in the dedicated server?

    Appreciate the help guys.


  3. I've tried to search for something like this but I couldn't find an answer.

    I noticed, though, that all engineers have a variable called 'engineer' set to 1 in its .pbo, which is probably what will tell the game that he is an engineer ... but I have no experience modifying addons and didn't want to try and place this variable in another class.

    Perhaps you could follow up on this. Hope it helps a bit.


  4. Guys, can anyone help me interpret the results of the ballistic chart.

    Below are the weapon and firing characteristics

    Weapon: M4A1

    Ammo: B_556x45_Ball

    Elevation: 0.65

    X-offset: 0.2

    Target Distance: 300m

    Avg. speed: 739 m/s

    firing position: prone

    I take it that the elevation represents the angle of rifle relative to the ground. From what I've read in the the forums, the M4 and M16 rifles were supposed to be zeroed at 300m. Does this mean that the closer the elevation is from 0 in the zeroed distance the better?

    What does X-offset mean? Would this by any chance be the wind differential from the aiming point?

    Now, for the results:

    Distance Height of impact (?)

    0 - 0

    50 - 0.167336

    109 - 0.443062

    152 - 0.606375

    204 - 0.757908

    254 - 0.84304

    300 - 0.865608

    Does the second column represent the height of bullet impact? And this case, does it mean I hit the riflemen at 0.9m, roughly in the chest area?

    Thanks in advance for the help : )


  5. Hey man, thanks for the help, unfortunately, it didn't work : (

    It ocurred to me that I was trying the function only on AI units. When I tried it on a player controlled unit the function worked. Your script worked like a charm with a player controlled unit as well, so I guess the ACE functions works differently depending of who controls the units.

    Researching the developer's site: http://ace.dev-heaven.net/wagn/Wounding_System+notes I found that there is a global variable that monitors whether AI units are subject to the ACE wounds effects (ace_sys_wounds_noai).

    The problem is that I don't know how to check if these variable is in the missionNamespace or how to erase it from there. Do you have any idea how to work with these variable?


  6. Guys, I’m trying to create the following scenario. The informant is a tribal leader and will only give up some valuable information if the allied medics heal his soldiers.

    To represent the wounded soldiers, I placed the following function on a few soldiers (replacing the name where applicable):

    [soldier1, 0.6] call ace_sys_wounds_fnc_addDamage;

    I’m using the ACE Wounds System Module and the function works fine if I place it on the init line of the unit.

    The problem is that this phase of the mission requires a half hour of gameplay and by the time the players reach the area, the victims have all died from the untreated injuries.

    I figured I could solve this by calling the function only when the players are nearing the victims. So I placed the same function via trigger, by having it detect bluefor in the trigger radius and, on the activation field, placed the same code. Unfortunately, when run by the trigger it doesn’t work.

    Anyone have any ideas about what I'm doing wrong or suggestions to get around this?

    thanks in advance

    AlexLuthor


  7. Hello all,

    I'm in need of help regarding an attempt to teleport a soldier and his group to an LHD carrier. I found a great script on the net to teleport a single player using an add action in the init line of a flag. The original script goes like this:

    Trigger / flag has - this addAction ["Teleport - Airfield","teleport.sqf",["Airfield"]];

    Marker being called Airfield. (No real reason will edit this later)

    Teleporting script

    // Get the destination.

    _dest = (_this select 3) select 0;

    // Get a random direction

    _dir = random 359;

    // Move the person 15 meters away from the destination (in the direction of _dir)

    player SetPos [(getMarkerPos _dest select 0)-10*sin(_dir),(getMarkerPos _dest select 1)-10*cos(_dir),+15];

    I tried to modify it a bit, specially the last line so that it would do the same action to every member of the player's group using the code forEach command as described below:

    // Get the destination.

    _ldr = _this select 1; // Person who used the addAction

    _dest = (_this select 3) select 0;

    // Get a random direction

    _dir = random 359;

    // Move the person 15 meters away from the destination (in the direction of _dir)

    {_ldr SetPos [(getMarkerPos _dest select 0)-10*sin(_dir),(getMarkerPos _dest select 1)-10*cos(_dir),+15]} forEach units group _ldr;

    The code is not working. It teleports the player to the desired position but the members of his group are still left behind. Do you guys see what I'm doing wrong?

    Thanks in advance for any help

    AlexLuthor


  8. Thanks Rail82, not having to link the unit to another AI unit is actually much better : ) In order for it to work tough, I had to use createCenter first.

    Here's the code I'm using in the activation field of a trigger. The civilian character is a rocker, hence the name.

    HQ = createCenter East; HQ1 = createGroup East; [bon_Jovi] joinsilent HQ1; Bon_Jovi addMagazine "7Rnd_45ACP_1911"; Bon_Jovi addWeapon "Colt1911"; Bon_Jovi selectWeapon "Colt1911";


  9. Hello guys, I’m wondering if you could help me with a certain mission.

    The concept revolves around the evacuation of American civilians from a city soon to be overtaken by the enemy. Only American civilians are to be rescued and this causes the civilians left behind to revolt.

    I want to simulate this revolt by having two or three citizens draw weapons on the players, who portray the American soldiers. For this to work I have to tackle two problems:

    A. Turning a couple civilians to the enemy side

    B. Making them draw concealed weapons

    Problem A was taken care by making the civilians join an enemy unit with a soldier with a higher ranking then the civilians. This turns the group into enemy soldiers.

    I tried to solve problem B by creating a trigger which had an addweapon command in its activation field. I wanted to simulate the fact that the civilians had a pistol concealed and adding the trigger while in mission simulated this effect.

    The problem, though, is that the civilian do not shoot the players, he stands his ground and just watches me. He only picks his pistol if I wound him first.

    If I give the civilian a rifle, he waits a couple seconds and eventually seems to shoot my player. But I think it would be a hard pill to swallow for the guy to hide an assault rifle within his jacket.

    If I add the code in the initialization field of the unit, the unit keeps the pistol in his hand, thus, spoiling the surprise effect, but at least it shoots his pistol.

    I have no idea how to solve it, can anyone help please.

    Thanks in advance,

    Alex


  10. Hi guys, I wonder if you could help me with a little code.

    I'm planning a mission where two CIA officers will infiltrate an enemy controlled city to talk to an informant. They will arrive in the city unarmed but will find some stashed weapons in the informants house.

    The players are civilians, so the russian soldiers let them be. However, I want to place a trigger, making the civilians fair game once they're armed.

    Here's what I got so far and please bear in mind that my skills are limited : )

    trigger condition: (Checking for specific weapons)

    spy1 hasWeapon "M110_NVG_EP1" or spy1 hasWeapon "NVGoggles" or spy1 hasWeapon "MakarovSD";

    Trigger initialization:

    spy1 addRating -10000000

    Problem 1 - How can I check for all weapons in a single line instead of having to list them all individually.

    Problem 2 - I had to place two different triggers, checking individually for each player. Is it possible to add the other player's conditions so that it can be activated in the same trigger?

    well, that's it. Thanks in advance for any help.


  11. Guys, I'm really new at editing and scripting isn't my forte yet. Still, I wanted to make a night mission and wanted to have some custom placed houses to have their lights on.

    I have quite a few ACE add on that let me place some houses and objects in the map. In this particular case, I placed a street lamp post entitled "L lampa_ind_zebr" which is located in the following editing field: units/empty/map: EU-signs.

    Unfortunately, I don't know which ACE addon incorporated the object. Can anyone give me a hint as to how I'm supposed to turn on this light?

    thanks in advance

×