Home   Help Search Login Register  

Author Topic: Help with action menu pleeeeeeeeeeease :(  (Read 3809 times)

0 Members and 1 Guest are viewing this topic.

CptBravo

  • Guest
Help with action menu pleeeeeeeeeeease :(
« on: 18 Jan 2004, 07:57:49 »
Hi,

I have a simple question (at least I think its simple!) :)
I am trying to use UnitName commandMove getMarkerPos "MarkerName" only challange is the marker has to be fixed.
Now question is, is it possible to have units follow a dynamic marker ie a one that I can keep changing during the mission. I am trying to get a couple of squads to follow certain markers that I will place all over the map.

Thanks for your help :)
« Last Edit: 22 Jan 2004, 04:01:33 by CaptainBravo »

Azraell

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #1 on: 18 Jan 2004, 09:46:28 »




Code: [Select]
#loop

?move1:"marker name" setmarkerpos [getmarkerpos "marker name" select 0, (getmarkerpos "marker name" select 1)+10,getmarkerpos "marker name" select 2];move1=false

?move2:"marker name" setmarkerpos [(getmarkerpos "marker name" select 0)-10,getmarkerpos "marker name" select 1,getmarkerpos "marker name" select 2];move2=false

?move3:"marker name" setmarkerpos
[(getmarkerpos "marker name" select 0)+10,getmarkerpos "marker name" select 1,getmarkerpos "marker name" select 2];move3=false

?move4:"marker name" setmarkerpos [getmarkerpos "marker name" select 0, (getmarkerpos "marker name" select 1)-10,getmarkerpos "marker name" select 2];move4=false

~.01
goto "loop"

Now just make 4 radio triggers, activate repeatly...

Alpha -onact:-move1=true

bravo -onact:-move2=true

charlie -onact:-move3=true

delta -onact:-move4=true

Activate the script in a manner of ur choosing,

[] exec "nameofmarkermovingscript.sqs"


then just use the radio with ur 4 radio trigs to move it 10 meters

North,South,East,West

change the number 10 u see in the script to whatever you want..i.e 50...for 50meters in those direction or 5 if you want short hops..

theyll only move when the move1,2,3,4 conditions are true...but then they become false again in a split second, ready to be moved again and again...


pretty simple huh? :D

hope this helps :)


p.s..... make sure each ? line in the script is 1 full line, not like you see above in forum form.
« Last Edit: 18 Jan 2004, 09:50:10 by Azraell »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Get Marker pos questions pleeeease
« Reply #2 on: 18 Jan 2004, 09:55:08 »
Find out about the 'onmapsingleclick' command. It's the answer to your wet dreams  ;)
Not all is lost.

Azraell

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #3 on: 18 Jan 2004, 10:11:56 »
yah, that  and user defined markers :)

HuNtA

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #4 on: 18 Jan 2004, 13:07:23 »
It's the answer to your wet dreams  ;)

:| Whaaaaaa!?

anyways, tx for the help, I was havin the same prob

CptBravo

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #5 on: 18 Jan 2004, 18:39:58 »
Azraell : Thanks for the help. I followed your directions .. only thing I am not clear on is how to specify which unit/Group  use the Radios? Any mission example will be grrrrrrrrrreat :)

Artak: thanks for the hint. I looked up onmapsingleclick in the command ref. This is all it had :

Example: onMapSingleClick {"SoldierWB" createUnit [_pos,group player];true}

Since I am no scripting guru I am not sure how to use it. Are there any missions that illustrate how to use the onmapsingleclick to move groupes on map??

Thanks for your help guys :)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Get Marker pos questions pleeeease
« Reply #6 on: 18 Jan 2004, 19:28:24 »
Look it up in the online command ref in the Editors Depot.   There are a couple more examples there which help.

If you want an example mission, you could look at my beta mission Regina Proeliorum which does exactly what you are talking about.   I haven't looked at it recently but it's on my crappy website

http://www.freewebs.com/macguba/

To play it you need Winter Everon and Winter Nogojev though, but you could just d/l it and look at the scripts.   However, I'm sure there are better examples elsewhere.
« Last Edit: 18 Jan 2004, 19:30:39 by macguba »
Plenty of reviewed ArmA missions for you to play

CptBravo

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #7 on: 19 Jan 2004, 06:37:32 »
Thanks macguba for the response.

I downloaded the two missions you have on your site .. but both requir a few addons even the .5 version?

I did look at the scripts in the missions folder and you have one complicated mission!! :)

Just a bit hard to understand specially without the ability to play it or open in editor due to the addons.

Anyway if anyone has a simple mission to explain how 'onmapsingleclick' actually works, it would be grrrreatly appreciated.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Get Marker pos questions pleeeease
« Reply #8 on: 19 Jan 2004, 16:54:03 »
Bloody Hell, you're right ... I'd forgotton there was so much there.   It's playable at the moment - there might be the occasional debug hint and things like the Intro are missing, but it has been through one round of beta testing on the beta board.     If you have a fast connection d/l the addons and play it if you like.   Use the latest version, the earlier one has similar but outdated addons - ignore it.

Anyway, the vital bit is in CSM.sqs.   The purpose of this script is to allow the player (who is leading a tank squad) to control the location of the Company Sergeant Major's support squad, which consists of a repair truck, ammo truck etc.     The player starts the script with a radio trigger (if I remember rightly) then uses onmapsingleclick to tell the CSM group where to go.  

Most of the script is just bollocks about changing the colour of the marker showing the current location of the CSM and if-then statements to cope with what happens if some of the vehicles are damaged.

The crucial line is this:

onMapSingleClick {CSM move _pos; leader CSM sidechat "CSM Moving on"; gl_CSM setPos [_pos select 0, _pos select 1,0]; onMap=true; onMapSingleClick {}}

The various bits mean:-

CSM move _pos;    this just tells the group CSM to move to the place where the map was clicked, which is stored as local variable _pos

leader CSM sidechat "CSM Moving on";     self explanatory

gl_CSM setPos [_pos select 0, _pos select 1,0];      move a gamelogic to the postition given:  I can't quite remember why this was required but its for something in another script.   The point is that _pos is at sea level, not ground level

onMap=true;     a variable which makes the script wait till the player clicks the map

onMapSingleClick {};    "Turns off" the onmapsingleclick so that you can click on the map without moving the CSM again.


Hope that helps.
« Last Edit: 19 Jan 2004, 16:57:16 by macguba »
Plenty of reviewed ArmA missions for you to play

CptBravo

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #9 on: 20 Jan 2004, 05:01:02 »
macguba thank you very very much!! Finally I got it working!!  ;D
I can move now groups via Radio with single click. Only question is it easy to make it movable via action menu instead of Radio?

Actually after playing with action menu I figuerd how to use action menu instead of radios. Only question is how to do you make submenue. So you can choose a group from action menu then choose its: formation or Behaviour or Speed or DoWatch Direction.  

ANd it there a tutorial for action menu? I have searched but with no luck.

Thanks for your great help   ;D
« Last Edit: 20 Jan 2004, 08:07:02 by CaptainBravo »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Get Marker pos questions pleeeease
« Reply #10 on: 20 Jan 2004, 12:05:30 »
Creating submenus is simple, but tedious.

mission start/trigger - top action becomes available

top action fired - script starts, top action removed, submenu actions added

submenu action fired - script starts, submenu items removed, sub-sub menu items added (or top action put back)

etc.


Give your actions an ID to make them easier to identify and remove.   Check the FAQ and search the forum for more tips.
Plenty of reviewed ArmA missions for you to play

CptBravo

  • Guest
Help with Action Menu pleeeease
« Reply #11 on: 20 Jan 2004, 23:15:39 »
Thanks for the quick reply as usual :)

I could not find anything in the forumes search under action menu/ submenu. And non of the tutorials I looked  at had anything on action menu.

I sort of know how to activate a script via action menue now, its the steps after that, getting the sub menu and stop and adding submenu action that I am clueless on!

Any links maybe to an extensive tut. on action menus or a Simple Sample mission showing how it works will be greeeeeeeeeeeatly appreciated.

Thanks for the help.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Get Marker pos questions pleeeease
« Reply #12 on: 21 Jan 2004, 02:16:09 »
There's really very little to it, which I suspect is why there is no tute.

You know how to add an action, right?  Well that's the second hardest part.

How to remove an action, that's the hardest part.  

If you know how to activate a script, then all you have to do is put the relevant code in the script.

Put it another way:  in creating submenus, all you are doing is adding and removing actions.    There is no "cascading menu subsystem" in actions or radio items, it's all just adding and removing actions.      If you are trying it and it's going wrong, then give us more details and we'll try and help;

Sadly I don't have an example mission to post on this one, hopefully somebody will.    It really does help when you can see something in action.  (action - action - it's a pun, "in action", geddit?   do ya? huh? huh?)

OK, OK, no more puns.  :o
Plenty of reviewed ArmA missions for you to play

CptBravo

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #13 on: 21 Jan 2004, 03:15:25 »
Hi,

I am not sure if site is accepting uploads. I have tried to upload mission but got some sort of error msg :(


2: move_uploaded_file(/usr/local/www/ofpec/yabbse/attachments/Test_Actiomenu.Intro.zip): failed to open stream: Permission denied
(/usr/local/www/ofpec/yabbse/Sources/Post.php ln 886)

I'll  post what I have done so far ..
« Last Edit: 21 Jan 2004, 03:17:06 by CaptainBravo »

CptBravo

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #14 on: 21 Jan 2004, 03:20:39 »
I have 3 groups: w1 w2 w3.
What I am trying to do is the following:

From action menue I get 3 actions available Groupe1, Group2 Group3
Once I selected one I get 4 actions for each group, and each one of those actions will provide 4 more choices:

1) Move. Move on map by a single click (already got that one)

2) Behaviour:
a) Stealth b) Combat c) Aware d) Safe

3) Formation:
a) Line b) Wedge c) Vee d) Cloumn

4) Face direction. Based on toadlife's watch script
a)90  b)180 c)270 d)360

And when a group gets killed its actions gets removed from action menu.

I already got the first one which is moving different groupes on map.

As always, your help is greatly appreciated!  ;D

This is the mission since I can not post it:

version=11;
class Mission
{
   addOns[]=
   {
      "bis_resistance"
   };
   addOnsAuto[]=
   {
      "bis_resistance"
   };
   randomSeed=5505027;
   class Intel
   {
   };
   class Groups
   {
      items=4;
      class Item0
      {
         side="WEST";
         class Vehicles
         {
            items=1;
            class Item0
            {
               position[]={9365.340820,45.726944,4163.716309};
               azimut=82.757698;
               id=0;
               side="WEST";
               vehicle="OfficerWHG";
               player="PLAYER COMMANDER";
               leader=1;
               skill=0.600000;
               init="gw1 = group this";
            };
         };
      };
      class Item1
      {
         side="WEST";
         class Vehicles
         {
            items=3;
            class Item0
            {
               position[]={9449.680664,29.837919,4184.543945};
               azimut=82.757698;
               id=1;
               side="WEST";
               vehicle="OfficerWHG";
               leader=1;
               rank="LIEUTNANT";
               skill=0.600000;
               init="w1 = group this ";
            };
            class Item1
            {
               position[]={9441.364258,30.109629,4191.806152};
               azimut=82.757683;
               id=2;
               side="WEST";
               vehicle="SoldierWB";
               rank="SERGEANT";
               skill=0.600000;
            };
            class Item2
            {
               position[]={9441.250000,30.037266,4176.421875};
               azimut=82.757683;
               id=3;
               side="WEST";
               vehicle="SoldierWB";
               rank="SERGEANT";
               skill=0.600000;
            };
         };
      };
      class Item2
      {
         side="WEST";
         class Vehicles
         {
            items=3;
            class Item0
            {
               position[]={9449.520508,29.838741,4161.876465};
               azimut=82.757698;
               id=4;
               side="WEST";
               vehicle="OfficerWHG";
               leader=1;
               rank="LIEUTNANT";
               skill=0.600000;
               init="w2 = group this ";
            };
            class Item1
            {
               position[]={9443.422852,29.971224,4167.210938};
               azimut=82.757683;
               id=5;
               side="WEST";
               vehicle="SoldierWB";
               rank="SERGEANT";
               skill=0.600000;
            };
            class Item2
            {
               position[]={9442.397461,29.858177,4155.102051};
               azimut=82.757683;
               id=6;
               side="WEST";
               vehicle="SoldierWB";
               rank="SERGEANT";
               skill=0.600000;
            };
         };
      };
      class Item3
      {
         side="WEST";
         class Vehicles
         {
            items=3;
            class Item0
            {
               position[]={9448.523438,29.825188,4139.457520};
               azimut=82.757698;
               id=7;
               side="WEST";
               vehicle="OfficerWHG";
               leader=1;
               rank="LIEUTNANT";
               skill=0.600000;
               init="w3 = group this ";
            };
            class Item1
            {
               position[]={9439.525391,29.533472,4144.266113};
               azimut=82.757683;
               id=8;
               side="WEST";
               vehicle="SoldierWB";
               rank="SERGEANT";
               skill=0.600000;
            };
            class Item2
            {
               position[]={9441.161133,29.208107,4132.232422};
               azimut=82.757683;
               id=9;
               side="WEST";
               vehicle="SoldierWB";
               rank="SERGEANT";
               skill=0.600000;
            };
         };
      };
   };
   class Markers
   {
      items=1;
      class Item0
      {
         position[]={9368.155273,44.880917,4163.133789};
         name="Observation_Base";
         type="Flag";
      };
   };
   class Sensors
   {
      items=1;
      class Item0
      {
         position[]={9371.809570,43.799026,4163.047363};
         activationBy="ANY";
         age="UNKNOWN";
         expActiv="leader gw1 addAction [""Group1"",""w1move.sqs""]; leader gw1 addAction [""Group2"",""w2move.sqs""]; leader gw1 addAction [""Group3"",""w3move.sqs""]";
         class Effects
         {
         };
      };
   };
};
class Intro
{
   randomSeed=14818819;
   class Intel
   {
   };
};
class OutroWin
{
   randomSeed=6903299;
   class Intel
   {
   };
};
class OutroLoose
{
   randomSeed=14650883;
   class Intel
   {
   };
};


« Last Edit: 21 Jan 2004, 03:35:10 by CaptainBravo »