Yes, I recompiled all, but I think I resolved after working on it for the whole day: For some strange reason, it didn't work because I was using a symbolic link to launch nse. Now it's ok, I can get the coordinates, but if I call setdest on the node, and I call getx some time later, I still get the old static coordinates while I need the position of the node at the time when I call the command.
Thanks for answer ;) Fabio dang vietchau wrote: Hi, I don't know for sure but, did you recomplie the code? On 1/15/06, Fabio A. D'Aprano <[EMAIL PROTECTED]> wrote: Hi all I have a wireless scenario and I need to get the position of a mobile node through the TCL script and not in C++ as I've seen in many mailing list answers. I'm still wondering why nobody implemented a method in tcl to GET the co-ordinates (is it so unuseful?) in the official versions of ns-2, so I decided to write it on my own with the help of the messages I found here in the mailing list, with no success. First try: editing mobilenode.cc adding code like this: [...] } else if (strcmp(argv[1], "getx") == 0) { Tcl& tcl = Tcl::instance(); tcl.resultf("%f", X_); return TCL_OK; } [...] And so on for y and z. It doesn't work... After I recompiled the code, I tried to get the x value like this: set x [$node1 getx] But I get an error... It seems that the command "getx" doesn't exist... Where's the mistake? Second try: editing ns-mobilenode.tcl adding: [...] Node/MobileNode instproc getX {} { $self instvar X_ return $X_ } [...] And so on for y and z. Here comes the funny thing: it seems that ns-2 simply ignores this file.. even editing the existing functions contained here I get always the same results (for example removing all the content of a function, I should have a function that does nothing, and I get a function that does the original instructions instead...) Is there a kind user that faced this problem before and could help me? Thanks in advance Fabio D'Aprano -- Dang Viet Chau