Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

KrazySwede

Member
  • Content Count

    17
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by KrazySwede

  1. I named a backpack "thepack" and placed it next to me in the editor. I then entered the following into the Debug console to return my position and that of the pack: hint format["Me: %1\nPack: %2",getPos player,getPos thepack]; It returned two very different positions, even though I was sitting right next to the pack (see image). I am trying to mark the pack's position with a marker, but this is proving difficult since I can't rely on getPos to get the the pack's position. Does anyone know why this is happening? http://i.imgur.com/ZvuRBqb.jpg (305 kB) Thanks, KrazySwede
  2. Good observation. It's not quite double but maybe that's a result of rounding. Thanks for reporting it.
  3. In the editor you can add multiple conditions in a trigger's "Condition" field, like... this AND alive unit Can this be done with a trigger that's created via an SQF script, and if so, how? Thanks, Marcus
  4. Is there any way to prevent a mission from being rehosted by a user who has played the mission? I'm referring to the PBO copy of the mission that ends up in the MPMissionsCache folder which can then be moved to the MPMissions folder and hosted.
  5. @Harzach and marker It's not something I am looking to do with everything I create for Arma, I just want to have the ability to keep some content private without being confined to a password-protected server. The PBO approach sounds interesting, but [ASA]ODEN suggested a solution with the same idea as alleycat - keeping it all on the server. I simply put my mission script in my Arma 2 folder (using subfolders) instead of the mission folder to prevent them from being PBO'd and cached to clients.
  6. @AVIBIRD 1: I understand your frustration, but I have no patience for those who edit and host my mission as their own against my expressed wishes. That is why I am spending time trying to implement this feature instead of making missions. Thanks for the suggestions. Couldn't it be called from a script in the regular Scripts folder (ArmA 2 Other Profiles\Me\Scripts), since these are not sent to the client? But even so, what I can't get my head around is how to call the function in a way that can't simply be edited or removed after de-PBOing the mission.
  7. I posted this on the Armaholic forum a while ago but was unable to solve the problem, so I thought I'd give it a shot here. My basic problem is that the "createVehicle" will spawn men but not occupied vehicles. I'm using the following chunk of script: _hq_east = createCenter east; _group_e1 = createGroup east; _target = _this select 0; _homeplate = getPos _target; _group_e1 createUnit ["Ins_Soldier_1",_homeplate,[],0,"NONE"]; _group_e1 createUnit ["UAZ_INS",_homeplate,[],0,"NONE"]; This is using the array form of createVehicle (here: http://community.bistudio.com/wiki/createUnit_array ) and I also tried using the other format (here: http://community.bistudio.com/wiki/createUnit ) by replacing the last two lines above with: "Ins_Soldier_1" createUnit [_homeplate, _group_e1]; "UAZ_INS" createUnit [_homeplate, _group_e1]; _homeplate is defined and the insurgent spawns without any problem, but the UAZ only appears for a second and then it's gone. I have tried it with several different vehicle types. I want to avoid having to create an empty vehicle and then populating it manually. Am I missing something that's necessary to make this work? Thanks, Marcus
  8. Thanks, I was so focused on setTriggerActivation that I completely overlooked that first parameter in setTriggerStatements.
  9. Thanks, Carl Gustaffa. I tried that method out in the editor and it works great, but (as far as I know) the means I have of manipulating a trigger's activation up when adding it via a script is the setTriggerActivation command. I'm not sure how I'd incorporate the aircraft check when adding the trigger by script. Marcus
  10. Is it possible to set a vertical limit on a trigger's activation area? I'm trying to create a trigger that can be activated by ground units but not by an airplane flying through it at 500ft, for example. I know I could check to see if the unit activating the trigger is in an airplane, but I'm wondering if there's anything that can be done to the trigger itself. Thanks, Marcus
  11. I think the second approach is the way to go in terms of a work-around, since I still want units in ground vehicles to activate the trigger. I am creating the trigger through an SQF script though, and not the editor, so I'm not sure how to add additional conditions that must be met before its activates. As for the code you posted beita, if I'm not mistaken shouldn't that be ...(_x getPos select 2) < 2... in order to identify those under 2m? I also wonder if getPosATL should be used as opposed to getPos. I'm not sure where getPos measures from, but if getPosATL measures height from the terrain level, I can only imagine getPos does it differently. I'm just throwing ideas around though, and want to make sure I have all the details worked out :). I can't do anything until I figure out how to implement multiple conditions on a trigger through scripting though. Does anyone know how that's done? Thanks, Marcus
  12. Is it possible to define a local variable in "setTriggerStatements"? I can define a global variable with _mytrigger setTriggerStatements["this","varname = true", ""]; But I have not been able to figure out a way to set it up with a local variable. Can it be done, and if so, how would I do it? I have a feeling the answer to my first question is no, since the trigger wouldn't know where to define the variable. With a global variable scope is not a problem, but it would be if the variable was to be local to the SQF script I am creating the trigger with. Thanks, Marcus
  13. UPDATE: For practical purpose my problem is solved by using the workaround I mentioned in my last post. This is part of an IED script I had previously made, but it was using two scripts to run so I wanted to simplify the project and combine the two into one. The resulting issue of having ALL IEDs go off when any one is triggered is obviously a problem. Sure, IEDs are unsafe and unpredictable, but I don't want to have that much fun, hehe. (I changed my variable names a bit.) I have the object (the IED) name stored in _targetname and I changed my setTriggerStatements to look like this: _trigname setTriggerStatements["this",format["activeied = '%1'",_targetname], ""] And then my waitUntil looks like this: waitUntil{activeied == _targetname OR (damage _makeied) > 0}; _makeied is the object acting as my IED, on which the script is executed. So, instead of having a local boolean variable that triggers the IED by being true, there's a global variable that triggers an IED when it stores that IED's name. So all my IEDs are waiting for their names to be called, so to speak. Barring any unforeseen multiplayer problems, I should be good to go :D. EDIT: Works without a hitch in multiplayer as well.
  14. That the way I had it set up at first, however, this script is running on multiple objects. So I have objects A, B and C lets say, and I have executed my script on each. A trigger is created on each object and I only want to execute the code after the waitUntil at a single object when its trigger is activated. If I make that variable global, the code is executed on all three objects since they're all waiting for that one variable which has global scope. I can't include my code as part of the setTriggerStatements activation parameter because I want the code to execute not only if the trigger is activated, but also if the object is damaged. So the waitUntil actually looks something like this: waitUntil{_varname OR (damage _theobject) > 0}; I have a couple of other methods to try as well, like assigning my object's name to that global variable and then checking for the name in the waitUntil, or even calling another script which is the way I used to do it before I decided to (ironically) "simplify" this project. I'm still learning the ins and outs of ARMA scripting (PHP is my cup of tea, hehe) so I appreciate the help :).
  15. Thanks for the explanation, it is as I feared then. I'm using the trigger in conjunction with a "waitUntil" in a script run on a number of objects. WHat I was hoping to achieve was to hold up the script for a particular object until this trigger had been activated. With the trigger defining a global variable, the "waitUntil" checks out for all the objects. I tried using waitUntil and the name of the trigger but to no avail, ie waitUntil{_mytrigger}; Thinking it would return true when activated. I'll have to tinker with it some more later. Looking at createTrigger I see that its return value is an object so I might be able to use that to my advantage. Back to the drawing board, hehe. In any case, thanks for the input :).
  16. Thanks, this worked like a charm. Here's the wiki page on the command: http://community.bistudio.com/wiki/BIS_fnc_spawnVehicle
  17. Sorry I don't have links, but I know I got these two off Armaholic. For weapons I use an ArmA 1 script, Universal Weapons Respawn Script v1.04 by "toadlife" and revised by "norrin". It's an A1 script but it works fine for my friends and I in ARMA2. Also, to save rucks/backpacks in ACE2 (the above weapon respawn script won't) you'll need "ruck_reloaded.sqf" (sorry that's all the info I have on it.) I downloaded these a while back and never saved the links. I know you can find both of those on Armaholic, and if I find the links I'll post them here, but at least that should give you something to go off :).
×