Jump to content

ZNorQ

Member
  • Content Count

    262
  • Joined

  • Last visited

  • Medals

Everything posted by ZNorQ

  1. Hi, In the wikipages the createDiarySubject says the script command may take a picture parameter; person createDiarySubject [subject,display name,picture]; However, I can't seem to make this work. I know the path is right; The following script command do work, and I use the same path reference in the above script cmd; player createDiaryRecord ["Diary", ["Intel", "Informations gathered.<br /><img image=components\res\gfx\_delete_\flag_indep_ca.paa' /&gt]]; ZNorQ
  2. To remove a PV EH for a specific variable, can I just use the following statement; "theVariable" addPublicVariableEventHandler {}; ZNorQ
  3. I'm a frequent user of lbSetValue, lbSetData, lbSetColor, etc., but I can't seem to find a function for manipulating text element (ie. lbSetText, which doesn't work). Anyone know if there is one, or do I have to use lbDelete and then lbAdd it with the new text..? ZNorQ
  4. Followed your tips, guys, just what I needed - thanks. However, I hope BIS gives us a couple of script-commands that makes this easier in the future. ZNorQ
  5. I want to add specific items to specific containers (vest, uniform & backpack), but it seems to me that you can only add items and it is put in which ever container that has free space. Is this correct, or am I missing something? Kenneth aka ZNorQ. Ups, see "items" in title spelled wrong.. Oo
  6. I wasn't aware of this feature! Thanks, Riouken. ZNorQ
  7. I'm creating a mission framework/template (called "NAMF") where I have a set of (public) variables "attached" to an object ("nsf_oJIP"). These variables will always be syncronized to all platforms (ie. clients and server). In this template, I've also created a function ("nsf_fJIPn") that will return a boolean result; the purpose is to check if a public variable (in the "NSF_oJIP" "namespace") is declared or not. I want this function to handle all sorts of inputs, but it is primarily expecting a nsf_oJIP attached variable. My current code is as follows; nsf_fJIPn = { if ( ( !isNil "_this" ) and ( typeName _this == "STRING" ) ) then { isNil { nsf_oJIPns getVariable _this; };} else { true;}; }; I see 4 scenarios which I want the function to handle; The parameter... a) ...is already declared, but wrong format (not a string). b) ...supplied, but isn't declared at all (isNull true). c) ...is missing (no parameter input) d) ...the parameter is correct (string) I'm not having problems with a), c) and d), but b) is a major pain you-know-where. Do anyone know if it is possible to check for this scenario? I have a follow-up question to c); It seems to me that if you use "call" without any parameters, _this becomes -1; can anyone confirm this? If this is true, if ( !isNil "_this" ) could never be false, and one can not really determine if the call function was supplied with a parameter or not. I'd rather _this = nil (undeclared), hence it would be easy to determine if a parameter was supplied or not. Example; hint format["%1", call {_this;}]; .. returns -1 Regards, Kenneth aka. ZNorQ
  8. Now I'm really confused...! Oo I played around with your example, and now I'm received "undefined variable in expression" errors...! Also, isNil "_this" returns true if no parameters are supplied... I think I need a break...! I gotta really investigate why the hell I received "Any" in my previous tests... I know now that there are some problems using call in the A3 debug window... Seems DISPLAY is passed as a parameter if I use a call without parameters... Thanks man, I'll need a few to investigate my code more thoroughly. ZNorQ
  9. Of course I should always pass the right parameters, but I'm human - I do make mistakes. So, when I do, the function should handle this. However, passing undeclared variables screws everything up, and a function that was meant to return boolean (true or false) all of a sudden returns "any", and makes it harder for me to track bugs. The whole point isn't really about this particular function, but how to handle undeclared variables as parameters for function calls in general. It's really a pity (well, have kind of mixed feelings about it) that one don't have to declare variables in advance (like in C/C++, etc. etc), so that one cannot make mistakes. Using undeclared variables in C/C++ reports an error, sqf don't. (I say mixed feelings, because I kinda like the isNil functionality). So, just forget about this particular function (and the purpose of it); concentrate on item b) - passing undeclared variables as parameters to call functions. ;) Kenneth aka ZNorQ PS! I must admit I'm having a bit problems understanding you. Probably me since I'm from Norway... Oo :P Thanks for the feedback anyhow!
  10. Thats the whole point; any isNil-parameters is wrong/an error and shouldn't happen. So, passing an undefined variable as a parameter is also a scenario that may happen and should be taken care of. However, I don't know how to implement code for handling that. If I'm misunderstanding you, LoonyWarrior, I'm sorry.. Oo Examples; [b][color=#800080]// a) parameter is already declared, but wrong format (not a string);[/color][/b] myparam = ["test"]; myparam call nsf_fJIPn; [color=#006400]// returns true, array not allowed.[/color] [b][color=#800080]// b) parameter supplied, but was never declared/assigned a value.[/color][/b] [color=#ff0000]// ~ Don't know how to implement this scenario. ~[/color] [b][color=#800080]// c) parameter is missing (no parameter input)[/color][/b] call nsf_fJIPn; [color=#006400]// returns true (In essence, _this becomes -1, (SCALAR), which again isn't an allowed format.)[/color] [b][color=#800080]// d) parameter is correct (string)[/color][/b] myparam = "sometext"; myparam call nsf_fJIPn; [color=#006400]// returns false (Param is as expected, everything ok.)[/color] Thanks for your feedback, LoonyWarrior. Regards, ZNorQ
  11. No, that wasn't the purpose at all, it is rather the opposite; as I stated above I want to catch incidents where an undeclared variable passed to the call function. When I do that, the function returns "any", rather than true. Btw, the function is a "skeleton" version; it works on a), c) and d), but b) doesn't work. Also, it seems that c) is always converted to a "-1" value, hence isNil "_this" will never be false (as far as I can see.) Last but not least: I'm really not asking about this just for this specific function; just curious about the general functionality of passing parameters/arguments to a "call" function. ZNorQ ---------- Post added at 14:50 ---------- Previous post was at 14:49 ---------- Thanks, will check it out. :) However, I'm not sure if that will answer my question which was how to detect passing undeclared parameters to a call function. ;) ZNorQ
  12. Yepp, this is how I understood it too. ;) Sounds good! I doubt I would end up with this problem in my current project anyway, but - again - it's a good thing to be educated. :) Thanks a lot for the good wishes and feedback, Muzzleflash!
  13. I'm understanding it as you referring to my question with regards to collissions, Deadfast; No, I'm not talking about data types. I'm talking about events like Muzzleflash mentioned with regards to CBA's CBA_fnc_globalEvent. Now, I'm not familiar with CBA_fnc_globalEvent, but I can only guess it can be used to trigger custom events (by utilizing addPublicVariableEventHandler?) on all/certain clients/server. If CBA_fnc_globalEvent uses addPVEH - and only one variable for all such events - what is the probability that there will be a collision which will result in an event not being triggered as expected..? I know where talking pretty many events being broadcasted at once, combined with many clients, I guess.. Networking isn't exactly my area of expertise.. (nor is coding, for that matter...) Sorry guys, as I said I'm not exactly the guru when it comes to coding and coding terminologies, so trying to explain what the hell I'm talking about isn't easy... Oo Hope you can grasp WTF I'm trying to say here... :P ZNorQ
  14. I'm already using Xeno's Domination network event concept which is basically built around one variable (used by publicVariable/addPublicVariableEventHandler) for handling all custom network events. This is a really good way of creating events between clients/server, and could for all I know be the same concept built in to CBA..? But that was not really the point of this topic; it was more for me to know the more detailed inner working of addPublicVariableEventHandler. Unfortunately it seems that once a aPVEH is set up, it cannot be removed. Appreciate your feedback, guys, thanks. ZNorQ ---------- Post added at 07:10 ---------- Previous post was at 06:53 ---------- One question I have to the CBA solution (And Xeno's for those of you familiar with his implementation in Domination); Is ArmA2(&OA) able to handle ALL events broadcasted, or may there be some collision?
  15. Yes, I know about these two functions, they are a welcome addition to the already huge pool of functions in ArmA2. However, they came a bit late as I've already implemented my back-ward code; too much hassle to re-write at this time, and I'm not even sure they will give me a solution to my current challenges... I will of course utilize these as much as I can.
  16. 1) One of the reasons to my post was to learn how the addPVEH worked, and how to throw out (remove) old no-longer-needed addPVEHs. However, I see the conclusion of my first question (which also cancels my second question) is "can't be done". One just have to find workable way around, like the one Deadfast suggested. It would be nice to see a removePVEH, though. 2) Not quite, because certain clients still needs to receive the information, but only up to a point where it's no longer needed. Hence, stop using publicVariable isn't a solution to the "challenge". First off, I'm doing as much coding myself to learn (best way is to do it yourself) with great help from this community. Second, I wouldn't dare poke in other people products after reading quite a few "wars" on this forum; I just don't need the aggravation. Last, I'm on a bit of a time schedule, and trying to go through unfamiliar complex code and trying to understand it is a bit more time consuming than what I'd care for right now. Thanks for the feedback though, Muzzleflash, much appreciated.
  17. This was what I was afraid of. But your example doesn't stop the CPU spending time on useless events just by setting TAG_pubVarHandler to {}. But your solution is a good way to make the pvEH more flexible I guess. And yes, before any of you go on claiming that a few EH's doesn't hug much CPU resources, I'm not too worried about that in a small framework, but when you add on multiple functionality, eventually every CPU tick counts.. I'm not quite there though myself, but I do want to make the code as CPU resource effective as possible.. ;) Thanks for the feedback, Deadfast.
  18. Oh, not at all, I will be using them frequently (for same variables), but sometimes there are certain conditions that occur where I want to remove the addPublicVariableEventHandler for a/several specific variable(s). I just don't want to end up event handlers that triggers empty code just because I can't remove them from the event lists. CPU is a precious commodity; never enough! ;)
  19. Might seem a bit stupid what I'm asking for, so I'll add some extra info; Is the event completely removed from the event checks, or will it still lurk in the background and triggering no code ({}) whenever "theVariable" have been publicVariable'd? I do not want to use CPU on event handlers that are no longer needed. ZNorQ ---------- Post added at 12:33 ---------- Previous post was at 12:30 ---------- Oh, another thing; Can the addPublicVariableEventHandler also delete itself? "theVariable" addPublicVariableEventHandler { "theVariable" addPublicVariableEventHandler {}; }; This also might seems a bit stupid, but it would of course contain a lot more complex code, for example it could do some operations up to a point, and when certain criteria was met, it would remove it self. ZNorQ
  20. Works like a charm, many thanks. ZNorQ
  21. How can I list items, weapons and magazines in a unit's backpack? Initially I though one would use magazines, items, and weapons, but those return empty array no matter what... ZNorQ
  22. Well, unless I'm totally mistaking, you can apply a logo to each subject, just see "Units", "Players", etc.
  23. When starting up ArmA2 OA, the following 2 lines are logged in the rpt file; Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 0)! MoveName: amovpercmstpsnonwnondnon_amovpercmstpsraswpstdnon Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 1)! MoveName: amovpercmrunsnonwbindf_rfl Is this something I should be concerned about? ZNorQ ArmA2:OA, 1.62.96061
×