UNN
Member-
Content Count
1767 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by UNN
-
If your talking about calling the same bit of code multiple times from multiple event handlers then its not really recommended. It has the potential of bringing the mission to a grinding halt. But there is no need. If you don't already have an object you can place on the map in your current config. Just create a game logic that creates a repeating trigger when the mission starts using the logics init event. Also from that logics init event, call something like the script I posted above. It's designed to only add eventhandlers to current\new objects once, during the mission. So it will cater for respawns and units created while the missions running. It's a reasonable efficient way of doing it, could be made a little better if you added getin and getout events to help keep track of who is in a vehicle.
-
Yeah, we plan on adding support for generic crates and containers. It helps reduce the number of proxies and also helps with small or awkward cargo. We can have loaded vehicles as cargo, but for now, they probably won't show their cargo. So if you load a truck full of ammo crates into the back of a Hercules, you won't see the crates on the loaded truck until you unload the truck again. If someone came up with an addon that warranted it, then I could add it as a special feature for that addon.
-
I don't think I need to take it beyond what’s already shown? It's less than the default radius you get with the command view. I might add the option to zoom in, set a user defined restriction on it or even disable the overhead view, if that’s what the mission designer wants. Also The ability to scroll round the map will be limited to the loading radius for the selected vehicle. You can have a combination of infantry and cargo, any infantry occupying a designated cargo slot will be ejected when it's loaded. But when it comes to an addon that has not been designed with the Cargo system in mind, like the BIS vehicles. Then you might get some clipping with the passengers and the adjacent cargo, but not much. If you choose your cargo anims carefully when your making a config for a vehicle, then the problem can be avoided. Lol..Yeah, it kind of turned out that way. It started off with a slightly more conventional band called Pizzicato Five and ended up their, after ever increasing extremes ATM there is a 50m loading radius between cargo and transport. I'm following that fast rope thread myself. There is still under slung loads and para drops to be added at some point. It would be nice to have something that resembles real world physics. I could probably spend a lifetime just working on new cargo objects and functionality, but we have to draw the line somewhere. The Cargo system is just a small part of the overall system we want to implement. If it turns out to be useful, then we at RKSL, would be happy to collaborate with anyone who wants to expand it further. I'm afraid it's bare essentials at the moment. But I still have plenty more music So if I can get my hands on something big enough to fit some vehicles in, I will try and oblige. It's all proxy based, so it helps reduce the number of scripts running in the background and network traffic. No worries, keep em coming
-
If when you say "every unit" you mean all Men and Vehicles then a triggers not a bad solution, but not for buildings. At least with a trigger you can use any addon in your mission without having to create a new config for it. Also you don't have to go and add to the init field, for every unit on the map. But with dynamically created units or respawning units in MP, your going to have to constantly monitor the trigger. If you forget about the code to create the trigger for now, you will have something like this, running every x seconds of your mission: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_OldInfantry=[]; _OldVehicles=[]; _LastCount=-1; WaitUntil     {     _CurrList=+(List _MainTrigger);     _CurrCount=Count _CurrList;     If (_CurrCount!=_LastCount) Then         {         _LastCount=_CurrCount;         _CurrInfantry=[];             {             _CurrInfantry=_CurrInfantry+[Crew _x];             } ForEach _CurrList;         _NewInfantry=_CurrInfantry-_OldInfantry;         _OldInfantry=+_CurrInfantry;             {             .....Add your Infantry event handlers here             } ForEach _NewInfantry;         Sleep 0.5;         _CurrVehicles=+Vehicles;                 _NewVehicles=_CurrVehicles-_OldVehicles;         _OldVehicles=+_CurrVehicles;             {             .....Add your Vehicle event handlers here             } ForEach _NewVehicles;         };     Sleep 0.5;             (False)     }; Obviously if you have loads of units in your mission, it could cause some lag. But Arma's scripting is pretty fast and you could always adjust the number and duration of the sleep commands.
-
Not sure about using CoC_NS, there isn't much need atm. But I have made heavy use of the new Arma MP commands, so I'm not exactly sure how it will stand up in a real life MP game. It works fine in tests for regular MP, a couple of minor issues with JIP for the script based system. But thats about it. The user actions are quite fast when you have a limited number of objects to play with. But the system will default to the dialogs, with a single command to swap to user actions if required. I actualy started with the user actions first, seen as I havn't done any dialog scripting until now. So it was easy enough to keep them in. I'm looking to get this finished and released as a Beta ASAP. Just in case anyone else wants to start supporting the system sooner rather than later, with their own addons. Plus it would be handy to get some feedback on the performance in MP to. It will at least support all the default Arma vehicles and any suitable objects for now, until we have the heavy transport up and running. But the system is modular, so it will be easy enough to expand the range of vehicles and cargo. Yeah, it is just the tip of the Iceberg. The whole thing could be extended into a general object interface. So setting up roadblocks e.t.c will not be restricted to VBS2 only. Lol...I think it's sugoi! Thought it might suprise a few people. Wait till you here what I have planned for the Herc It's a Band called Mosiac Wav and the tracks called Youkoso! Himitsu no Suzume Baraya! Thanks for all the feedback. I will try and get a proper news release posted on the RKSL site, with more details about the system. Cheers
-
Hi, Here's a crude video I knocked up to demonstrate the RKSL Cargo System. You probably won't see anything you would call exciting, but I'll settle for practical It will come in two versions, script and addon based. The script based version, without the visible cargo proxies. With both systems, there are two different interfaces for the mission designer to choose from. Either User Actions or Dialogs. All versions support both single player and multiplayer. Anyway, you can download the video here: RKSL Cargo System Preview Cheers Edit: Updated the download link
-
Yeah, with all the people who profess to prefer game play over eye candy, this should not present a problem. Using Lock On in the title though, might give some people the wrong idea, although I understand where your coming from. Larger islands offer a good opportunity to balance out certain aspects of the game. The ground war is still relevant, only it becomes heavily dependant on air superiority, for ammo, fuel, reinforcements and close support e.t.c If you can live without the excellent standards in map making set by Sara. Then I'm sure it will offer an enticing form of game play, for those who are that way inclined. Looking forward to seeing the results of your tests.
-
In OFP the onMapSingleClick comand would return world coordinates. Is that what your using to get the designated target positions? If your using the new dialog events, or they have changed the onMapSingleClick in Arma. Then you might have to convert the map coodinates to world coordinates, using ctrlMapScreenToWorld.
-
You need to call CreateGroup once you've created your Center. Also after that, if you are creating groups that belong to a side, that wasn't present in the mission editor. You have to setup who that side is hostile and friendly to. I posted some code here, that covers everything you need to do: CREATECENTER
-
That sounds like a problem with your animation definitions, in the config. Have you looked at Arma.rpt to see if there are any errors relating to CfgSkeletons, Bones or missing Vertex?
-
I think the best you could do, is make Civilians, hostile to everyone and everyone hostile to Civilians. Although how that will work with empty vehicles, I'm not sure.
-
Make Event handlers Global ( Killed )
UNN replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
He's using the Vehicles command, so the list should be available from the start. -
Make Event handlers Global ( Killed )
UNN replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
I see, looks like you found a new feature in the scripts The code you posted: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (isServer) then {{[_x] execVM "GL2Plus\GL2Plus_Event\Server.sqf"}} forEach _groups Is a variation on the two grouplink2 scripts. Both those scripts do two different things. The first executes a foreach loop if GL2Plus_AIhearingaid is equal to true. The second executes a foreach loop that checks each group, to see if it's empty. For your original code, you just need to use the same format as the first method: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (GL2Plus_AIhearingaid) then {{[_x] exec "GL2Plus\GL2Plus_Reacted\Advance.sqs"} forEach _groups} But still, your code does what it's supposed to do. I'm just suprised it worked that way. -
What do you think need's more resources?
UNN replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
Don't think of ~ or Sleep as some sort of magic commands. Both of these are loops and equivelent to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~10 Equals <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_MyTime=Time+10 @(_MyTime<=Time) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Sleep 10; Equals <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_MyTime=Time+10; WaitUntil (_MyTime<=Time); ~ and Sleep just save you having to type out something like the above. WaitUntil and While ar two different commands and should be used accordingly. But all of this has been debated since OFP and without any insight into the script engine, it will probably continue that way. -
Make Event handlers Global ( Killed )
UNN replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
Yeah, it kind of works. But I think that could be classed as a bug, not a feature? If you want to do anything else within that if condition, once the ForEach loop has finished. You would have to revert to the usual method, otherwise something like this throws up errors: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Total=0; If Player {{If (_x>0) Then {_Total=_Total+_x}; Hint Format ["Total %1",_Total]} ForEach [1,2,3,-1,5]; This way, your ok: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Total=0; If Player {{If (_x>0) Then {_Total=_Total+_x} ForEach [1,2,3,-1,5]; Hint Format ["Total %1",_Total]}; It's not like it's going to cause a major problem, but easy to avoid in the future. -
Make Event handlers Global ( Killed )
UNN replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
In theory those two bits of code you posted do the same thing. Although I'm suprised either of then will work. Perhaps this is why you hit problems: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (isServer) then {{[_x] execVM "GL2Plus\GL2Plus_Event\Server.sqf"}} forEach _groups Should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (isServer) then {{[_x] execVM "GL2Plus\GL2Plus_Event\Server.sqf"} forEach _groups} But anyway, glad to here it's working the way you wanted. -
Here's a simple addon and example mission. UNNUserActions.zip The user action works fine. Nothing special about the model or config, I used: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches     {     class MyHouse         {         units[] = {"MyHouse"};         weapons[] = {""};         requiredVersion = 1.08;         requiredAddons[] = {};         };     }; class cfgVehicles     {     class House;     class MyHouse : House         {         scope=2;         displayName="My House";         model="\MyHouse\MyHouse.p3d";         class UserActions             {             class MyAction                 {                 displayNameDefault="<img image='\ca\ui\data\ui_action_open_ca.paa' size='4'/>";                 displayName="My Action";                 position="myaction";                 radius=10;                 onlyForPlayer=1;                 condition="True";                 statement="Hint ""Action""";                 };             };         }; So I cant help thinking it's a problem with your user action conditions or your p3d?
-
Make Event handlers Global ( Killed )
UNN replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
SNKMAN, It's better to approach these sort of problems a bit at a time. Try getting this up and running for a single vehicle in a new mission: Create init.sqf with: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">GL2Plus_SmokeEffect=True; If IsServer Then     {     _InitString = "this AddEventHandler [""Killed"",{_This ExecVM ""AddKilledEvent.sqs""}]; Hint ""Killed Event added""];";         (vehicles Select 0) SetVehicleInit _InitString;     processInitCommands;     }; Then start off with AddKilledEvent.sqs as: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle=_This Select 0; If IsServer Then     {     SERVERSIDE=Format ["Server: Effect %1 Kindof %2",GL2Plus_SmokeEffect,_Vehicle IsKindOf "LandVehicle"];     PublicVariable "SERVERSIDE";     }     Else     {     LOCALCLIENT=Format ["Local: Effect %1 IsKindof %2",GL2Plus_SmokeEffect,_Vehicle IsKindOf "LandVehicle"];     }; Run the mission in MP and display the content of SERVERSIDE and LOCALCLIENT, using hint and a radio trigger after you destroy the vehicle. If both variables return true values, then your ready to add the rest of the code. If you don't see the "Killed Event added" message when your mission starts. Then there is, a problem with your init commands. Still more to take into account with JIP, but you can worry about that later on. -
Problem woth "fire" and foreach command
UNN replied to chops's topic in ARMA - MISSION EDITING & SCRIPTING
It should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{(Vehicle _x) fire "m119"} forEach (units tube) The units command returns only the men. So you have to get a reference to the vehicles. -
Strange "Call Compile Loadfile" Bug
UNN replied to ColonelSandersLite's topic in ARMA - MISSION EDITING & SCRIPTING
Yeah, I wasn't 100% sure and thinking about it. It does not following the same route as the problems I mentioned, form previous experience of calling _this half way through a long script. But it does sound like a problem with array pointers or a functions scope. Â Does any of the functions your calling also contain a variable call _files, that might have been omitted from the functions list of private variables? Data could be leaking from the scope of one function into another. For array pointers, if you add the + command, you can be sure your referencing a new copy of the array which can't be corrupted elsewhere by other scripts. Won't fix the problem if that is the case, but it can help narrow down the search. -
Strange "Call Compile Loadfile" Bug
UNN replied to ColonelSandersLite's topic in ARMA - MISSION EDITING & SCRIPTING
I think the problem might be down to array pointers and _This. I noticed something similar when trying to determine the number of parameters passed to a script. Basicly _This resides in the parent scope of the calling script. So when you execute the call command within that script, _This is reassigned. I can only assume from what you said. That the call compile bit, when used without parameters, defaults to the content of the function. If thats the case then using the copy command, should fix it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_files = +(_this select 0); Assuming your not updating the location pointed to by (_this select 0) at the same time your running your loop. If you are then perhaps this would work: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">while {_i < _patrolContentsCount} do { private ["_this"]; _fileContents = _fileContents + [call compile loadFile (_patrolContents select _i);] }; Or something similar, used in the scripts you load via Loadfile. P.S I guess _patrolContentsCount and _patrolContents are typos, seen as you don't define then. And should be _fileCount and _files? -
In OFP we had to define all the inherited classes, like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles     {     class All {};     class AllVehicles: All {};     class Land: AllVehicles {};     class Man: Land {};     class Soldier: Man {};     class SoldierWB: Soldier {};         class MySoldier : SoldierWB         {         displayName = "My Soldier";         }; In Arma, thanks to external bases classes we can now do this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class cfgVehicles     {     class SoldierWB;        class MySoldier : SoldierWB         {         displayName = "My Soldier";         };     }; Does anyone know if it's possible to define our own external base classes? I would like to be able to do something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class cfgVehicles     {     class UNNBaseClass;        class MySoldier : UNNBaseClass         {         displayName = "My Soldier";         };     }; Cheers
-
After your reply I knocked up a basic example to test and it works without any problems now. So I can only put my previous problems down to fatigue, after spending most of the night trying to inherit from CfgMovesBasic. Not had chance to test it with my new CfgMovesBasic class, but I'm sure it will be ok now. So thanks for setting me straight. As a side note, I could still get my basic test to work even without the RequiredAddons section: MyBaseClass.pbo: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches     {     class MyBaseClass         {         units[] = {"MyBaseSoldier"};         weapons[] = {};         requiredVersion = 0.1;         requiredAddons[] = {};         };     }; class cfgVehicles     {     class SoldierWB;     class MyBaseSoldier : SoldierWB         {         Scope=1;         DisplayName="";         };     }; Which I then reference using... AWestSoldier.pbo: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches     {     class AWestSoldier         {         units[] = {"AWestSoldier"};         weapons[] = {};         requiredVersion = 0.1;         requiredAddons[] = {};         };     }; class cfgVehicles     {     class MyBaseSoldier;     class AWestSoldier : MyBaseSoldier         {         Scope=2;         DisplayName="My New Soldier";         };     }; Like I said, it appears to work without any problems. But I'm sure It's better to explicitly define the required addons section as you do in your example. As it will probably help to avoid problems in the future, when things start to get more complicated. Cheers
-
Thats what I thought, so I did try that already, without much luck. Although you don't have to include any of the default Arma Cfg's to the requiredAddons section, to inherit from their base classes? But it's late and it was a last minute thing. I will give it another go tomorrow. Cheers
-
It's using the same method the guys in the FLK mod used in Flashpoint. Swap the original object for some broken bits and apply a little velocity. But it does look nice.