Jump to content

m0nkey

Member
  • Content Count

    262
  • Joined

  • Last visited

  • Medals

Everything posted by m0nkey

  1. Maybe an easy answer here maybe not. The goal is to have 4 playable units (4 person coop mission, just an example). But, I want to randomly choose whether the players are east or west. The issue I am running into is that when 4 people join, you must have playable units declared else there are no "slots" in the lobby. I could have 4 east and 4 west in the lobby, but the goal is random-ness. So, my thought was to create 4 west, let players choose thier slot, then once init.sqf starts, choose which side they will actually play as, then possibly have to change players control to east units. It does not seem straight forward though. selectPlayer seems to be the way to do it, but that would be a client side only script? Suppose I had 8 units (blue1, blue2... red3, red4). It would seem as easy as scripting player1 to switch from blue1 to red1 if a player actually controlled blue1. Even better would be the ability to randomly pick the side prior to the lobby starting, so the lobby only shows one faction, and the player simply chooses a slot. Anybody have a solution?
  2. m0nkey

    BL1Ps BenchMark fun.

    lol, Grumpy tipped me off to this. It works a treat really. I was pretty careful in how many units were spawned at once anyway, and could always see a tiny stutter when they did spawn. With this, its really hard to tell when they spawn. I can only imagine it works better with a higher server count/load. Just out of curiosity, what are the settings anyone else has used? 15 fps with 5 seconds is what I started with.
  3. @Grumpy Old Man setVariable is what you use rather than arrays? For handles/references? I must not understand the logic. If I create say 10 units in a group, thats 11 objects. If I give them 3 vehicles, thats 14. If I give that group 1 waypoint that makes 15. If I want to keep track of these handles (thats supposing I needed to reference each unit which isn't like, but this is an example ;) ) other languages would allow me to assign the value of an array as the handle to the object. You are using setVariable when you want a reference? I am all about learning "best methods", but how are you using setVariable in a way is more "proficient" than arrays? Or do you use setVar in combination with arrays somehow (ie. arr set [count arr,_doo setVaraible ["Doo",123,True]])? I mean, I can loop through an array with handles and the code is, umm, more concise than having to remember just variable names. (unless you only use them when you want to be specifically referencing variable names). I've taken the bait Grumpy, lol, any further explanations?? - I've taken the Fred41 spawn delay code and Ruebe's logic and merged them into my hive - they are one.. thanks for those little tidbits btw.
  4. Revisiting this question. This time though I am wondering, is there any benefit to cleaning up large local variables, ie. large _localArrays. Yep, its my anal over achieving tendencies ;) But really, to make the most optimized code, one "should" free up resources no longer needed unless its done automatically. So, do I _localArray = nil or does this happen when a script terminates? I've not found an official answer yet anyway.
  5. As Beerkan shows, Larrows suggestion will work. Nobody has to run it on thier machine, because it works. Its up to you to code the loadout script in a way that works with the forEach statement. I might suggest telling what error you get, or providing some/all of the content of the loadout script or even just what you used to do the call/execVM.
  6. It would help if you show what the returned dataset looks like. Are there duplicates, truncation, splits? My bet is that it has to do with the getArray and the data being in config, the return is not really an array so much as coming from an array. Just a thought anyway. I love arrays, but arma makes it difficult to use the compared to many languages.
  7. So I've been beating my head against the proverbial wall trying to understand how to utilize "guard" features... lol. Guard waypoints can be made via the editor or via script. The group goes to the guard waypoint, and waits to spot enemy or be informed of a spotted enemy. The group then essentially "seeks to destroy" the enemy. When enemy no longer known or is destroyed, the group goes back to its guard waypoint. Thats the approximation of it anyway. If there is a guard trigger, then the closest group with a guard waypoint will move to the trigger and guard it. The group might move away if needed, but will return. If the group guarding is killed, the next nearest group with a guard waypoint will move in to guard the trigger. However, a guard trigger can only be made in the editor. Or can it? In quite a few hours of searching, I found posts and code that says it can and it cannot. I found tickets that said it can and it cannot. I've tried it on A2 and A3 and I cannot get a scripted trigger to be a guarded trigger. I've tried every combination I can think of, in terms of setTriggerXYZ commands. Switched the order, hard coded positions, etc etc. Nothing seems to work. If you create the trigger in the editor, it works just fine. I found you cannot move a guard trigger. It is where it was created, always. Now to make the matter more complicated, you also have GuardPoints (via the createGuardedPoint command) that essentially makes a guard point (aka guard trigger), but returns nothing. Meaning, you cannot reference it, cannot move it, cannot delete it. All of this means, I don't see how you are supposed to use these stupid things. Well, unless you want to make a mission with the edtior. But I want to make it dynamic so I don't know whats going to happen. Does anyone have any information as to what is the deal with these guarded type controls? Any code that works? Any helpful tidbits of information that will clue me in? Right now I am thinking they are useless without the editor. Thanks.
  8. Thanks for the input. From what I have been able to gather and see in testing, any waypoint you give, whether in editor or in script, has to complete before its "function" is performed. As an example, if you create a waypoint to "guard" or "sentry" and move that waypoint when the group gets near it, the group will never actually guard. If you were to have 2 groups some distance apart, each with a guard waypoint they are following but never reaching, and you then have an enemy group that is spotted or under attack (100% knowsAbout) these guard waypoint groups should come in to attack. They will not however as they are not to thier position to guard yet. I think they are just moving at that point. And protocol for move waypoints that I have observed is to attack if they knowAbout, not if anyone on the same team knowsAbout. Which means, I think, that the one great use for a guard or guard/sentry combo is pretty much only good in hard-coded linear missions. Without the ability to manage your guard points, not much use in dynamic missions. I was trying to give a group a guard or sentry waypoint that moved, like a patrol. My hope was that the patrol would do its thing, patrol an area, but because the waypoint they were following was a guard waypoint they would also break away when any team member spotted an enemy. This would make it easy to use as you would not need extra scripting to change the behaviour, just use the guard system by design. After the threat was over, the group would go back to its guard position, or in this case following it as it moved when they get near. I am out of ideas. I will use guard triggers and guard/sentry waypoints in anything I do that is made with the editor, but playability for me is limited because I know whats going to happen. Thats why I make dynamic stuff, so I only have a vague idea what might happen lol.
  9. If you are looking for info on guard triggers via scripting, I have found only one resource which has anything to do with whether they work or do not work when created via script https://dev.withsix.com/issues/2907 Unless I read wrong, it sounds like they are supposed to work. I've tried every combination I can think of, based it off that sample as well as making my own scripts. My conclusion is that if you create a trigger with scripting, it will always be "empty detector" and cannot be a guarded trigger because of that. I looked and did not see another "vehicle" that could be used in the configs. I was looking for sensor or anything with detector as the simulation. I have concluded that you cannot create a guard trigger via scripting like you would other trigger types. You can however use the command createGuardedPoint to create essentially the same thing. Since a guard trigger created via the editor returns nothing, you cannot modify it at all. GuardedPoints are the same, they return nothing. So, if you want to develop a mission, and at some point have a script create a guarded point (or multiple) you would use createGuardedPoint. Any groups with a guard waypoint will dutifully move into these guardedpoints and guard them. If one group dies, other units move in to take its place. The first created guardedpoint has top priority, so groups will leave other guardedpoints to protect the first one. What you cannot do sadly is manage your gaurded points. You cannot create them for an area of your mission, then move them to the next area nor delete them and use new ones in the next area. Its all or none. I don't know how to request a feature, but that would be one I would request for certain. If anyone ever figures out how to move or delete a guard trigger or guardedpoint, I would certainly be grateful to know how...
  10. I've looked for the answer here and with search engines. I'm not even sure what you call it really. nearestObject or any similar command might return a value such as 305cc800# 39619: i_barracks_v2_f.p3d Since this value is usually in a variable or an array, you can reference it as an object (ie. getPos variableName). Its a usable thing which is nice. You can also reference it by the # (ie 39619) which can also be useful. But I've recently tried to get the "display name" from the config file for specific types of nearObjects (ie like military structures). So, this value is returned, but is not usable in _text = getText (configFile >> "CfgVehicles" >> str(myVar) >> "displayName"); If you don't str() the variable, you get an error of expecting string but providing object (obvious fix). If you str() it, you get nothing returned. I would assume the getText function really wants the config name (ie Land_I_Barracks_v2_f). Display name is present for that. Is there a way to use the returned value from nearObject with getText or getArray, or configFile>> stuff in general? String manipulation is, well, there really isn't any in this script language otherwise I might just have manipulated the strings myself and been done with it. Thanks for any help. EDIT: Posted too soon I guess. The answer is to use typeOf _text = getText (configFile >> "CfgVehicles" >> (typeOf (_array select 0)) >> "displayName"); So if you are using nearObject or nearestObjects and you wish to have a usable text name to display to the users for some reason, this will get that normal display name into a variable (or whatever you want). Answer actually was obvious if I had been thinking properly. Sorry for the post, maybe it will help someone else out in the future.
  11. Oh. Might have been prior to zeus that I messed with it then. Unless they have really fixed it though, when using a timer on the fog array, it never produced reliable results for me in mp, jip or not. And very random as to which player would have no fog too, or too much fog. I settled for sending mp message with a loop script on the server, and only sent small setfog times. In that way each player would eventually get the message in a fairly short time, yet they would also see a slow change in the fog density. works pretty well actually.
  12. I messed with it a month ago I guess and did not find it to work reliably on coop or dedi server for jip. Don't know if it supposed to be fixed or not but this is what I use that works pretty well. You do have to have the server periodically send the mp message though but that was easy to do. HTH // setFog for all clients // init.sqf -> m_fnc_setFog = compile preprocessFile "m_fnc_setFog.sqf"; // where called -> _handle = [[vals], "m_fnc_setFog.sqf", true, false] spawn BIS_fnc_MP; // pass in: time | fog value 0-1.0 | fog elev decay 0-1.0 | max elev in meters private ["_time","_density","_decay","_elev"]; _time = _this select 0; _density = _this select 1; _decay = _this select 2; _elev = _this select 3; _time setFog [_density,_decay,_elev];
  13. Not sure exactly how to word this, have seen others mention it but cannot find where it is. Basically, in other script languages, one might create something like a button $button = createbutton(params) If you were working on a form or something similiar, with many buttons or objects, you would essentially store the "handle" to the objects in an array index element, like this (no specific language used, just laymans terms lol ) array[1][2] = createbutton(params) array[2][2] = createtext(params) However, how does one do this in the sqf script language? If we look at createMarker, it states variable = createMarker ["string name",position]; so, if we used set with an array, how would we accomplish things? Or do you just set it with a variable already created? like.. _obj = createMarker ["name1",_posX]; array set [count array,_obj]; I ask because in other languages, the handle to the object can be referenced, which it can in arma as well, but getting it in there without creating the object first (ie. _obj = ) is something I have not been able to figure out how to do. Is it possible? Any good tips on working with arrays holding handles/references to objects that one wishes to delete/destroy later? Always open to learning something new lol.
  14. Thats sort of how I figured it would be. I was double checking because it seems so counter productive to me, needing two steps to do something like that. The question with your example I have is, if you do the call compile on that code that lies within the array index, the array index will not equal the handle or reference to the created vehicle. The variable "what" would do that. Correct? So what I am looking to do is actually have the value of the array index be the handle to an object. Which I can do in a two step process. And it seems thats the only way to do such a thing. Thanks yet again F2k for your time :) EDIT: which actually leaves me with another question. (sorry) Suppose i do this for "_i" from 0 to 5 do { _obj = createVehicle [....]; array set [count array, _obj]; }; will the value of _obj be put into the array? Or is it a copy of _obj? Or is it a reference? If I re-use _obj in a loop like that, are the array values changed? lol, cannot test this until tomorrow night but it just occurred to me that what I would normally do with an array is actually create the vehicle with the array index = equaling the returned handle. I know arrays in sqf are references unless you use a copy, but have not seen what happens with handles put into arrays....
  15. thats really neat for sure. Had not thought to actually compile the code into the array and then call the array. very neat. But what I mean is if you can say, in very laymans terms array index set = createVehicle [params] or if you MUST use a multiple step process, ie _obj = createVehicle []; array set [count array, _obj]; Its not a super critical thing, its just that (in the case of createMarker as an example) your handle = marker when you create it, so I wonder how you do that in one step with an array, as there is no "=" method I know of to use with it, it only uses set. Since createMarker wants an = sign, I would think this at first (as it applies to an array that is not using select statements like a query, which is how arma does it, so strange) (array select x) = createMarker ["name",posX] Its just one of those strange array things I am trying to adapt to when it comes to arma's arrays. Always trying to be aware of well structured code and optimized code, so just trying to see if there is a one step method. Thanks for taking the time to respond! edit: oh, the whole idea is to create lets say 3 markers and 3 vehicles or waypoints or 3 groups or whatever. An array holds thier "handles" so that when it comes time to clean up the task/mission/objective/whatever, all you need to do is step through the array and delete the index (bearing in mind the different commands used for vehicles vs markers vs waypoints etc). I use arrays to hold handles to objects all the time in other applicaitons than a game script..
  16. Well, the logic was being used in the hopes that it was a server logic only. At first anyway. It seemed that a logic created on the server side would be "controlled" by the server. Then when I started to understand how and why client side scripts are used, and further began to experiment with MP functions and variables, it began to occur to me that I don't understand things like the topic posted. Its a strange thing to be sure. A server creates it and owns it, and there is only one, yet any script that runs on a client can change its pos, but is there more than one instance or not? But honestly I've been so busy as of late I have not gotten around to that JIP respawn script yet. As usual I set my goals way too lofty and a simple "spawn wave" type mission has turned into a dynamic mission type thingee that is taking way too much time - but does take one into unfamiliar ground where a lot is learned. Ha! or maybe I just need to stop working 7 days a week... I will revisit this when I rewrite that respawn script (again) to do things radically different (yet again). lol.
  17. As for the thread title, was just trying to think of a standardized title so I can find these again or reference them. Get tired of losing a post in the mix on forums. Question is maybe simple. This is all just learning, not actually making anything special. Here is the original source that I have been modifying to see how it works etc http://forums.bistudio.com/showthread.php?143334-Insurgency-style-respawn/page4 I am trying to understand locality and mp related issues when dealing with dedicated servers. Or just mp good habits in general. In this example, I have added another piece of code that moves a second game logic to a vehicle location. Nothing fancy, just logic_name setPos getPosATL object_name; The script has no check for isServer/isDedicated, so one assumes it runs on client? But I read logics are owned (local only to) the server? So what happens when a client runs this JIPSpawn.sqf script? Is the logic moving on the server, just not being synced (or is that broadcast) to other clients? So when each client runs the script, each client moves the server-owned logic to a new location (even if its in the same location?). Or is there something else going one? If the client is not specifically stating to update everyone of the change (which is clearly not in the code?) then if the server actually owns the logic, how does everything stay synced? Or, is the logic actually local to each client, so each client has its own logic (so to speak) and it does not matter. How might this be impacted when, for instance, more than one client, at the same time, moves the logic? If the logic is server owned, and a client is driving the vehicle, and at the same time another client tries to move the logic to the vehicle, how can the client not driving get information about the vehicle that is owned by the 1st client because he is driving it? I apologize, I over-analyze things and after a lot of mp scripting reading I got to wondering what was happening.
  18. m0nkey

    corpse limit

    I did not realize it was for players only. lol, that explains a lot.
  19. m0nkey

    corpse limit

    I've tried many permutations of these parameters with no success. Just a blufor player and an opfor rifle squad on the airstrip on stratis. Set the corpse count to 1 or 2 or 3 (or whatever), mess with the timings from 10s to 30s to 120s (etc etc). Nothing dead ever goes away, even after 10 minutes of sitting. I gave up and do a periodic deleteVehicle using allDead and more specific cleanup using deleteVehicle with foreach units group when applicable. It would be nice if the corpse parameters worked, because oldest coprses would be deleted first, leaving those just killed present to search for ammo etc. Becomes problematic though when you design a mission with a dead body as you need more structured code to not delete what you want to stay lol.
  20. I've modified a BIS function. Not a lot, just added a couple parameters that seemed logical to have. How does one go about showing a dev something like this. Maybe they would want to use it or come up with thier own spin on it?
  21. You have 3 ways to play. Single player, multiplayer as a "host" also called a "listen server" and a dedicated machine that "hosts" the game, aka the "server or dedicated server". In this game, or this mod anyway, you have to "host" it as a player, meaning a listen server. Tell her to start A3, go into multiplayer, choose "new" at the bottom (start new server). Then set name, host as internet (although lan works over internet, go figure). She can change the port to something custom if desired, and the player count. Password if desired. Then click OK at bottom right. Your "listen server" is now up and ready. Just pick the DUWS mission and her friend joins. She is both a player and the server, so she has to pick the options at startup for the game. Now, you might (she might) have to open a port on the router for other people to get access. On mine (actually a linux computer, but same difference) I opened ports 2302-2305 UDP. If she chooses custom ports, like maybe she used 4567, you would open the router up for something like 4567-4571, maybe 5 ports after the first. Most people call this "port forwarding" if you need to look it up. Its a little different in every router, but the principle is the same. Her friend will also either need to search for her sessions "name" or if she gives him/her the WAN IP she has currently, the friend can do a "remote join". When doing a remote join, have the friend enter her ip address and the port she chose (ie. 123.123.123.123:2302). Not that hard for a listen server really.
  22. In the chopper taxi script (which is a separate script I think) once you got in the chopper I think it opened the map screen. In the one in DUWS it does not open, but you do see the text to pick an lz. Press M for map, center you red recticle over the place you want for the lz and left click I think. or space bar. cannot remember off-hand, but its one or the other. If the script cannot find a place to land there, you will see text that says to pick another spot for the lz, and you repeat.
  23. Hmm. I thought the old armory came up for everyone when anyone purchased it? Might be wroing on that, but thats what my memory told me. But then he's not as reliable as he used to be ;) Maybe it was when the group size was increased but I never noticed it. That may cause issue in MP, but it has been a great asset being able to see your human squadmates if you are doing coop. No, not to have multiple spawns. Only pointing out that if you don't want to use revive, and you are going to respawn at base and simply use a teleport or other method to get back to your squad fast, why not just incorporate a join on squad member (or any team unit for that matter) ? It would just be easier to achieve the same end result. You could easily do things like make it 1cp to spawn at base, 2cp to mobile and 3cp to squadmate/unit. I'm not really into the persistance and cost stuff myself, just the dynamic missions it can create, but you sure could do that stuff easy enough. I was also pointing out that with a bit different spawn system, you would not have to remember to buy fast travel/halo. Not that those features should be taken out, on the contrary, those I use more for getting somewhere that I should not be able to go to, and thats why they should cost I suppose. Maybe look at it like this. You get in the game, you are by yourself, so no revive. A spawn system then works that lets you freely spawn at base. It might cost 1cp to spawn at the mobile spawn, if you used it and placed it near where you last were. If you really want to get back to the objective and your squad fast, you could pay 3cp to spawn to a living squadmate. If you really wanted to go somewhere that was outside of the base, the mobile spawn, or your squad, you are deviating from the "mission" you were on, and maybe a fast travel/teleport/halo cost much more, because its "extra-curricular" to what you were doing. If you forget to buy a teleport or whatever, maybe you don't have the funds yet, a base/cheap method is in place. I'm not saying to do this, I'm just sharing what I did and maybe offering a viewpoint for you to develop, or something :) And I already am coding some of this in. When I am done, I will show it to you and you can see what you think. If you want me to modify it to fit the way you or kilbot had, I don't care. Thats the beauty of arma, I can learn to adjust anyones missions to suit my tastes if I want. Not a total rework, whats the point in that, but I like the way my respawn on squadmates works better lol. I was only thinking of the mission parameters at startup, like zone sizing, etc. Thats the only thing that many might want to tweak themselves like I did, just to fit certain situations that the default options don't address. And it need only be a list of the files you modify yourself to tweak those areas. Users should be able to do everything else themselves. But looking through each file for a global, might take some time. Actually though I just looked through every file in the project for a global with windows GREP, it took about 10 seconds to return 4 files that used the variable. Well, I will let you know when I find out. Almost dug into that last night but figured might be easier to ask first lol. Thanks for the lengthy reply. Much appreciated!
  24. Hello BigShot. Thanks for continuing the development while the author is playing real life ;) Couple things I might mention, after playing the original since game release (forget what version that was). Anyway, now that each player must buy a fast travel or whatever, why not make it so the squad leader must buy it for the group? It would make more sense that way. What I did, rather than dig through that much code, was to use a JIPrespawn script I modified, and added a game logic as a respawn point, a named vehicle as a respawn point, and the script itself, which lets me choose to either spawn on a group member (if any are alive) or spawn the the game logic (at the HQ) or spawn to the mobile spawn (wherever we last parked it). In this manner, I can choose to spawn at the base, or spawn with my group. If you were to change the halo/fasttravel/armory stuff to be on any member of the squad leader who called it, you could raise the cost and really achieve the same effect, but without each person needing to get their own menu item, which is what happens anyway really. Another thing that would be nice is a text file that gives the location of dependency files for those who want to modify parameters. A good example is I wanted to created missions no further than 1km from HQ, so that it both works on smaller maps and just to make a faster game so you could walk/run into the zones (not to mentiion creates some interesting engagements inbetween zones). So rather than track down all the variable locations spread across so many files (which I would use windows GREP if I were to do it that way), I just modified 2 files. So, knowing how to customize parameters could be eased by knowing what files would need to be examined. It need not be all inclusive, just something like "for all mission setup parameters, look in these 5 files for the associated variable name". My final question, if you know the answer, is why would the zones fail to be created on a large map? I was using altis and stratis obviously with no issues, but I tried it with Koplic custom, which is large enough and flat enough, but 9 times out of 10 the zones cannot be created. And thats even with them only being 2.5km from the hq with the hq placed in the middle of the map. What do I need to look for to fix this? Don't mind going into code either, as I really like Koplic lately and want to play this without setting the zones myself. Good job thus far.
  25. Learning all about BIS_fnc_spawnGroup lol. Figured most of the parameters. The one that I cannot seem to get correct is the "relative position array". I've tried [[5,0,0],[-5,0,0],[0,5,0],[0,-5,0]] and [[0,0],[5,0],[0,5],[-5,0]] and also [[1234,4321],[2345,5432]] but it always spawns them at [0,0,0]. (omitting the array or using [] spawns them at the marker correctly) I've googled it plenty and it seems most everyone says to use a "modeltoworld" type relative positioning as I've shown. The function itself says //If given, use relative position. private ["_itemPos"]; if ((count _positions) > 0) then { private ["_relPos"]; _relPos = _positions select _i; _itemPos = [(_pos select 0) + (_relPos select 0), (_pos select 1) + (_relPos select 1)]; } else { _itemPos = _pos; }; Which would indicate its a position relative to the input position (in my case a getMarkerPos "marker"). It would seem then like the relative position would be an offset array? Here is my calling line _armor1 = [getMarkerPos "MRKR_ARMOR1",EAST,(configfile>>"CfgGroups">>"East">>"OPF_F">>"Armored">>"OIA_TankPlatoon"),[[5,5,0]],[],[0.6,0.9]] call BIS_fnc_spawnGroup; as you can see I am trying to offset 5m x and 5m y and 0m z. There are no errors noted. If you do a getPos on the leader of the spawned group, it always says [0,0,0]... Anybody know how this works exactly? The goal was to spawn a group of armor at a marker, but they are placed "willy nilly". Short of creating them in the editor which I don't wish to do, I could spawn each one individually and add them to a group. I was looking for a less code-intensive way to do this and thought the position array in BIS_fnc_spawnGroup might do this. Apparently not ;) Any ideas?
×