Jump to content

JacobJ

Member
  • Content Count

    308
  • Joined

  • Last visited

  • Medals

Posts posted by JacobJ


  1. Hey all

    I am making my 10on10 map and I dont what any radio messages to be send automaticly, when a player spots an enemy soldier. I also dont want the enemy soldier to be marked on the map.

    How would I do this?

    Thanks in advance

    /Jacob

    ---------- Post added at 11:30 ---------- Previous post was at 10:32 ----------

    difficultyenabled doesnt seem to work.

    I just put:

    hund = difficultyEnabled "map";

    into a players init and the enemy is still marked on the map.


  2. Hey

    I have these script:

    Points.sqf:

    if (!isServer) exitWith {};
    //starting points
    _points = 1600;
    
    while {true} do {
    _humres = 0;
    _humdes = 0;
    _tower = 0;
    
    //The triggers
    if !(alive tower) then {_tower = 250};
    if !(alive hummer) then {_humdes = 100};
    if (triggerActivated humrescue) then {_humres = 250};
    
    //The calculation
    mst = _points + ((blufor) * -100) + ((opfor) * 50) + (_humdes + _humres + _tower) + (cyw * -400);
    publicVariable "mst";
    //hint str mst
    sleep 1;
    };

    The blufor and opfor variables do I get from these two scripts:

    blufor.sqf

    private
    [
    "_bluLista"
    ];
    
    blufor = 0;
    _bluLista = _this select 0; // list of all blufor
    
    {
    if (_x isKindOf "SoldierWB") then 
    {
    	_x AddEventHandler ["killed", {blufor = blufor + 1;}];
    
    };
    
    } forEach _bluLista; 
    
    publicVariable "blufor";

    opfor.sqf

    private
    [
    "_opLista"
    ];
    
    opfor = 0;
    _opLista = _this select 0; // list of all opfor
    
    {
    if (_x isKindOf "SoldierEB") then 
    {
    	_x AddEventHandler ["killed", {opfor = opfor + 1;}];
    
    };
    
    } forEach _opLista; 
    
    publicVariable "opfor";

    I have 3 triggers, one covering the blufors I want to be in their list, one covering the opfors I want to be in their list and one for the civilist I want to be counted on. In those triggers I have:

    trigblufor

    Blufor Present, Once

    Timeout: 1, 1, 1

    condition: this

    OnAct: nul = [thislist] execVM "blufor.sqf";

    trigopfor

    opfor Present, Once

    Timeout: 1, 1, 1

    condition: this

    OnAct: nul = [thislist] execVM "opfor.sqf";

    trigcivil

    Civil Present, Once

    Timeout: 29, 29, 29

    condition: this

    OnAct: nul = [thislist, west] execVM "civil.sqf";

    The problem is, that when I shoot a blufor it counts down alright, but after some seconds it then counts down another 100 (thats the value for each dead blufor) and it keeps on duing this.

    I have a respawn area, but that isnt covered by the triggerareas.

    Whats wrong with my calculation?

    /Jacob


  3. Hey all

    I have a point-system that I would like to start from the lobby. This ive got to work, but in the lobby I have an option to display the points on the fly in the task menu. The problem is that it will only show "Points", which is the title of the simple task i have created. It doesnt show, what I want it to show, and that is "Current point status: mst". mst is a variable that I have from another script.

    Here is the scripts:

    Points.sqf

    if (!isServer) exitWith {};
    //starting points
    _points = 1600;
    
    while {true} do {
    _humres = 0;
    _humdes = 0;
    _tower = 0;
    
    //The triggers
    if !(alive tower) then {_tower = 250};
    if !(alive hummer) then {_humdes = 100};
    if (triggerActivated humrescue) then {_humres = 250};
    
    //The calculation
    mst = _points + ((blufor) * -100) + ((opfor) * 50) + (_humdes + _humres + _tower) + (cyw * -400);
    publicVariable "mst";
    hint str mst;
    sleep 1;
    };

    Pointsintask.sqf

    if (!isServer) exitWith {};
    if (paramsarray select 5 == 1) then {
    sleep 12;
    tskPoints = {_x createSimpleTask ["Points"]} foreach allunits;
    while {true} do {
    {tskPoints setSimpleTaskDescription [format ["Current point status: %1",mst],format ["Current point status: %1",mst],format ["Current point status: %1",mst]]} foreach allunits; 
    sleep 1;
    };
    };

    How can this be? Is there something wrong with the pointsintask.sqf? I get no script errors...

    /Jacob


  4. Hey all

    I have made a group of soldiers that are marching and I want them to turn 180 degress and walk the other way. The problem is, that they then turn again and continue to walk in the direction they where working before they made their turn.

    I have a trigger area counting. When the are all in this gets exec:

    {_x playMove "otockaErcRflLow_180leva"} foreach thislist; {_x playMove "AmovPercMwlkSlowWrflDf"} foreach thislist;

    Do I have to setDir or something? I can't seem to get it to work.

    The soldiers have this in their init:

    this disableAI "TARGET"; this disableAI "AUTOTARGET"; this disableAI "MOVE"; this disableAI "ANIM";

    /Jacob


  5. Hey there

    I was looking for a rope script that could make a rope on a chopper come down. When the rope is down, a soldier would then go to the rope and with the addaction on the rope, attach himself to the rope. Then the chopper could fly away and put him down somewhere safe. I tried making a script like that, and with some more realistic rope, that would fly as in real like, dragging a bit after the choppers position, when the chopper flys forward.

    It works to some extend, but the hard part is the deacceleration. In real life the rope/the soldier attached to it comes forward when the chopper slows down somehow fast, but I don't know how to make this happen.

    If you guys have some ideas to this, please share.

    Here is the script:

    _dirheliDeg = getDir helikop;
    _dirheli3 = rad _dirheliDeg;
    _dirheli = cos _dirheli3;
    
    while {true} do {
    _helispeed = speed helikop;
    pole setvectordirandup [[_dirheli,-280,_helispeed],[0,0,1]];
    sleep 0.1;
    };

    /Jacob


  6. That was else a good idea with the bucket.

    The searchlight, does it has to be manned to be able to light or can I use a command to make it light? I can get into the searchlight, turn it on and then get out and it keeps turned on, so I guess it can be done, but how to do it is beyoned my knowledge.

    The hangars do also have lights in their celing, but those can't be turned on either as far as I know?


  7. Okay, ive got it working.

    I have created two triggers:

    trig1

    condition: (daytime > 18.503) or (daytime < 6.001)

    onAct: nul = [] execVM "lightson.sqf";

    trig2

    condition: (daytime < 18.499) && (daytime > 6.003)

    onAct: nul = [] execVM "lightsoff.sqf";

    The reason why you need to use OR in the first script is, that the time can't be more than 18:30 and under 6:00 at the same time.

    In the second trigger you need the AND/&&, because here your daytime is under 18:30, and 6:00 and lower is also under 18:30, thats why you need both to be true for it to work.

    The timedelays are there to not accidently delete the light before its been created.


  8. Hey all

    I have made a script that creates a lot of lights around in the mission. I want these lights to switch on when the daytime is between 18 and 6.

    I can get this to work with:

    if (daytime > 18) or (daytime < 6) then { bla bla};

    But the problem is that when it is not between this timeperiode when I run the script it doesnt turn on, when the timeperiode is reached.

    I suspect that a while would do the job, but I dont want to create the light over and over again after the sleep has run out.

    How would I do this checking, so that when its past 18 the script is run and when the clock is past 6 in the morning it runs a script that deletes all the lights created?

    /Jacob


  9. Okay after searching around here on the forum I found out that it could be a timing problem. I tried to wait a few seconds to execute the tskdes script and now it did display the number very nicely. It is an interesting thought, to have a loop to update this number. A simple while {true} do {sleep 5; bla blab bla would be fine right?

    I have a few loops in my mission, how many loops can be allowed, before the server begins to lag? Is that even an issue?

×