Home   Help Search Login Register  

Author Topic: Peculiar Waypoint Statement Behaviour  (Read 1886 times)

0 Members and 1 Guest are viewing this topic.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Peculiar Waypoint Statement Behaviour
« on: 06 Jul 2009, 21:45:44 »
I'm having a peculiar issue with a script.  I'm generating a waypoint for a chopper, as in the block of code below (excuse the terrible organisation of it, I'm just fiddling around/testing... will tidy it all up later):
Code: [Select]
_landWP = (group HMM_SUPPORT_TRANSPORT_GO) addWaypoint [[HMM_SUPPORT_TRANSPORT_X,HMM_SUPPORT_TRANSPORT_Y],100];
_landWP setWaypointType "MOVE";
_landWP setWaypointSpeed "FULL";
_landWP setWaypointBehaviour "AWARE";
_landWP setWaypointCombatMode "GREEN";
_landWP setWaypointStatements ["true", "HMM_SUPPORT_TRANSPORT_GO land ""GETIN""; _markerName setMarkerType ""Empty"";"];

Now, the issue here is that while the waypoint statements do execute, they only execute up to the land command.  E.g. if I have the following, I get "Hello" but no action on the land command:
Code: [Select]
_landWP setWaypointStatements ["true", "hint ""Hello""; HMM_SUPPORT_TRANSPORT_GO land ""GETIN""; _markerName setMarkerType ""Empty"";"];
If, however, I use some other method of invoking the land command, it works... so, using StraDebug2, I can enter this and the chopper lands on the nearby Invisible H:
Code: [Select]
HMM_SUPPORT_TRANSPORT_GO land "GETIN";
The command is being executed where the chopper is local, so that's not the issue.  The statements are being executed in some way, so that's not the issue.  I'm a little stumped.  Am I just missing something obvious?

Thanks in advance :)

Anyone with any ideas?
« Last Edit: 14 Jul 2009, 19:21:10 by JamesF1 »

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Peculiar Trigger Statement Behaviour
« Reply #1 on: 14 Jul 2009, 17:14:55 »
Sorry to bump, but anyone with any ideas?  I've tried to come at it with a fresh point of view, but I figure there must be some subtlety that I'm missing (perhaps an A1 -> A2 change?).  The same script seems to work in A1.

Offline Trexian

  • Members
  • *
Re: Peculiar Trigger Statement Behaviour
« Reply #2 on: 14 Jul 2009, 17:36:20 »
Warning: this post will be of no help other than to commiserate.

I've noticed that A2 *seems* to be pickier in some things than A1 was.  Things like using parentheses to structure math formulas and single v. double quotes.  I can't really be specific, only because I'm not absolutely confident that I was doing it right in A1. :D  The stuff I'm seeing may have been errors all along that A1 just kinda got through.

For you, one thing I'd try is the single ' quotes inside the double " quotes in the setWaypointStatements.  That might make sense since it seems like that is the command that is being troublesome.  Might not mean a damn thing, though, too.

Good luck, and post back if you figure out a solution!
Sic semper tyrannosauro.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Peculiar Trigger Statement Behaviour
« Reply #3 on: 14 Jul 2009, 17:46:03 »
Hmm, the code works fine here. Placed myself next to a "H" and used getPos player instead of the *_X and *_Y coordinates.
try { return true; } finally { return false; }

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Peculiar Trigger Statement Behaviour
« Reply #4 on: 14 Jul 2009, 18:56:34 »
Well, the problem is, the chopper does actually fly, but just hovers overhead.

One thing that has sprung to mind is that the chopper is in its own group - as all I need it to really do is land, engine on, and wait until given another waypoint.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Peculiar Trigger Statement Behaviour
« Reply #5 on: 14 Jul 2009, 19:02:42 »
The chopper landed at the "H" but turned the engine off as soon as it touched the ground. You could try to make it flyInHeight (0-2m) as a workaround...

Edit: If you still have A1 installed you might want to take a look at this example.
« Last Edit: 14 Jul 2009, 19:13:43 by Worldeater »
try { return true; } finally { return false; }

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Peculiar Waypoint Statement Behaviour
« Reply #6 on: 14 Jul 2009, 19:41:25 »
Okay... I'd made a really dumb mistake.  I was, at a much later point in the script, re-setting the *_X, *_Y and *_GO variables (as 'clean-up', really)... and had presumed A2 used object references rather than variable references, rather stupidly.  Removed the clean-up code, as it's not really needed if I'm strictly honest, and all is working (i.e. the chopper is landing).

Sorry for my dire stupidity :D