Jump to content

dnk

Member
  • Content Count

    578
  • Joined

  • Last visited

  • Medals

Posts posted by dnk


  1. I'm looking for this also, but I didn't see any commands that will tell you who killed who. The game clearly keeps some track of what kills what, although I do not know if it saves a value for each dead unit as to what other unit killed it or visa-versa. I suppose a workaround would be to:

    while {true} do {
    units = allunits;
    scoreP = rating player;
           sleep 0.00001;
    if (scoreP < rating player) then {
    	//I will mess this up as I do not understand arrays, but someone should be able to correct it in passing
    	deadman = units - allunits;
    	{	deadman2 = name _x;
    		hint format ["Player killed %1",deadman2];
    	} foreach deadman;
    };
    };

    What that attempts to do is check every frame/halfsecond (might need a waituntil, I dunno, because while-dos might not refresh fast enough?) to see if the player's score has increased (by killing stuff, assuming you have no score-granting objectives) by comparing the player's score the previous frame (or whenever: scoreP) to his current score (rating player). If it is higher, then it compares the list of alive units the past frame (units) to the current list of alive units (allunits). The difference (the dead man) is then inputted into a text display.

    This might not work if you have units added or revived during the mission, and it might throw up some false positives if the player kills someone (or a vehicle/etc) on the same "frame" another person dies, but it's close at least. It might not work at all, I don't want to open A2 just to check.

    My best attempt, I'm sure it's lolbad :)

    Edited to add in more stuff.


  2. Sorry for not explaining what I was trying to do, that was stupid of me to omit. I am trying to save myself a lot of copying, pasting, deleting, and number-typing. I want to take an array of two values (a and a_1) and add to that values a_2 through a_98 (probably too many, but we'll see). Then take that array and put it through a different "foreach" loop that executes an FSM for all elements (that is not depicted, all that you need to know is I need the element string (of a marker) for the second foreach).

    Anyway, thank you for the input. Where can I read on this? I read the wiki on arrays but got a bit confused as it's fairly simple. I mean, I see nothing about "%"s and "value" commands and "format" commands in the wiki entry there (although I'll be sure to read up on them tomorrow).

    They definitely are my weak point. I spent a lot of time today figuring out that this:

    {.....
    [_x] execVM "blah.sqf";
    } foreach allunits;

    requires you to do a "_this select 0;" in the next file; you can't just treat "_this" like an object (I still don't understand why, but okay).

    ---------- Post added at 10:40 AM ---------- Previous post was at 10:38 AM ----------

    Anyway, scripting is a fun way to waste a half hour realizing that what seems completely logical is actually, in fact, gibberish, despite still seeming completely rational.


  3. Seems to work fine.

    I found a workaround:

    _men0 = (getMarkerPos "base0") nearEntities ["Man",800];
    
    {_x move (getMarkerPos "base0");
    _x setSpeedMode "FULL";
    _x setBehaviour "AWARE";
    [b]_x lockWP true;[/b]
    } forEach _men0;
    
    sleep 120;
    
    {[b]_x lockWP false;[/b]
    } forEach _men0;

    I'd note that move doesn't seem to add a permanent WP, just a temporary one that is erased as soon as it is reached. For example, if you have a group that cycles between 2 WPs, then use move, after they reach the move WP, they'll return to their 2-WP loop.


  4. I want to take an item (can_small) and make it so that the player can pick up the can and have it placed into inventory, and then have it permit him to drink the can and have it removed from inventory.

    Is there a tutorial or something on how to do this? So far, my mod looks like this: a config.bin with (will worry about icon later):

    class CfgMagazines {
    class Can_small : Small_items {
    	scope = public;
    	model = "\ca\misc\Plechovka_1";
    	displayName = $STR_DN_CAN_SMALL;
    	picture = "\Ca\weapons\Data\Equip\m_40mmHPgreen_CA.paa";
    };
    };

    And there's this I can use:

    this addAction ["Pick Up","drink\pickup.sqf"];

    With pickup.sqf being

    player addMagazine "can_small"; player addaction ["Drink","drink.sqf"];

    But how do I make it so that having the can in inventory allows the player an ability like "drinking" (eg, "use bandage" from ACE) where it is only applicable when the player has that thing in his inventory?

    How do I attach this addAction 'pickup' to every can that is placed on the map or dropped from inventory onto the ground?


  5. When a script triggers, I want to set emergency waypoints for all groups to run to the nearest "base", wait, then return to a normal patrol. I cannot get this to work, though, and hope someone could help me.

    My current attempt is:

    _men0 = (getMarkerPos "base0") nearEntities ["Group",500];
    //and other "bases"...
    
    {_x addWaypoint [getMarkerPos "base0",20];
    arrayways = waypoints _x;
    thecount = count arrayways;
    _x setCurrentWaypoint [_x,thecount];
    
    sleep 60;
    
    _x deleteWaypoint [_x,thecount];
    _x setCurrentWaypoint [_x,1];
    } forEach _men0;
    

    What's wrong with that?


  6. Well, that was a mess of a code and didn't work too well, but I fixed it (sort of).

    My new question:

    Is there no way to gently fade OUT a ppEffect? It seems I can only gently fade them in, then each successive one just paints on top of the last. The only way to take out the last is to 'snap' it off, which looks like crap.

    ---------- Post added at 07:57 AM ---------- Previous post was at 07:51 AM ----------

    Hah! Solved:

    sleep 0.1;

    postRise = ppEffectCreate ["colorCorrections",1500001];

    postRise ppEffectAdjust [ 1, 0.62, 0, [0, 0, 0, 0],[3.12, 0.25, 0.87, 1.26],[-1.11, 0.03, 0.02, 0]];

    postRise ppEffectEnable true;

    postRise ppEffectCommit 5;

    sleep 10;

    postDay = ppEffectCreate ["colorCorrections",1500002];

    postDay ppEffectAdjust[ 1, 0.63, 0, [0, 0, 0, 0],[2.64, -1.76, -0.26, 1.45],[0.58, -0.25, 0.02, 0]];

    postDay ppEffectEnable true;

    postDay ppEffectCommit 10;

    sleep 10;

    postDay ppEffectAdjust [ 1, 1, 0, [0, 0, 0, 0],[2.64, -1.76, -0.26, 1],[0, 0, 0, 0]];

    postDay ppEffectCommit 10;

    Just readjust the disposed value and recommit it and then turn it off.

  7. nevermind, i am a stupid :) (the init.sqf was stuck in a while-do loop prior to executing the post script)

    Anyway, new question: ppEffectCommit. When you commit a new effect, does it fade out the old effect over the same duration, or does it add the new effect on top of the old? For example, I want to do (in init.sqf: "hour = daytime;"):

    sleep 0.1;

    postDay = ppEffectCreate ["colorCorrection",1501];

    postRise = ppEffectCreate ["colorCorrection",1501];

    postSet = ppEffectCreate ["colorCorrection",1501];

    postNight = ppEffectCreate ["colorCorrection",1501];

    postDay ppEffectEnable true;

    postRise ppEffectEnable true;

    postSet ppEffectEnable true;

    postNight ppEffectEnable true;

    postDay ppEffectAdjust [blahbl];

    postRise ppEffectAdjust [blahbl];

    postSet ppEffectAdjust [blahbl];

    postNight ppEffectAdjust [blahbl];

    #postchecks

    _postCheckRise = if (hour >= 5) && (hour < 8) && (ppEffectCommitted != postRise) then {postRise ppEffectCommit 1800};

    _postCheckDay = if (hour >= 8) && (hour < 16.5) && (ppEffectCommitted != postDay) then {postDay ppEffectCommit 1800};

    _postCheckSet = if (hour >= 16.5) && (hour < 18.5) && (ppEffectCommitted != postSet) then {postSet ppEffectCommit 1800};

    _postCheckNight = if (hour >=18.5) && (hour < 5) && (ppEffectCommitted != postNight) then {postNight ppEffectCommit 1800};

    sleep 300;

    goto "postchecks";


  8. I got the same error. It was just this: "Script not found"

    There were maybe three spaces between script and not, just empty like that.

    Nothing I do can get the RTE Capture program to notice that CO is running, even when launched from the program. I have the editor running in CO right now, and RTEC just says "Status: Inactive" and has "Activate monitoring" grayed out.

    Very frustrating since it took me over an hour just to figure out exactly how to install this and get things running. It worked fine in ArmA, with the odd bug...

    ---------- Post added at 03:13 AM ---------- Previous post was at 03:03 AM ----------

    Solved: I had renamed the Jay addon folder to @Jay, and apparently the .dll doesn't work without the original name being used. So, I switched the names back to default in RTEC and for the folder, and now it connects.


  9. I still don't know how insects work in ARMA2. Does everyone on a server see the same bug? Or is it only random bugs that play kinda like a movie for each user separately. Player 1 can see a butterfly land on the road, but no one else can?
    It's a client-side effect, so everyone sees it differently. I've jacked everything in mine up, so I see a lot more than others.

    While I'm asking, since I got no help in the (wrong) other forum, does anyone know how to edit pollen behavior (little puffballs floating around)?


  10. I want to add in a lot more ambient wildlife, but I'm having a hard time finding the right config file for behavior. I found where to alter the amounts/probabilities, but I'm still stuck with small insects that hover 1/2" off the ground, pollen that seems to float through grass, and the like.

    Anyone dealt with this in ArmA2 and know where the file is? I've looked through a few pbos, bins, and cfg/hpps with no luck :(

    ---------- Post added at 08:41 PM ---------- Previous post was at 08:13 PM ----------

    Well, found the insects/animals in animals.pbo/config.bin. No-brainer, wonder how I missed that one...

    ---------- Post added at 09:34 PM ---------- Previous post was at 08:41 PM ----------

    Found pollen hiding in ca.pbo\config (searching for feather)


  11. I have two machines, one has a C2D but no graphics, the other graphics but a crap CPU. I want to play ACE/GL3 w/random fluff mods thrown in, and I appear to be alone in this desire, looking at the pubs and all the grumpy admins that don't like mods for some crazy reason (not that my SLX files have bikeys anyway).

    Solution: set up a dedicated server on the C2D and connect with the Athlon.

    But I can't get it to work! Firstly, there are basic connectivity issues. For two computers that are literally 1 foot apart, they sure have a problem talking (2302/4/5 open, BE off)!

    Secondly, when they do get to talking correctly, the server can't load ACE games (vanilla does work). There's always files missing or something (cfg_iraqi_men always pops up when booting up; lack of other cfg files crash the game when loading a mission).

    Here's what I think the problem is: I'm not really sure I've got the right ACE server files. The page with all the correct downloads isn't the most intuitive. I've tried downloading just the 1.09server file, and that doesn't work. I also tried downloading the 1.06full file, then "patching" it with the 1.09server file. Equally unworking.

    Driving me crazy - get 3FPS on the Athlon playing dom, so I need this to work out!

    I am buying a new rig for ArmA2 soon, so it's only a passing problem I guess :bounce3: But any help would be very appreciated in the meantime!

    (latest patch btw, made no difference between it and 1.14).

×