-
Content Count
662 -
Joined
-
Last visited
-
Medals
Everything posted by loyalguard
-
Giving a specific infantry unit medical ability
loyalguard replied to Dreadnought1's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here is a similiar thread with some insight and ideas: http://forums.bistudio.com/showthread.php?t=105468 In short the answer is no, you would need an addon or do some more involved scripting. If you want it to be self-healing you should check out Celery's heal script as well: http://forums.bistudio.com/showthread.php?p=2030783 -
How do I move an item/weapon to a new slot in the gear?
loyalguard replied to Gunter Severloh's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
Yes...I understand...I can try some things tomorrow. -
Creating a PBO with scripts in
loyalguard replied to Tomsk's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
This is a very simplistic explanation that may not be completely correct but should give you an idea of what an addon does. Here are good reference points in the Biki: 6thSense.eu:CG and modules Essentially an addon "patches" the content of the game by overwriting classes and/or their properties or adding new classes to one of the available root classes such as CfgWeapons, CfgVehicles, etc. It does this by "patching" the game configs. When the game start it extracts all of the relevant pbos to form the game config that contains all the properties the game needs to know about content that it needs to run. If you have a mod installed it also extracts info from the mod to further "patch" the game. If you want to get new content into the game, you have to patch the configs to do so. To focus on getting scripts in game via an addon, I have never done what [GLT]Myke describes. You might be able to just create the following folder structure: @MYADDON --Addons ----MYADDON -----$PBOPREFIX$ -----script1.sqf -----script2.sqf Then make the MYADDON folder into a pbo and then install it like any other mod. Then in game if you execute "\MYADDON\script1.sqf" it might work. Or, you might need to add a config.cpp to get the addon in game in which case you would need a config.cpp like this inside MYADDON: class CfgPatches { class MYADDON { units[] = {}; weapons[] = {}; requiredVersion = 1.10; requiredAddons[] = {}; }; }; and then you just execute them as described above The links above will show you how to introduce new sounds, models, vehicles, etc. To get an addon to execute a script automatically (either at initialization or after some other event) you use the config to patch in event handlers. This is where extended event handlers come in so handy so you do not overwrite other event handlers in the vanilla content or added by other mods. See my example here to see how to do that I hope that helps. -
Nuclear Explosion Effect
loyalguard replied to Lolsagna's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There are several nuke effects script out there if you do a search. It is still based on a point or center. The first element in the array is a position Array (in format position) or Object (object position) or String (marker position). The other elements are optional but are areaSize (default is 1000 is left blank), seed, and blacklist. See the article for more explanation of seed and blacklist -
Nuclear Explosion Effect
loyalguard replied to Lolsagna's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Check out this: BIS fnc destroyCity Please note this will not destroy every building. It damages some and leaves some untouched. If you do a search you can find some interesting variants other have come up with. -
Do excessive triggers/units corrupt a mission?
loyalguard replied to froggyluv's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There is a lot of debate about triggers and lag. Here is a compilation post I made that contains several threads about trigger lag (but also in relation to scripts, loops, etc.): http://forums.bistudio.com/showpost.php?p=1595350&postcount=13 -
How do I move an item/weapon to a new slot in the gear?
loyalguard replied to Gunter Severloh's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
So I have tried what seems like every combination of weapon/slot type and scripting combination without luck. If the knife is not type 4096 then binos or NVG show up in the unit's hand and if there are none then an empty hand. I might try some of the other variant knife classes but I have a feeling the results will be the same. This is only a guess, but I think the problem might be the animation itself. Perhaps it will only work with slot 4096 weapons. I know very little about animations so I am afraid I cannot be of any assistance there. -
foreach, EventHandler & variables
loyalguard replied to wiggum2's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Maybe I am reading it wrong, but based on this code: { _shot = _x getVariable "shot"; } forEach units _grpToHunt; _shot gets overwritten every time it checks a new unit in the group. So if you have two units in a group, unit 1 has "fired" and unit 2 has not, _shot == 1 on the first iteration of the forEach but then becomes _shot = nil on the second iteration. Stand by for a solution... Can you simplify by doing something like this: // Add fired EventHandler to all units of _grpToHunt that executes a script and passed _this arguments array to the script. { _x removeAllEventHandlers "fired"; _x addEventHandler ["fired", {_this execVM "shot.sqf"}]; } forEach units _grpToHunt; private ["_unit"]; // The unit that "fired" _unit = _this select 0; //Do something then remove all event handlers. { // Insert do something code here. _x removeAllEventHandlers "fired"; } forEach (units group _unit); So as soon as any unit "fires", it executed the script that does something and the removes the event handler. Will that work or do you not want to have it happen right away and instead want to check after a certain interval? -
Soldiers Names in Addon
loyalguard replied to LUPO_'s topic in ARMA 2 & OA : ADDONS - Configs & Scripting
You probably have to create a new subclass in CfgWorlds > Generic Names. See this thread for a similar question. http://forums.bistudio.com/showthread.php?t=80108 -
Oil Wells on Fire
loyalguard replied to texkaz's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There is a great script included in the game that will do so and a lot of threads. Search for BIS_Effects_Burn and/or burn.sqf -
Head Bob Not Disable
loyalguard replied to SwordfishBR's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I am fairly sure that if a player has head bob disabled you cannot force camera shake even if you use enableCamShake true; -
isServer & createvehicle problem
loyalguard replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I began to cover some of what you would need to do in this other thread of yours: http://forums.bistudio.com/showthread.php?t=125548 I can give you some example code, but first...is there any reason you do not want to use the normal task system (createSimpleTask, setTaskState, etc.)? It is by no means mandatory but it is "cleaner" and is what players expect? --Edit-- Anyway, using your existing code, you could use public variables and event handlers but since you are only monitoring "alive", you probably don't need to use PVs at all: Run this on your server: if (isServer) then { obj1 = createVehicle ["UralReammo_TK_EP1",getMarkerPos "c1",[], 0, "NONE"]; obj2 = createVehicle ["UralReammo_TK_EP1",getMarkerPos "c2",[], 0, "NONE"]; }; Run this on your clients: private ["_objs"]; _objs = [obj1, obj2]; //Wait until one object is dead. waituntil {sleep 0.3;{alive _x} count _objs == 1}; hint"1/2 caches destroyed"; if (!alive obj1) then {deletemarker "cache1"} else {deletemarker "cache2"}; // Wait until the other object is dead. waituntil {sleep 0.3;{alive _x} count _objs == 0}; if (!alive obj1) then {deletemarker "cache1"} else {deletemarker "cache2"}; if (!alive obj2) then {deletemarker "cache2"} else {deletemarker "cache1"}; hint"2/2 caches destroyed"; // Send Chat Messages sleep 5; Xray = player sidechat "Xray to HQ, the ammo caches have been destroyed, Xray out."; sleep 10; Headquarters=[West,"HQ"]; Headquarters SideChat "Copy Xray, good job."; sleep 5; Xray = player sidechat "Were on our way to HQ"; That should do the trick. Basically, the server creates the vehicles and the clients wait until one of the objects is "dead" and progresses to the next waitUntil and so on. Since deleteMarker and sideChate are local commands they should run on the client since the monitoring scripts is running on them. The same effect could also be done with triggers. -
I want to make a sandstorm...
loyalguard replied to vostov's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://community.bistudio.com/wiki/BIS_fnc_sandstorm -
AEG - ArmA Electrical Grids (Script Pack and Addon)
loyalguard replied to loyalguard's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
If anyone else experiences any bugs like Humvee28 reported please advise. It may only be related to the current beta and may resolve itself. If you are using the current stable 1.59 and see bugs like this please let me know! Thanks all! --EDIT--- The problem seems to be connected to the OA 85478 beta patch only. This will hopefully self-resolve when the 1.60 patch is final. -
How do I move an item/weapon to a new slot in the gear?
loyalguard replied to Gunter Severloh's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
I can try that but it should be happening anyway because after the bino/nvg code it tells the unit to select the knife so it should happen by default. I will play with it some more tonight. The other weird part is that code that adds binos/NVGs in meleeanim.sqf. If you start off without binos (or NVGs) and use the knife you will get them both automatically and you have all three even though there are two slots in the gear dialog. -
AEG - ArmA Electrical Grids (Script Pack and Addon)
loyalguard replied to loyalguard's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Humvee28, That is very strange. Just to be safe I also tested with ACE and ASRAI without issue and re-downloaded and ran it without mods and still have no issue. I am going to send you a PM with a special debug mission. If you are willing, would you mind doing the following: 1. Save then debug mission to single missions. 2. Run it in SP. 3. Go to the pole at the Zargabad military base and using the action menu trip the circuit breaker. 4. Wait a few seconds and if you see the option to close circuit breaker please select that as well. 5. End the mission. 6. Go to your .rpt file. Inside it you should find a lot of entries that look like this: DEBUG: SP: B 1-1-A:1 (User): TIME: 0.016: AEG_init.sqf: Thread started. DEBUG: SP: B 1-1-A:1 (User): TIME: 0.016: AEG_init.sqf: SP Detected - MP JIP check skipped. AEG: Addon init started... Please send me a pm with the contents of your .rpt or at least all entries that start with "DEBUG" and look like the above. ---- Alternatively, create simple mission in the editor of any man unit near the pole at the Zargabad base. Do not use the addon or script demo. Save the mission to single missions and run it to see if you have the same issue. Thanks for your help! -
How do I move an item/weapon to a new slot in the gear?
loyalguard replied to Gunter Severloh's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
Sorry for the late response...I have time to try to tackle it this weekend. --Edit Update-- I just spent about two hours trying different things out without any real success. Here are some highlights: 1. The code I mentioned above in meleeanim.sqf gives a player bino and/or nvgs if they don't have them when they "fire" the knife. It you remove the code and remove binos and nvgs from the player, it does not give them the items nor do the binos appear in the players hands...BUT...nothing appears in the player's hand...it just looks like a stroke/punch. 2. The configs are confusing because there are knife mags and knife weapons...all with the same names...this could be causing conflicts because I don't think you are supposed to give a wep and a magazine the same class name. The configs are also confusing because there are a lot similar classes (knife, knife_under, knife_anim, knife_item, etc.). It is hard to sort each out so I might strip everything except the most basic and see what happens. I also need to temporarit move melee_give because it preloads the unit with a knive and mag and I need to be able to control each better. -
AEG - ArmA Electrical Grids (Script Pack and Addon)
loyalguard replied to loyalguard's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Thanks for the bug report! Hmmm. Let me get on that right away! --UPDATE EDIT-- @Humvee28 - I am not able to reproduce the bug. I just-retested in the demo and in a regular mission in the editor, SP, and MP Dedicated and it worked fine. Can you provide some more details? Thanks for the help! -Mission Name: ???? -Other Addons: ???? -Mode: Editor / SP / MP Host / MP Dedicated -Other Circumstances: ???? -
VME PLA MOD for ARMA II
loyalguard replied to Alex.XP's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
SVN and GIT are forms of version control software. It allows multiple developers (or even just one) to work on the same project and be able to track changes, merge versions, revert in case of error, etc. -
AEG - ArmA Electrical Grids (Script Pack and Addon)
loyalguard replied to loyalguard's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Announcing 1.00 Release!!! See first post for download links and changelog. Only minor tweaks made from the beta version as far as the simulation goes. The 1.00 release contains extensive in-game documentation for mission makers who want to use AEG for tasks/objectives. Example of In-Game Documentation: I also added islandmaker.txt for island makers who want their islands to have more releastic electrical grids and be more easily supported by AEG. There is also a server/client version check to ensure that when using the addon version that the server and client have the same version. If they do not, the client version aborts with an alert to the player. Now that 1.00 is out I can focus on getting some custom islands added!!! Stay tuned! -
AH64 Gunner Script
loyalguard replied to 75thRanger's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
See your other thread in Configs & Scripting. -
Any one want to help me make a config.cpp for a script?
loyalguard replied to 75thRanger's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
I am posting your solution in this thread so that others who also want to know how to do this may learn as well. This is not how this is normally done. This will help you achieve what you want to accomplish, but just handing the solution over will not help you learn how to do it on your own. As such, Once you have this working, I challenge you to dissect it and learn WHY it works. Doing so will help you become a stronger scripter/config writer/addon maker. Again, refer to the guidance I gave you in the posts above. Inside them are all the steps/reference material you would have needed to create the below. This is an A-Z guide to make your script(s) work in an addon. 1. Create a folder named "@gunner_switch". Put whatever name you want after the "@" but be consistent in whatever you choose. I will use "gunner_switch" for the remainder of this example. 2. Inside "@gunner_switch" create a subfolder called "Addons". 3. Inside "Addons" create another subfolder called "gunner_switch". 4. Inside "gunner_switch" place the following files: Swap_Actions.sqf To_Driver.sqf To_Gunner.sqf $PBOPREFIX$ config.cpp 5. Open $PBOPREFIX$ in a text editor and enter this single line of text with no whitespace before or after the text: gunner_switch 6. Put this in your config.cpp: class CfgPatches { class gunner_switch { units[] = {}; weapons[] = {}; requiredVersion = 1.0; requiredAddons[] = {"Extended_EventHandlers"}; }; }; class Extended_Init_EventHandlers { // Define the classes to add inits to. class Air { // Add init lines to be run on all units that inherit from this class. gunner_switch_Init_Air="_this execVM ""\gunner_switch\Swap_Actions.sqf"";"; }; }; This will add an init XEH to all "Air" class vehicles. If you want to limit it to only a certain sub class then change "Air" to whatever you want. 7. Pack you PBO and ensure that you have @gunner_switch and @CBA installed and running. 8. Place a helo in game and the actions should appear when inside. -
A Sad day Dennis Ritchie, inventor of C programming language, has died.
loyalguard replied to walker's topic in OFFTOPIC
#include<stdio.h> main() { printf("RIP"); } -
ARMA 2: OA beta build 85434
loyalguard replied to buliwyf's topic in ARMA 2 & OA - BETA PATCH TESTING
This is outstanding! It never ocurred to me to ask for it but I've wanted something like this for years to help with testing. -
Any one want to help me make a config.cpp for a script?
loyalguard replied to 75thRanger's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
Ok, so if you want to make this into an addon, here are the things you will have to consider. 1) When do you want the action to appear? I assume you only want it to appear when you are in a helicopter. You have to decide (if you have not already) whether you want to show the option in any helicopter or in a certain helo(s). In this case a GetIn event handler would probablt be the best method to trigger when this actions show. Read about it here and you should get familiar with all the different event handlers. 2) How to get the event handler / action / script to work as part of an addon. You should really use Extended Event Handlers (part of CBA) to accomplish this. Read this to get familiar with XEH. You will probably want to use class Extended_GetIn_Eventhandlers. 3) Create your config.cpp. The config.cpp will include your class CfgPatches and XEH sections. Again, my post here wil help Get familiar with all of these concepts and see if you can put it together. You will run into roadblocks but these will help you learn as well. What you are trying to tackle. Although outwardly what you are trying to apperas simple, but you are trying to do some advanced things when it comes to scripting/addons. It took me a good 3 months and some extremely knoweldebale tutors before I was even comfortable with configs and addon making at the simplest of levels. Have patience and it will all come together. Good luck!