Results 1 to 3 of 3

Thread: Switch and group question

  1. #1

    Switch and group question

    So I'm tryin to randomly place a marker, but I can't get this to work though it seems so simple:

    _rExtract = random 2;

    switch (_rExtract) do
    {
    case 0:
    {
    hint "0";
    "obj_mark_3" setMarkerPos getMarkerPos "extract_mark_0";
    };

    case 1:
    {
    hint "1";
    "obj_mark_3" setMarkerPos getMarkerPos "extract_mark_1";
    };
    case 2:
    {
    hint "2";
    "obj_mark_3" setMarkerPos getMarkerPos "extract_mark_2";
    };
    };
    When running this the marker obj_mark_3 stays just where it is put in the editor and I don't get any hints?


    Another one is that if I have player unit (leader of a group) in editor what is the name of the group? Does it even have one and if it doesn't how do I assign one?

  2. #2
    The switch doesn't do anything, because the _rExtract is never (well, super low probability) exactly 0, 1 or 2.

    Try: _rExtract = floor(random 3);

    Another one is that if I have player unit (leader of a group) in editor what is the name of the group? Does it even have one and if it doesn't how do I assign one?
    Yes, it has a "name" the game assigns it, but it's something like B 1-1-0. To give it a name of your own: myGroup = group this. That works in init field of any member of the group.
    Last edited by Shuko; Aug 31 2009 at 12:34.

  3. #3

Posting Permissions

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