-
Content Count
359 -
Joined
-
Last visited
-
Medals
Everything posted by Lucky44
-
Coding issue around variables in script to let guards call for help
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yes, it's a sloppy coder thing to do. But the reasoning is that this is a one-time thing. This call for help should only go out once (so that help, in the form of reinforcements only comes once). So once the variables you mention are set, there's no good reason to reset them. Does that make sense? -
Coding issue around variables in script to let guards call for help
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks to both of you for the help. Yes! setVariable was what I was thinking of. I had it in my head that it was called a "personal variable" or something...duh. Here's what I'm going to use for now: if (!isServer) exitwith {}; // make sure only the server runs the script if (alarmSounded == "true") exitwith {}; // just quit script if alarm has already sounded //if (shotFlag == "true") exitwith {}; // this is initialized in the init.sqf //shotFlag = "true"; //the problem with this ATM is that if one person shoots, the script won't work again for 10-15 seconds, for ANYONE... //publicVariable "shotFlag"; _shooter = _this select 0; if ((_shooter getVariable "alarm") == "yes") exitWith {}; // if this is not the first shot, exit _shooter setVariable ["alarm", "yes", true]; // if this is first shot, set alarm call to YES, and make it TRUE for publicVariable sleep ((random 5)+15); // if unit is still alive 15-20 seconds after shooting, it will call on radio for help //If, after the delay (to give the shooter time to get on his radio), shooter's still alive, do this: if (alive _shooter) then { alarmSounded = "true"; // this will disable further messages and calls for reinforcements (from other units) publicVariable "alarmSounded"; [[west,"HQ"],nil,rsideChat, "You've been spotted. A hostile guard put out a radio call for help!"] call RE; //hint format ["%1 is calling for help on the radio!",_shooter]; // another approach sleep 260+(random 120); // put a delay before the reinforcements start out execVM "scripts\spawnRFland.sqf"; //spawn some reinforcements on land execVM "scripts\spawnRFair.sqf"; //spawn some reinforcements in air }; -
Small syntax problem --> what's the error?
Lucky44 posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm stuck and I would appreciate help in fixing my syntax/usage problem. Here's the relevant code: _Vod2 = [(getMarkerPos "mrk_RFspawn2"), 100, "GAZ_Vodnik", _RFgroup1] call bis_fnc_spawnvehicle; _squad1 = [GetMarkerPos "mrk_RFspawn1", EAST, 10] call BIS_fnc_spawnGroup; {_x moveInCargo _Vod2} forEach units _squad1; The error is on the 3rd line, saying "3 elements provided, 2 expected..." I'm not sure what 3 elements I'm giving and how to change it. Suggestions, anyone? -
Small syntax problem --> what's the error?
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
(oops, meant to make a new thread...) -
Small syntax problem --> what's the error?
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Wow great! Thanks a ton (or a tonne) for that. -
Small syntax problem --> what's the error?
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sel! Thanks so much for the quick, correct response. That was the issue. Could you help me understand why that "select 0" was needed? What it did, exactly? -
Norrin Revive errors - help???
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks Wolle! I remember reading that in the original documentation, but I'd never seen an issue with it. I'll move the marker. EDIT: I think it wasn't the START marker that was the problem. I think it was the Boot_Hill marker, btw. -
Norrin Revive errors - help???
Lucky44 posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I've got a large mission for MP (coop). I've started having an issue when people join in certain slots where they get this message CLICK. "Unit selected is dead please press ESC, return to the unit selection menu and choose the same or another playable unit" All units are named properly and I'm using "PlayableUnits" for which units can utilize revive. This is a revised version of a mission. Only recently did I start having issues with the later versions. I've looked at the revive_init.sqf and the mission.sqm and can't see anything odd. Has anyone had issues like this? Suggestions?? Thanks! -
Jungle Wars: Island of Lingor
Lucky44 replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Yes, thanks for the great work. And yes, love to get the Group names. -Another donation coming today! -
Jungle Wars: Island of Lingor
Lucky44 replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Speaking of Easter Eggs... Got Milk? -
Jungle Wars: Island of Lingor
Lucky44 replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
While I'm waiting patiently for the new units to be available, I'd like to ask for a list of units and group names, please, when they come out. -We can always get unit names via the mission.sqm file, I know, but it's harder to get group names. Hopeful! -
Jungle Wars: Island of Lingor
Lucky44 replied to icebreakr's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Thanks for the continued work on this Icebreakr! It's such a great map, and better now. I'm running a campaign for The Art of Warfare (taw.net) using it. (You can see info about it here, actually.) And we're part way into the campaign, and I guess I'm going to have to switch to the new version! Keep up the great work (and I'll keep donating!) ! -
Spawning vehicles and using the names I give them - questions
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Gah! Thank you both so much. I wasted a couple hours on that...duh. ---------- Post added at 04:50 PM ---------- Previous post was at 04:37 PM ---------- Now wait a second. That got me thinking: in the first line of my code above, I createGroup and give it the name _TankSquad2. In the BIS_fnc_SpawnVehicle line, I refer to that group. I thought I was assigning the new vehicle to that group. Which seems to be right. But is "Tank4" also a name for the group? Or is it just an array of the UNITS in the group...must be that, huh? OK, I could just not post this, but I think I'll leave it for future people who might be as confused as I've been :) ---------- Post added at 05:23 PM ---------- Previous post was at 04:50 PM ---------- And here's another twist: the array created by BIS_fnc_spawnVehicle is the array of units (crewmen) in the vehicle. The FIRST element of the array, i.e., (tank4 select 0), is actually the VEHICLE. ---------- Post added at 05:41 PM ---------- Previous post was at 05:23 PM ---------- So here's what my final code looks like, cleaned up a bit: _veh = (tank4 select 0); // set the name of the vehicle Group Array, from BIS_fnc_spawnVehicle, here _damTot = damage _veh; while {_damTot < 1} do { if ((damage _veh) >=0.20) then {_veh SetDamage 1}; // set this level so that if there's enough damage for crew to bail out, vehicle will be destroyed sleep 3; _damTot = (damage _veh); }; Thanks again for the help! -
Spawning vehicles and using the names I give them - questions
Lucky44 posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here's what I'm trying to do: spawn a vehicle, and then every 3 seconds, check to see if it's taken 25% damage or more, and if so, setDamage to 100% on it. Here's what I'm trying in a script that's called by a trigger on map: _tankSquad2 = createGroup EAST; Tank4 = [(getMarkerPos "mrk_pos1"), 90, "T34_TK_EP1", _tankSquad2] call bis_fnc_spawnvehicle; publicVariable "Tank4"; _damTot = (damage Tank4); while _damTot < 1 do { if ((damage Tank4) >= .25) then {Tank4 SetDamage 1}; sleep 3; _damTot = (damage Tank4); // update value to current level }; This all works fine on a vehicle placed on the map in editor, and the spawning works fine, but after spawning, it creates an "Error damage: Type Array, expected Object". Actually, at the PV line, if I used that line, it throws the error there ("Type Array, expected Object"). I assume that the name I'm giving the tank (e.g., Tank4) is not getting associated with the tank object. What am I doing wrong there? -
diag_log and the arma2oa.rpt file on a dedicated server...problems
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks, Engima. I will take a look at that approach. (As soon as I digest it!) -
I've been very happy using the diag_log command to export info from the game to an external file (namely, the arma2oa.rpt file). But I was frustrated to learn that it's not working on a dedicated server, but it is working for local players (i.e., saving onto their local machines). My hunch is that I'm calling it in a limiting way, preventing it from being logged onto the server. Here's how I'm going about it: I have a static object placed on the map (a Barracks building, at the moment). In its INIT box I have this code: 0 = [this] execVM "STS\tracker_addAction.sqf"; and the tracker_addAction.sqf has this in it: private ["_reporter"]; _reporter = _this select 0; _reporter addAction ["Send supply record to file","sts\OutputToFile.sqf"]; and the OutputToFile.sqf has this in it: diag_log format ["LingorLibre: DateStamp: %1",date]; diag_log format ["LingorLibre: FuelBarrels added =%1, timestamp = %2",FuelBarrels,time]; diag_log format ["LingorLibre: MedSupplies adeded =%1, timestamp = %2",MedSupplies,time]; diag_log format ["LingorLibre: BagFences added =%1, timestamp = %2",BagFences,time]; diag_log format ["LingorLibre: BigHeskos added =%1, timestamp = %2",BigHeskos,time]; diag_log format ["LingorLibre: SmHeskos added =%1, timestamp = %2",SmHeskos,time]; diag_log format ["LingorLibre: StaticMGs added =%1, timestamp = %2",StaticMGs,time]; diag_log format ["LingorLibre: CashPiles added =%1, timestamp = %2",CashPiles,time]; diag_log format ["LingorLibre: RepairCrates added =%1, timestamp = %2",RepairCrates,time]; diag_log "-------------------------------------"; diag_log "-------------------------------------"; //This section gets loadout for each player recorded///////////////////////////////////////////// _allPlayers = playableUnits; _WepArray = []; _mags = []; _playerName = ""; { _WepArray = weapons _x; _playerName = name _x; _mags = magazines _x; diag_log format ["LingorLibre: Player= %1, Loadout= %2, Mags = %3, Timestamp =%4",_playerName,_WepArray,_mags,time]; sleep 1; }foreach _allPlayers; diag_log "======================================"; diag_log "======================================"; ////////////////////////////////////////////////////////////////////////////////////////////////// //This section counts vehicles in players' possession (i.e., at their base) at mission end//////// _vehList = nearestObjects [shed3, ["Car","Tank"], 100]; { //hint format ["Vehicle = %1",_x]; // DEBUGGING ONLY !!!!!!!!!!!!! //sleep 2; // DEBUGGING ONLY !!!!!!!!!!!!! diag_log format ["LingorLibre: Player Vehicle = %1",_x]; sleep 0.1; }foreach _vehList; diag_log "++++++++++++++++++++++++++++++++++++++"; diag_log "++++++++++++++++++++++++++++++++++++++"; ////////////////////////////////////////////////////////////////////////////////////////////////// //This section counts ammo crates at players' base at mission end///////////////// _CrateList = nearestObjects [shed3, ["ReAmmoBox","ReAmmoBox_EP1"], 100]; { diag_log format ["LingorLibre: AmmoStuff = %1",_x]; sleep 0.1; }foreach _CrateList; diag_log "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; diag_log "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; What am I doing wrong? Is there a limitation to diag_log that I don't know about? Thanks in advance for any help!
-
How to open the gates?
Lucky44 replied to Wrestler's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
To simply start a Bar Gate (that you place using the editor) in the down/closed position, you can put this in its INIT box: this animate ["bargate",1]; -
diag_log and the arma2oa.rpt file on a dedicated server...problems
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for taking the time to reply, PvPscene. I have a decent understanding of PVs, MPEHs, and locality. I just hadn't thought that through that an action on an object would only remain local, even for the diag_log command. Is there a way to force it to go to the (dedicated) server? Or should I just collect the info locally, since I'll be participating in the missions anyway? Would my local client have the same info? Would all local clients? I'd think so. -
Civilian kill Counter
Lucky44 replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There seem to be two main reasons why a question on these forums doesn't get a reply: 1. no one knows (and this is rare), and 2. the question is so dumb that no one is going to take the time to even tell you. Is my question above Type 1 or Type 2? :) -
Civilian kill Counter
Lucky44 replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OK, I love how this script works; it's great. But suddenly, when I crank my "civ death limit" up a bit, it stops displaying the hint about the number of civs killed. When running on a dedi server, it works fine up till 6, but for a 7th civ killed, there's no message. When I ran it on a hosted server, it only went to 5 before stopping the hints. I have no clue why this would be! Here's my code: SHK_DeadCivilianCount = 0; SHK_DeadCivilianLimit = 20; SHK_EndMission = false; [] spawn { waituntil {SHK_EndMission}; cuttext ["Mission Failure!.\n Your team killed too many civilians.","PLAIN",2]; sleep 12; endmission "END2"; }; SHK_fnc_deadCivilians = { hintsilent format ["Civilians killed: %1",_this]; if (_this >= SHK_DeadCivilianLimit) then { SHK_EndMission = true; publicvariable "SHK_EndMission"; }; }; // Following is a version that considers whether the Civs were killed by a certain faction:////////////////// SHK_eh_killed = { private "_side"; _side = side (_this select 1); if (_side == RESISTANCE) then { SHK_DeadCivilianCount = SHK_DeadCivilianCount + 1; publicvariable "SHK_DeadCivilianCount"; if isdedicated then { if (_this >= SHK_DeadCivilianLimit) then { SHK_EndMission = true; publicvariable "SHK_EndMission"; }; } else { SHK_DeadCivilianCount call SHK_fnc_deadCivilians; }; }; }; // END of Resistance Faction killer Check- ////////////////////////////////////////////////////////////////// if isserver then { { if (side _x == Civilian && _x iskindof "Man") then { _x addEventHandler ["killed", SHK_eh_killed]; }; } foreach allunits; } else { "SHK_DeadCivilianCount" addpublicvariableeventhandler { (_this select 1) call SHK_fnc_deadCivilians }; }; [] spawn { waituntil {!isnil "BIS_alice_mainscope"}; waituntil {!isnil "bis_fnc_variablespaceadd"}; [bIS_alice_mainscope,"ALICE_civilianinit",[{_this addEventHandler ["killed", SHK_eh_killed]}]] call bis_fnc_variablespaceadd; }; I've probably just screwed something up and I'm not seeing it. Has anyone had any similar experiences with the Hints cutting out? Any help will be appreciated! -
BIS Module Improvement Project
Lucky44 replied to wolffy.au's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Woops! wrong thread! Sorry! -
[R3F] Artillery and Logistic: Manual artillery and advanced logistic (mission script)
Lucky44 replied to madbull's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Madbull and R3F: Just wanted to add another great big MERCI for your excellent work. We at TAW.net are going to make good use of the logistics system in an upcoming campaign. The campaign will be played in sessions, and at the end of each session, I'll track what supplies (e.g., fuel barrels, medical supplies, repair supplies, fortifications, cash) players have accumulated. Then they'll be able to make use of them for future sessions. R3f Logistics is a huge help for this. Thanks! -
addAction - how to add new actions in MP
Lucky44 posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here's what I'm trying to do: I have an object (the 4 barrels object) that I want players to be able to transport to their base and "store" for future use. I want it to work like this: When they find it, they search it to see what's in it. Next, once they know that it has fuel in it, it removes the first (search) action and adds a new Action (that calls a script that registers it as saved if it's at their base) It works fine, except that only the player who used the first (search) Action on the object gets to see the 2nd (added after search) Action. The first one gets removed for everyone, but only the one player can see the newly added Action. Here's what I'm doing: barrels1 RemoveAction 0; publicVariable "barrels1"; // this section sets up the JIP code so that if someone joins after the barrel was examined, it will already be searched for them too, locally barrels1Use = 0; publicVariable "barrels1Use"; barrels1Use = 1; publicVariable "barrels1Use"; barrels1 addAction ["Add fuel barrels to Company supplies at base","scripts\score4Barrels.sqf"]; //[nil,barrels1,"per",rADDACTION,["Add fuel barrels to Company supplies at base","scripts\score4Barrels.sqf"]] call RE; //execVM "scripts\addFuelable.sqf"; publicVariable "barrels1"; As you can see, I've tried 3 different ways to get the new Action to be added to all clients, but none work. I feel like I'm close, but I can't quite get it. Thanks in advance. -
addAction - how to add new actions in MP
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Aha, OK, cool. That makes sense. Thanks again for the help. I'm continually amazed at how valuable it is to be able to get help from people with better understanding. These boards are a godsend. -
addAction - how to add new actions in MP
Lucky44 replied to Lucky44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
That is working much better! I guess that makes sense, but I wasn't seeing it. One question: at one point, we had a dedicated server check in the barrel_addAction.sqf, like this: private ["_barrel"]; _barrel = _this select 0; //Dedicated has no players to perform the action; that is, don't bother having dedi server run this if (isDedicated) exitWith {}; //Only allow checking the barrel if it has not yet been checked _barrel addAction ["Search this container", "scripts\searchBarrels.sqf", [], 0, false, true, "", "not (_target getVariable [""searched"", false])"]; //Only allow adding fuel to stores if it has fuel in it. _barrel addAction ["Add this fuel to Company supplies", "scripts\score4barrels.sqf", [], 0, false, true, "", "_target getVariable [""searched"", true] && _target distance (getMarkerPos ""start"") < 120"]; But I've removed the dedicated check, (as seen in my last code in previous post). Is that OK? Do we need it? And why/why not? Thanks!