Jump to content

Chance536

Member
  • Content Count

    18
  • Joined

  • Last visited

  • Medals

Everything posted by Chance536

  1. So, I'm working on a script to create addAction teleporters around a training map to the different ranges and such. I only have two of the locations in the array for now for testing purposes. You can see below how I tried to go about doing it. I know how to brute force it and add them all manually but was hoping to learn a better way. Currently, I'm getting the ole faithful undefined variable in expression error from {player setPosASL (getPosASL (_LocationsArray select _i))}. The addAction gets added with the correct names though they don't display correctly but should be easy to fix once the important part works (The "" marks appear in the name). There's probably some law of scripting I didn't know about or have broke, or I need a set of ( ) in the right place. I just can't figure it out. After I get this working my next step is removing the Location from _LocationsArray that matches the function parameter _Location so bonus points if anyone wants to throw in some guidance on that. JeanTeleportFnc = { params ["_Location"]; private _LocationsArray = [VictoryAirbaseAnchor, RangeComplexAnchor]; private _NamesArray = ["Victory Airbase", "Multi Use Range Complex"]; for [{_i = 0}, {_i < 2}, {_i = _i + 1}] do { test1 addAction [("Teleport to" + str (_NamesArray select _i)), {player setPosASL (getPosASL (_LocationsArray select _i))}]; }; };
  2. I figured the main part of it out. I was correct that addAction didn't magically know private variables from other scopes unless its passed them as an argument. I had to do it weirdly, but everything is working now that I was trying to figure out thus far. You can see just after the code I passed my arguments from my script with [_LocationsArray, _i]. Now to just do the nice to haves. params ["_Location"]; private _LocationsArray = [VictoryAirbaseAnchor, RangeComplexAnchor]; private _NamesArray = ["Victory Airbase", "Multi Use Range Complex"]; for [{_i = 0}, {_i < 2}, {_i = _i + 1}] do { test1 addAction [ ("Teleport to %1" + (_NamesArray select _i)), {_i2 = (_this select 3) select 1; _Locations2 = (_this select 3) select 0; player setPosASL (getPosASL (_Locations2 select _i2));}, [_LocationsArray, _i] ]; };
  3. I tried running it with the quotes and it still throws the same error as before. The str was unnecessary as you pointed out and fixed the "" appearing in the action title. _Location is defined from the init of the object calling the function. I wanted to be able to omit the object having a teleporter being added to go to itself. My thought was in doing it the way I attempted to was that I could check the _Location variable name that I defined when I called the script from the objects init. Then I could use find to remove the match in both arrays from that particular scope. It also occurred to me that it may not even work as a function I'm not sure if functions are compiled before object inits are ran. But in doing more probably incorrect thinking I think I know why its not working just not how to do it differently to get around this. So the addAction gets added but throws the error undefined variable when used. This leads me to believe that the code in the addAction is in its own scope which makes since now that I've taken a minute to think about it. So now that means that I'm trying to use an array from outside the scope of the addAction. So I tried changing the Array to a public Variable as these are never used for any other purpose they should be fine. Then it pointed me to _i being the undefined variable which helps validate my thinking. Now I just need to figure out how to pass the value of _i into the addaction as it iterates to each location and it should work right?
  4. So I have a mod list that works completely fine in a local host but when I load it on my rented dedicated server it just fails hard. I can launch a local server with faster fine. I'm kinda new to this so the rpt file doesn't help me a whole lot. I added it in a spoiler here I'll put my mods param folder also. You can try and connect but no mission loads. I'll add the cfg for the mission too. It looks really bad from what I can tell may be beyond saving. -mod=@CBA_A3;@CUP_Terrains__Core;@Operation_TREBUCHET;@ace;@CUP_Terrains__Maps;@Operation_TREBUCHET_First_Contact;@FIR_AWS_AirWeaponSystem_;@Operation_TREBUCHET_ACE_Compat;@Zeus_Enhanced;@CUP_Terrains__CWA;@Enhanced_Movement;@Ctab_Blufor_Tracker;@Immersion_Cigs;@HEBONTES_MILITARY_TRAINING_GROUND;@LAMBS_RPG;@LAMBS_Turrets;@JM_s_Structures;@CH_View_Distance;@LAMBS_Suppression;@Em_Buildings;@3den_Enhanced;@Ladder_Tweak;@MBG_Buildings_Killhouses_Arma3_Remaster_;@PLP_Containers;@Modular_Buildings__Laboratory;@Full_Halo_Music_Pack;@Jbad;@Vinjesvingen;@Mickey_s_Music_Mod;@Core__Rimmy_s_Cadian_Oddities;@Splendid_Smoke;@Pook_ARTY_Pack;@Cytech_Core_Assets;@Cytech_Underground_Map;@Advanced_Urban_Rapelling_v2_remade_;@WebKnight_Flashlights_and_Headlamps;@MS_IFF_Strobe;@INIDBI2__Official_extension;@Tembelan_Island;@LYTHIUM;@RHSPKL;@Bozcaada;@105th_Armor_Pack;@Isla_Abramia;@105th_Splash;@105th_Utility_Pack;@A2_Declassified_Fireteam_Zulu;@MRH_Satellite;@Operation_TREBUCHET_First_Contact_ACE_Compat;@OPCAN_3_0_By_Wolf_Of_Tribute_Modding_formerly_LM_;@CUP_ACE3_Compatibility_Addon__Terrains;@DS_Houses;@Task_Force_Arrowhead_Radio_BETA__;@ACE_3_Extension_Placeables_;@ACE_3_Extension_Animations_and_Actions_;@A3_Thermal_Improvement;@Gruppe_Adler_Trenches;@ACE_3_Extension_Gestures_;@LAMBS_Danger_fsm;@No_More_Aircraft_Bouncing;@HEV_Patch;@Keff_s_ONI_Materials_Group;@Freestyles_Crash_Landing;@Zeus_Enhanced__ACE3_Compatibility;@DUI__Squad_Radar;@Operation_Trebuchet_;@GRAD_Sling_Helmet;@Colourful_VR_Entities;@KAT__Advanced_Medical;@M224_60mm_Mortar_ACE_;@Crows_Electronic_Warfare;@DMNS_Optre_Assets;@Breach;@BackpackOnChest__Redux;@New_Mombasa_WIP_;@41st_ODST_MFR__Declassified_Assets;@Niakala;@Fapovo_Island;@Summa;@Lingor_Dingor_Island;@Isla_Duala; -serverMod=@CBA_A3;@CUP_Terrains__Core;@Operation_TREBUCHET;@ace;@CUP_Terrains__Maps;@Operation_TREBUCHET_First_Contact;@FIR_AWS_AirWeaponSystem_;@Operation_TREBUCHET_ACE_Compat;@Zeus_Enhanced;@CUP_Terrains__CWA;@Enhanced_Movement;@Ctab_Blufor_Tracker;@Immersion_Cigs;@HEBONTES_MILITARY_TRAINING_GROUND;@LAMBS_RPG;@LAMBS_Turrets;@JM_s_Structures;@CH_View_Distance;@LAMBS_Suppression;@Em_Buildings;@3den_Enhanced;@Ladder_Tweak;@MBG_Buildings_Killhouses_Arma3_Remaster_;@PLP_Containers;@Modular_Buildings__Laboratory;@Full_Halo_Music_Pack;@Jbad;@Vinjesvingen;@Mickey_s_Music_Mod;@Core__Rimmy_s_Cadian_Oddities;@Splendid_Smoke;@Pook_ARTY_Pack;@Cytech_Core_Assets;@Cytech_Underground_Map;@Advanced_Urban_Rapelling_v2_remade_;@WebKnight_Flashlights_and_Headlamps;@MS_IFF_Strobe;@INIDBI2__Official_extension;@Tembelan_Island;@LYTHIUM;@RHSPKL;@Bozcaada;@105th_Armor_Pack;@Isla_Abramia;@105th_Splash;@105th_Utility_Pack;@A2_Declassified_Fireteam_Zulu;@MRH_Satellite;@Operation_TREBUCHET_First_Contact_ACE_Compat;@OPCAN_3_0_By_Wolf_Of_Tribute_Modding_formerly_LM_;@CUP_ACE3_Compatibility_Addon__Terrains;@DS_Houses;@Task_Force_Arrowhead_Radio_BETA__;@ACE_3_Extension_Placeables_;@ACE_3_Extension_Animations_and_Actions_;@A3_Thermal_Improvement;@Gruppe_Adler_Trenches;@ACE_3_Extension_Gestures_;@LAMBS_Danger_fsm;@No_More_Aircraft_Bouncing;@HEV_Patch;@Keff_s_ONI_Materials_Group;@Freestyles_Crash_Landing;@Zeus_Enhanced__ACE3_Compatibility;@DUI__Squad_Radar;@Operation_Trebuchet_;@GRAD_Sling_Helmet;@Colourful_VR_Entities;@KAT__Advanced_Medical;@M224_60mm_Mortar_ACE_;@Crows_Electronic_Warfare;@DMNS_Optre_Assets;@Breach;@BackpackOnChest__Redux;@New_Mombasa_WIP_;@41st_ODST_MFR__Declassified_Assets;@Niakala;@Fapovo_Island;@Summa;@Lingor_Dingor_Island;@Isla_Duala; class Missions { class ARMA3 { template = OptreTestingRange.hebontes; // Mission to load (Mission file located in MPMissions, dont write here the .pbo extension, example: MyMission.Altis) difficulty = "Recruit"; // Server difficulty Settings (Recruit, Regular, Veteran, Mercenary) class Params {}; }; http://myaccount.dropsend.com/share/920e3f54656768d6cae3a4be1dcf182f
  5. I did not know this. Thankyou I will change that right away, that may explain why I needed to restart the server when it was on antistasi every few days.
  6. So I did get this working I went mod by mod and redone it. I realized I had 3 client side mods active on the server, I don't know if they were the cause or not. I also added no maps other than the one I needed to start with. The other maps I'll add as needed. I went about 5 mods at a time and tested a test mission I made for each addition of mods, that is dependent on the added mods. The rpt file still looks kinda scary but everything is running and seems stable. So I'm gonna go with if it aint broke don't fix it. I wish I'd found an easier solution to tell everyone, but I didn't. I did end up with the entire mod pack installed minus the maps and a 1 or 2 small things I decided I would never use.
  7. Yes I tried the server mods I think about halfway through my testing. It seems its not loading the mission. This error sticks out to me. Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.\na3_characters_f So I tried a clean install on the dedicated server same error even with vanilla missions. So then I tried a clean install on my PC using FASTER to quick setup a server, also same error. I almost wonder if something is wrong with arma Server's download right now. Thats 2 clean installs giving same error no mods installed or loaded.
  8. So I'm trying to create a couple guarded points with a script. I can create them with createGuardedPoint, but I can't seem to delete them. I tried deleteVehicle which did not work at all. My thinking is that it is not a vehicle so I can't delete it this way. I need to delete them after that portion of the mission is over so that other guard units that spawn later don't try and go to them. test1 = createGuardedPoint [east, getPosATL testM3, -1, objNull]; sleep 20; deleteVehicle test1; So next I tried just creating the trigger guarded by opfor because I know deleteVehicle works on them and couldn't seem to get the trigger working at all. It doesn't produce errors it just doesn't work. This is the first time I've ever tried spawning a trigger because I've had no need to before, so I've probably just screwed this up. _trg = createTrigger ["East G", getPos testM3]; I also tried putting them down in the editor and using enableSimulation but that throws errors that the variable is not defined even with a sleep to make sure it's created before the code runs, if that's even a thing. That may not cancel the guard status anyway just something else I had tried. If anyone knows a better way to do this or a way to get one of my three methods I've failed at working it would be greatly appreciated.
  9. Ok this makes more sense. I incorrectly assumed type could be any of the types listed in setTriggerType, even though it says it usually should be "EmptyDetector". I'll try this out and see if I can't get it working somehow. If not it's not going to ruin the mission or anything. For this particular scenario the guarded by triggers were just causing the AI to behave much better than normal, without heavily scripting them.
  10. So I have a trigger down in a captured village I'm spawning several groups of infantry and 1 mech inf group. I have it set that upon deactivation it will delete the units as the player leaves the area. It only deletes the units as expected after reading my own code. My issue is that I don't know how to tell it to delete the actual BTR that spawns with them. So whenever they respawn if you reenter the area the old BTR is still sitting empty where the new one spawns resulting in a large explosion and cook off. I'm thinking I just need to tell it to delete the BTR that spawns with it but don't know how. My brain says there should be a thing like forEach vehicle or something. //activation skalkaD1 = [getPosATL stage1marker1, west, (configfile >> "CfgGroups" >> "West" >> "b_afougf" >> "Infantry" >> "b_bafougf_infantry_fireteam")] call BIS_fnc_spawnGroup; [skalkaD1, position leader skalkaD1, 150] call BIS_fnc_taskPatrol; //deactivation { deleteVehicle _x }forEach units skalkaD1;
  11. Thankyou I did get this to work. I tried it last night didn't work, tried again this morning worked great. Was giving me expected type array is type of group last night. Which prompted me to research things and understand them incorrectly. I did learn some new functions and a better understanding of groups and arrays during my research though so it worked out!
  12. So I found a roundabout way of doing what I was trying to do. I dug into the biki and found out that groups don't include vehicles and using my caveman level scripting knowledge I came up with this. {deleteVehicle _x} forEach nearestObjects [position leader skalkaD2, ["all"], 3]; { deleteVehicle _x }forEach units skalkaD2; This could probably be done better but this is what I pieced together using my library of things I've been able to make work in the past. I do need to change the "all" to "car" or "tank" after I figure out what a btr is considered. otherwise it'll probably wander next to some important thing and delete it knowing my luck and arma.
  13. So I've been making a liberation type map with all custom points. I've been hand placing the enemies, so they look like they're actually living there. After the point is captured the layers switch after 10 min and there is now a fob that is spawnable there. My scripting knowledge is limited so I usually put things in the init of units, it's just easier for me to visualize what I'm doing and keep track of it all. So I've been hiding the layers until they are activated manually because there's ALOT of ai on the map. It works absolutely flawless for me and my standards I get great frames across the map, and the layers are hidden and not trying to move around. The problem starts when other players join. The AI of the units disables but not the simulation and model. Here's the code I put in the init of a unit. This is the first time I've ever even tried to use serverExec so i probably messed it up. call{{_x disableAI "all"; _x enableSimulation false; _x hideObject true;} forEach (getMissionLayerEntities "mantiq" #0)} remoteExec ["call",2];
  14. So, me and a friend have started collaborating on making our own combination of liberation and direct action on the new map North Takistan for our small group. We've been hand placing civilians and units in editor. I just learned there's an ai limit and that I'm probably going to hit the 144 groups limit. I'm probably there with civilians I just haven't seen the effects yet. My question is will units deactivated by dynamic simulation be affected by this limit or will they be ok. Literally everything is set for dynamic simulation. If not does disabling all ai in a layer work to keep me from hitting the limit and just activating a layer as needed. If there's no way to have units placed in editor and not affecting the limit what are your suggestions moving forward? It would be super cool if there was a way to store and spawn a layer as needed but I'm sure that's asking a lot.
  15. I ended up switching to Engima’s civilian script for my civilians. I will say I’ve tried all kinds of mods for modules and none of them have come close to how good it is. The mission I’m going for is a liberation type mission with more interesting points and unique objectives so the layers have worked fine so far, and are within my skill to use. I just manually activate them to avoid bugs with points not activating. I did run into an issue with the layers only deactivating for me. Other players still see the units and hidden objects. Their ai is still disabled but their simulation and model are shown. I’m guessing the way I’ve done it is local only. I just put the hide layer in the init of a unit. I worked on researching this issue all night ended up making a second post for it.
  16. So I’m trying to add a feature to my mission where the number of civilians killed by players effects things that can happen later in the game. I’m using cup civilians so checking the civilian side isn’t working for me. Is there a way to assign all my civilians to something that I can then assign an event handler to. I don’t care to go through every civilian and add them to an array or something. I just don’t know how. Then say I accomplish this how do I check in the init.sqf that one has died and add a number to the variable. The end result I’m looking for is that all civilian kills by players only are added to a global variable I can use to activate different triggers based on the value. I found several scripts to do it with vanilla civis but they don’t work with cup civis. That’s why I was thinking I could assign all mine to “something” that I can add an event handler to. You’ll probably have to put all this in idiot terms for me it’s been a long time since I’ve tried to program anything.
  17. Thank you guys I got it to work now. I wasn’t aware of the rating thing. I’m pretty new to arma in general so I’m learning new things everyday.
  18. addMissionEventHandler ["EntityKilled", { params ["_killedUnit","_killer","_triggerMan"]; if (side group _killedUnit isEqualTo civilian && _killedUnit isKindOf "CAManBase" && side _triggerMan isEqualTo west) then { if (isNil {missionNameSpace getVariable "MyCivKillCounter"}) then { missionNameSpace setVariable ["MyCivKillCounter",0,true]; }; missionNameSpace setVariable ["MyCivKillCounter", (missionNameSpace getVariable ["MyCivKillCounter",0]) + 1, true]; }; }]; This is the code I found on a other post on here that I modified. I pretty much just need that variable so I can use it for triggers. I don’t exactly fully understand it my main background in programming is with robots, which are much simpler.
×