Jump to content

trex

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About trex

  • Rank
    Rookie
  1. Thanks all of you for the replies ! Actually it is what I came up this nigh (sleeping is very instructive ;) ), the mission generation process is iterative so because my rifleman is created before the reinforcement squad, the global variable ReinGrp is not yet "created". I think it is working inside the script due to threading parallelism (the squad is created meanwhile the script is executed, especially I suspect hint command execution to take enough time to allow ReinGrp global variable to be assigned before its use on the following code) Yeah, not tested yet (will do soon) but I think that or the other will work. Even though I think I'll prefer to address this inside a init.sqf script instead of the init line parameter of the unit/group, because It will prevent either adding several sleep command (save time is always good) or rebuild my mission by deleting and recreating several unit/group whose order of creation may become soon or later a puzzle resulting in severe headache. :386:
  2. Hi, here is what i want to do : call a reinforcement script when a given unit die. here is what i did on a dumb test mission to work this out : i place 1 unit, myself and a distant group, that said reinforcement. As you can see I add : ReinGrp = group this; in the squad leader of the reinforcement group init field, which give me a global variable to address his group. And then on my single enemy rifleman call this reinforcement group via this line on his init field : null = [this, ReinGrp] execVM "reinforcement.sqf"; Note : I don't use the eventHandler on "killed" event yet, till i figure out my issue (presented bellow) Finally here is the code of reinforcement.sqf : _pos = position (_this select 0); _ReGrp = (_this select 1); hint format["TEST 1 : %1", _ReGrp]; // In Game show : TEST 1 : ANY hint format["TEST 1 : %1", ReinGrp]; // In Game show : TEST 1 : 0 - 1-2 ALPHA wp1 = _ReGrp addWaypoint [_pos, 10]; // nothing happen, group stay static, DONT WORK // wp1 = ReinGrp addWaypoint [_pos, 10]; // This work ! But the purpose is to reuse this code by using parameter not global variable ... wp1 setWaypointType "move"; As you can read on my commentary this script don't work, because it seems I don't get properly the 2nd argument of type Group. (hint command display the text "ANY") Note that if I use the corresponding global variable of the group i want to work with, this work. (hint command display the proper text) It seems strange because execVM can have anyType as argument, so in theory an array of an Object and and a Group should work, no ? Thanks for any help on this, even if I feel bad that I committed a simple mistake that I'm not able to see it yet. :butbut:
  3. Yeah it is what i was thinking this night. But anyway i just wanna know cause in theory it should work too on dead body. I guess it is a bug of the early alpha release.
  4. Hi, I want to remove weapon and some item from dead Opponents (AI). Here is what I do : //init.sqf {if(side _x == east) then {_x addEventHandler ["Killed", {null = [(_this select 0)] execVM "remove_Loot.sqf"}] }} forEach allUnits; and //remove_Loot.sqf _man = _this select 0; removeallweapons _man; // That work no more weapon on dead people removebackpack _man; // May be i dont know if basic dead AI (riffleman) have backpack anyway removeAllAssignedItems _man; // THAT DONT WORK ! he still have full item gear on ground on his body Tried too : //remove_Loot.sqf removeallweapons _man; removebackpack _man; //removeAllAssignedItems _man; _man unassignItem "ItemMap"; // dont work _man removeItem "ItemMap"; // dont work Here is 2 Screenshoots of the simple dummy mission to test this out (EDIT cannot post link yet, have to wait 1 day to be able to) : screenshoot steam id=132573632 And the result, that do not work (map still lootable here) :( : screenshoot steam id=132573778
×