Jump to content

GefrManny

Member
  • Content Count

    12
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About GefrManny

  • Rank
    Private First Class
  1. GefrManny

    Progress Bars

    I'm aware of that, but thanks I was just trying to get behind the secrets of the progress bar itself for the Biki, which lacks some information about dialogs.
  2. GefrManny

    Progress Bars

    That's what I feared, when I saw all those "external reference" remarks in the decompiled config.bin files :-( Ah well, I'll just add it to the endless list of the ArmA feature requests tracker then.
  3. Hi everyone, I'm a little bit confused by the progress bar dialog control. Creating and adding one isn't exactly my problem, but I wonder how to actually use it. I was unable to find a function that lets me set/move the progress bar's current progress. Has anyone worked with this control and wants to share experience? -- Manny
  4. GefrManny

    JIP and init.sqf

    You'll always have to be a little bit more cautious with the side command. As pointed out above it seems to be null at the very start, and furthermore it's civilian if the player is currently dead. Just wanted to point that one out in case you're using it in non-init scripts. I'm not quite sure, but player might always be null for dedicated servers. Perhaps you might want to tweak that one a bit. Not that it's a significant performance drain, but suspending unneeded scripts/triggers is always a good idea IMHO ;-) Furthermore, you might want to add your knowledge to the Biki. But iirc it's already noted somewhere in the player article.
  5. Oh no, somebody spot my heavily work in progress article on the Biki! We are doomed! Err.. either way. The article - as it is of now - probably won't be too helpful. Nor am I a dialog guru. I just tried to work with dialogs a couple of times using old OFP tutorials and pretty much ran into problems. Then I disassembled missions and pbos to get some insight - or at least as far as I could. Now I just want to write down what I've found out, so others don't have to follow the same path but rather take the shortcut. Btw, I would appreciate anyone who actually contributes to the article. I'm two things: a.) busy and if I ain't that, then I'm being b.) lazy (at least every now and then). So any insight - especially experienced insight - is welcome. I've already had a brief talk with Col. Sanders (but I think we pretty much hit offtopic turf very fast ) though I am not quite sure if and where I can help. Especially since I have one or two others projects on my own, plus the usual stuff I do at the university, plus my girlfriend, etc. That pretty much reduces my spare time to a minimum that I usually spend on recreation (playing ArmA / Guild Wars) rather then yet again do more work. -- Manny
  6. It is indeed very tricky for SQF, I can confirm that by.. errr... let's call it "experience" (parse errors in "correct" code or vice versa has a negative connotation ). But nasty lookaheads >= 2 are pretty much common at certain decision making points within a parser's productions. Especially in SQF (think of a statement (<semicolon> statement )* [<semicolon>] <eof> production - which is valid in SQF); either that, or I suck. It's probably a compromise of both. It get's worse though: the only way I could actually let the lexer check for function calls and their arguments without hardcoding all 100+ functions themselves or running into leftsided recursions is by keeping all function related data externalized in a (XML, CSV, TXT, ...) file and make pretty ackward looking checks, mostly at points where the parser identifies an IDENT-token (which is by my definition [a-zA-Z_][a-zA-Z0-9_]*) and checks if there should be any arguments left or right of it. I, by the way, do actually try to verify expression types wherever sane and possible as an added fun bonus. However, it really has its limits. Also, I have to agree with you in one particular statement: I must admit parsing is completely over my head in most contexts. You do seem fairly competent to me, so don't degrade yourself I, for one, would welcome a little joint effort.
  7. In theory, LL(n) parsers or Deterministic Finite State Machines for that matter *should* do the job. That is, once you have the time to figure out if the grammar is actually correct and exactly the same as ArmA's. Practically, I fear that there are trade-off decisions to think about concerning the implementation, and several points of big, nasty lookaheads.
  8. (Prologue: If you don't know what BNF is about, then you might want to skip this topic since it probably won't matter to you.) This question is perhaps a little ackward, but I wonder if Bohemia has documented the SQF/SQS syntax in BNF somewhere, or if someone came up with a legitimate notation. Probably it isn't something of interest for scripters but I think it is something important if anyone came up with the idea to write an IDE for ArmA editing. Regards, Manny
  9. GefrManny

    Converting missions to 1.4

    This happend to me too, without conversions. I actually made and ran my mission on a german 1.02 Morphicon release, and it gives me the error message while running createVehicle. This is indeed weird. I'll better go and file a bug report.
  10. GefrManny

    SQF syntax question

    I've located the problem, the root of all evil lies herein: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_allowed = ["StrykerBase", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"]]; _allowed = +["BRDM2", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"]]; _allowed = +["Tank", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"]]; _allowed = +["Air", ["SoldierWPilot", "SoldierGPilot", "SoldierEPilot"]]; I accidently confused the unary +array operator as union, whereas it actually is just "copy that array". Hence my _allowed only contained the last entry. Should be working now with the following script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">comment " ---- SETUP SECTION ---- make modifications here ---- "; comment "ALLOWED CLASSES"; comment "Which vehicle kind requires which class?"; comment "Values: [ vehicle class name, [ allowed unit class 1, allowed unit class 2, etc. ] ]"; comment "Check http://community.bistudio.com/wiki/ArmA:_CfgVehicles for class hierarchy!"; _allowed = [ "StrykerBase", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"], "BRDM2", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"], "Tank", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"], "Air", ["SoldierWPilot", "SoldierGPilot", "SoldierEPilot"] ]; comment "FREE POSITIONS"; comment "No class check for these positions (possible: driver, gunner or cargo):"; _free = ["cargo"]; comment " ---- END OFSETUP SECTION ---- keep out unless you have a reason to meddle with it ---- "; _veh = _this select 0; _pos = _this select 1; _unit = _this select 2; _t_unit = typeOf _unit; _t_veh = typeOf _veh; _entries = count _allowed; _do_eject = 0; if (!(_pos in _free)) then { for [{_vi = 0}, {((_vi < _entries) and (_do_eject == 0))}, {_vi = _vi + 2}] do { _veh_kind = _allowed select _vi; if (_veh isKindOf _veh_kind) then { _unit_kind = _allowed select (_vi + 1); _do_eject = 1; _unit_kinds = count _unit_kind; for [{_ui = 0}, {((_ui < _unit_kinds) and (_do_eject == 1))}, {_ui = _ui + 1}] do { _allowed = _unit isKindOf (_unit_kind select _ui); if (_allowed) then { _do_eject = 2; }; }; }; }; }; if (_do_eject == 1) then { _unit action ["EJECT", _veh]; }; Case solved, thanks to everyone. Sincerely, Manny
  11. GefrManny

    SQF syntax question

    Interesting. Didn't know that SQF-files actually required execVM or spawn. Most of my (simple) scripts seemed to work with exec. execVM tells me no error, but doesn't really seem to work either (_do_eject always is -1 if I add hint format ["Eject: %1, _do_eject] after all the code). exec however leaves me with a simple '|#|};' Error missing { and nothing further being specified. Btw, I my editor features syntax highlighting, the { } count seems to be equal. Edit: Exactly that one.
  12. Hey all. I've recently tried to come up with a more universal SQF script that checks if a player has a specified class and is therefor allowed (or not) to enter a vehicle. However either the parser has difficulties with blocks within blocks, or I messed up the syntax pretty good. Either way, I'm out of ideas. The whole script is called from the vehicle's getin-eventhandler, this addEventHandler ["getin", { _this exec "thescriptbelow.sqf" }]. Replacing exec with execVM only leads to error output supression, but that's about it :-/ The script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">comment " ---- SETUP SECTION ---- make modifications here ---- "; comment "ALLOWED CLASSES"; comment "Which vehicle kind requires which class?"; comment "Values: [ vehicle class name, [ allowed unit class 1, allowed unit class 2, etc. ] ]"; comment "Check http://community.bistudio.com/wiki/ArmA:_CfgVehicles for class hierarchy!"; _allowed = ["StrykerBase", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"]]; _allowed = +["BRDM2", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"]]; _allowed = +["Tank", ["SoldierECrew", "SoldierWCrew", "SoldierGCrew"]]; _allowed = +["Air", ["SoldierWPilot", "SoldierGPilot", "SoldierEPilot"]]; comment "FREE POSITIONS"; comment "No class check for these positions (possible: driver, gunner or cargo):"; _free = ["cargo", "gunner"]; comment " ---- END OFSETUP SECTION ---- keep out unless you have a reason to meddle with it ---- "; _veh = _this select 0; _pos = _this select 1; _unit = _this select 2; _t_unit = typeOf _unit; _t_veh = typeOf _veh; hint format ["%1 is a %2 and gets in %3 position of %4", name _unit, _t_unit, _pos, _t_veh]; _do_eject = -1; if (!(_pos in _free)) then { for [{_vi = 0}, {((_vi < (count _allowed)) and (_do_eject == -1))}, {_vi = (_vi + 2)}] do { _veh_kind = _allowed select _vi; if (_veh isKindOf _veh_kind) then { hint format ["%1 is a kind of %2", typeOf _veh, _veh_kind]; _unit_kind = _allowed select (_vi + 1); _do_eject = 1; for [{_ui = 0}, {((_ui < (count _unit_kind)) and (_do_eject == 1))}, {_ui = (_ui + 1)}] do { _allowed = (_unit isKindOf (_unit_kind select _ui)); if (_allowed) then { _do_eject = 0; }; }; }; }; }; if (_do_eject == 1) then { _unit action ["EJECT", _veh]; }; Thanks in advance, Manny
×