Page 2 of 5 FirstFirst 12345 LastLast
Results 11 to 20 of 48

  Click here to go to the first Developer post in this thread.  

Thread: Arma 2 Forward Compatibility

  1. #11
    Thanks for the heads-up, however, I'm not sure exactly what the definition of "initialized" is here.


    Will there be new scripting commands to declare/initialize a variable?


    Or do you just have to store a value in a variable first, as in _variable = 1?



    I would assume the latter, but I just want to be 100% sure I understand.
    HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP

  2. #12
    Private declares a variable, although there is no matching declaration for public variables.

    Edit:
    Although this is perfectly valid in arma:
    MyGlobalVariable = nil;

    I would also like clarification on what BIS is considering initalised however.
    Last edited by W0lle; Apr 13 2009 at 04:56.
    Everything I have released for ARMA can be found here.

  3. #13
    I would think that you would have to give the variable a value before it can be used in any operation.
    --Ben

  4. #14
    I think this should be made into a sticky.

  5. #15
    done.
    Editing/Modding/Scripting question? Head on over to OFPEC

  6. #16
    I second the good news here! ***Figured as much but nice to know for sure that all the effort we are putting into learning Arma I won't be wasted. ***Thanks ***



    check out www.ofpec.com for great OFP/ArmA missions and editing tools
    John 21:25

  7. #17
    * using of undefined variable in scripts (nil value) will be in ArmA 2 strictly reported as an error.
    Excellent. So the parser reports an error if a variable has a value of NIL when being used in a statement. That means that this tedious search for variable typos in long scripts will be history
    Like "_startxposition" vs "_starxposition" and the ususal typos, especially in longer or complex scripts.

    Thanks,
    VictorFarbau
    Last edited by W0lle; Apr 13 2009 at 04:57.

  8. #18
    So lets say I have the following code:

    call compile format["%1Status = east", _varTarget];

    _varTarget could be any number of targets and the variable beings stored doesn't exist before this moment. Does this count as initialization for that variable variable?
    Last edited by W0lle; Apr 13 2009 at 04:57.

  9. #19
    I don't think so. I always declare them before I do that.
    --Ben

    Edit: I believe that is a valid declaration.




  10. #20
    So lets say I have the following code:

    call compile format["%1Status = east", _varTarget];

    _varTarget could be any number of targets and the variable beings stored doesn't exist before this moment. Does this count as initialization for that variable variable?

    Looks fine to me as long as _varTarget is defined. Let's say it is set to "foo".

    Format creates the string "foo1Status=east".

    Compile turns that into a command:-

    foo1Status=east

    Call runs the command so you are effectively creating a new initialised variable.
    Last edited by W0lle; Apr 13 2009 at 04:57.
    Author of PVPmissionWizard ArmA2FPSAnalyser AddonChecker and ... squint

    Tools homepage

    Crosseyed and Painless - a blog about my ArmA2 developments



Page 2 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •