Results 1 to 2 of 2

Thread: Checking whether a script successfully ran (call, spawn, execVM)

  1. #1

    Checking whether a script successfully ran (call, spawn, execVM)

    Im in the process of adding some debug code in the rpt for a majority of my scripts to help make it easier to figure out what script is causing the problem. Some scripts are calling other scripts and some variables are being used in multiple scripts (although this is moderated). I dont have any issues now, but I might later on when I make changes to certain things, and the default errors arma gives you are sometimes completely inaccurate (or none at all).

    Is there a way to check if a call to a script or function was successful? I read that under isNil from the biki:

    Tests whether the variable defined by the String argument is undefined, or whether an expression result passed as Code is undefined. The function returns true if the variable is undefined or the expression result undefined (i.e. the expression result is Void), and false in all other cases.
    Ie. Spawn returns a handle, as well as execVM, but what if your calling via (0 = execVm "blah.sqf") or dont have a return for a script/function? will this still evaluate as void/undefined? Can this work with call as well?

  2. #2
    Gunnery Sergeant
    Join Date
    Nov 19 2005
    Location
    Queensland ***"Australia"
    Posts
    473
    add a hint to the script with your variables
    IE
    hint str(["BLAH.sqf",_var1,_var2,_var3]);
    or
    diag_log str(["BLAH.sqf",_var1,_var2,_var3]); to send it to the rpt

Similar Threads

  1. call, execVM and spawn, which and when?
    By Tankbuster in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 10
    Last Post: Mar 2 2013, 19:05
  2. nul = []...execVM vs. just execVM in init.sqf
    By Skelt in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 15
    Last Post: Oct 8 2011, 13:37
  3. Spawn/ExecVM - When to Use What?
    By GossamerSolid in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 9
    Last Post: Jan 10 2011, 15:00
  4. How and when to use spawn vs execVM.
    By Splicer in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 21
    Last Post: Jan 8 2010, 19:22
  5. call doesn't work but execVM works
    By d3nn16 in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 7
    Last Post: Nov 28 2007, 16:07

Posting Permissions

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