** My solution in NS-2 ver.2.26 (all-in-one distribution) ***
Using $god_ as a variable in scenario files is wrong.
When running the actual version of NS-2, “GOD” is not a variable. Is a TCL
Class, called “God” (“G” is uppercase and “o” and “d” are lowercase),
in module “god.cc”.
Change these lines in setdest.cc:
#define GOD_FORMAT "$ns_ at %.12f \"$god_ set-dist %d %d %d\"\n"
#define GOD_FORMAT2 "$god_ set-dist %d %d %d\n"
#define GOD_FORMAT "$ns_ at %.12f \"God set-dist %d %d %d\"\n"
#define GOD_FORMAT2 "God set-dist %d %d %d\n"
You may have to change text “$god_” (variable?) to “God” (Class name) in
these definition lines and RE-COMPILE (run “make” again).
After these modifications the “setdest” runs normally for all scenarios
generations and my simulations are OK now.
Hope it helps!