Home   Help Search Login Register  

Author Topic: Help with action menu pleeeeeeeeeeease :(  (Read 4255 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 »

CptBravo

  • Guest
Re:Get Marker pos questions pleeeease
« Reply #15 on: 21 Jan 2004, 03:23:50 »
And all I have in mission folder is the 3 scripts to move the 3 groupes:

w1move.sqs

onMapSingleClick {w1 move _pos; leader w1 sidechat "Roger that! G1 Moving on"; gl_w1 setPos [_pos select 0, _pos select 1,0]; onMap=true; onMapSingleClick {}}

and two more scripts for w2 and w3.

The question is how where do I add the other "stuff"  ;D

Thanks

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #16 on: 22 Jan 2004, 04:03:30 »
Please tell me it is easy to do and not an impossiblity! That would shatter all my dreams and hopes in this life ( ok ok ok a bit of drama I though might solicit response quicker!)  ;D

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #17 on: 22 Jan 2004, 11:25:47 »
IT'S VERY VERY EASY AND NOT AN IMPOSSIBILITY!!


What was the question again?

Oh yes, actions.   Well you'll need the commands setBehaviour and setFormation as well, details in the command ref of course I always use the online version myself.

FirstAction = player addAction ["Whatever", "whatever.sqs"]

And then in the script called whatever.sqs you'll have a whole bunch of stuff including more addAction commands and one like this

player removeAction FirstAction

That's all there is to it.

If you haven't done so already you should take a look at the Chain of Command (CoC) mod.   They have already done this is a much larger way - in fact the onmapsingleclick command was specifically introduced by BIS to help make their stuff easier to do.
Plenty of reviewed ArmA missions for you to play

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #18 on: 22 Jan 2004, 17:48:28 »
Thanks for the response.

I am sure its very easy once I know how to do it. Just like moving groups on map via action menu. Seemed impossible till I saw the light :)

Actually I have looked and tried the CoC and its great. Only downside is its only for SP not MP.

I need something rather simple that will allow for large groups without the lag.

I guess the main challange I am having is how do you add submenue in actionmenu ? So under group one I'd have 3 more options and under each option I have three more options?  

I guess giving an example is best way to learn:

I have a trig activated by anybody once to fire script. In its activation:

FirstAction = leader gw1 addAction ["Group3","w3move.sqs"];

Then the script w3move.sqs:

onMapSingleClick {w3 move _pos; leader w3 sidechat "Roger that! G3 Moving on"; gl_w3 setPos [_pos select 0, _pos select 1,0]; onMap=true; onMapSingleClick {}}

w3 setBehaviour "COMBAT"


As you can see I am trying to add the the option of COMBAT under group 3.

And this is where I am having a hard time understanding how to add options under one group.  PLace it in different script? Trig?

Thanks



Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #19 on: 22 Jan 2004, 18:48:42 »
Hi,

if I remember correctly, uiox has written a very good tutorial on addaction. Check under his name in the editor depot (if it's working) and you should find it.

Cheers

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #20 on: 22 Jan 2004, 20:56:58 »
Thanks. I saw that one but honestly its a bit too advanced for me. He has a few scripts running together in that mission.

Ohh well...  ???

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #21 on: 22 Jan 2004, 21:02:44 »
There is one simple concept that you have not yet grasped.   When you do grasp it (which will be very soon) you will scream with rage and frustration that you didn't get the hang of it sooner.

I get the impression that you understand how to use addaction to make a script start running.   Is that true?   Let's assume it is.

Do you understand how to use removeAction, so that you can make an action disappear from the action menu?

Assuming you do, all we are left with is the mysterious concept.   It's this:-

In a script started by an addaction thing, you can remove the original action and also, if you wish, add new actions.    

This process can be repeated in any way you want.   So the scripts started by the new actions can remove these new actions and add another action which is exactly the same as the original one.   Or a whole new set of actions.

That's it.    If you know how to use addaction and removeaction, and you know how to make addaction make a script start, then you know everything required to make a cascading sequence of submenus.

If this post doesn't make sense (which is more than possible  ::)) read it again.     If it still doesn't make sense, highlight the bits that are gibberish and I'll explain it in a different way.   It's one of these things that's unspeakably complicated till you see the light, then it's very straightforward.

The underlying problem is that you think you don't know how to do what you want, but in fact you do.   You aren't missing any information.   All you have to do is rearrange the stuff that's already in your head.  :thumbsup:
Plenty of reviewed ArmA missions for you to play

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #22 on: 22 Jan 2004, 21:53:17 »
Just for info:

Gameer and me are working on a new version of my beta
project: MOTAG (more than a group)

As the name says: you can easily command more than a group

Features:

-Controlled by dialogue boxes

-store groups to give the same commands for multiple group at
 once

-Variable: behaviour combatmode formation speed settings

-Use of your own defined markers for the groups (allows custom
 markers like: USMC markers)

-destination set by mapclick

-custom group names to be displayed (like: 1st infantry squad)
 by default they will be: 1. group, 2. group


The main engine is built up already, i only need Gameer to make
the dialogues, and it'll be ready to go.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #23 on: 22 Jan 2004, 22:00:43 »
@macguba
What you're saying is true but (if I understand what he means correctly) making a menu system is a little bit more complicated.

For example, selecting an option taking you to an action in a list of 4 choices means removing all the actions remaining. The usual (_this select 0) removeAction (_this select 2) is not enough anymore to implement such a system.

We're now talking about saving the action IDs in variables or a global array where menu levels are explicitly defined.

Cheers

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #24 on: 22 Jan 2004, 22:07:25 »
alimag is right.

I sort of figured out to add some submenu actions but now the actions will stay there. And every time I click on a group action the subactions get added AGAIN to action menu along the other actions. And after a few clicks you have one looooong messy action menu.

SO removing all actions is one of the main issues. So I am wondering if there is more to it than just a few trigs and scripts ... ?


 
 
 
« Last Edit: 22 Jan 2004, 22:13:56 by CaptainBravo »

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #25 on: 22 Jan 2004, 22:11:06 »
Now Ronald Spiers had an excellent multi group MP mission/mod.
Only thing it can only be two players
So I was trying to see if the onMapSingleClick would fix that by allowing multi groupes in 3-4 player MP games?

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #26 on: 23 Jan 2004, 06:11:09 »
Now thatI got some of submenue action going .. How do you remove it after group is dead? I want to remove its action andsubaction from action menue after all of thegroup is eliminated.

Detailed answers are grrreatly appreciated :)

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #27 on: 23 Jan 2004, 07:17:36 »
ok I got it!!  ;D

All is left is that stubborn submenu ... sigh!


CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #28 on: 24 Jan 2004, 17:57:13 »
ok ok ok I am halfway there. Now I just need to know how to add a submenue and have it removed till next time I click on its above option again?  :(
Lets say I clicked group w1 and now I need 4 actions below that action: Combat/Stealth/Aware/Safe.

Once choosen all 4 actions will dissapear from menue till main action is clicked again.


I hope someone has a SIMPLE answer assuming there is a simple answer  ???

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #29 on: 24 Jan 2004, 18:34:48 »
I'll tell you, how i did that for my MOTAG, before using
dialogue boxes:

I've got 3 levels of action menu's.

Level 1: unit selection
(scroll thru units/add unit to pool/select all/set destination/order
movement)

Level 2: advanced options (speed/behave/formation/combatmode)

Level 3: advanced settings (change one of the settings, selected in menu level 2)

Now i do put each action, i add into an array:

once i have to change menu level, i delete the action forEach
of the array (for that, i'm always using the very same script,
no matter at which menu level).

The other script, where the new actions will be added, is
waiting for a variable to be set true by the delete action script.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #30 on: 24 Jan 2004, 18:38:30 »
Another releated simple question pleeeease :)

I am using trigs to give me status of each group. So I have 10 groupes and I have 30 Trigs to have leader of group give me "chat msg" how many troops left in his squad. Works fine. Only issue it makes map ckluttry with trigs. Anyway to clean it up??

Example of one Trig:

Condition: ( count units w1) <= 11  

OnActivation: leader w1 sidechat "This is G1 .. we are engaging the enemy and we are one man down!";

I have this repeated 3 times for each group and I have 10 groups works but messy!!  >:(

Anyway to make it in one trig or script is grrrrrrrrreatly appreciated as usual :)

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #31 on: 24 Jan 2004, 18:47:04 »
Thanks Chris for respondding.

I think its the adding into an array that I don't get it. I know how to add action menue and have indivdual ones removed but that is about all I can teach myself with out jumping out of a window!   ;D

By the way yours sound a lot more sophisticated than what I am trying to!! ;D

Question a .. are you going to use the watch script by toadlife? I think it would enhance the whole thing from a technical view.

And b can I be your first beta tester!!!  ;D

Ohh and c is it going to work in MP with more than two players? Right now there is a great one by Spiers but only for two players.

Cheers

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #32 on: 24 Jan 2004, 19:27:17 »
damn - i wrote such a long reply, + attachment (MOTAG),
and then the upload fubar'ed me up.

Well, if you want, i'll send you that thingy to where you want
(PM me or so), so that you can have a look how i managed
that.

:edit - btw - to add those actions into an array is easy

let's say:

action1 = player addAction [blablabla]
action2 = player addAction [blablabla]

action_array = [action1,action2]

or if you add actions later, you could say:

action_array = action_array # [action3]

And to delete them you say:

"player removeAction _x" forEach action_array

:note - if you use to array = array + [anything] method,
then the array must already exist, or you cannot add
anything into it. This means you need to initialize the
array: action_array = []

~S~ CD
« Last Edit: 24 Jan 2004, 19:31:34 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #33 on: 25 Jan 2004, 02:26:06 »
Ughhhhhhhhhhh! Let me scream! lol

My simple mission I have been working on for days when I tested it in editor it worked out great but .. when I tested it today in LAN MP it was a SHOCK! The host could still move his groupes but the client had no control over his?!!

So I am assuming it has something to do with the client/host setting!

So I guess the first question I should have asked .. does the onMapSingleClick work in MP  ???

 

CptBravo

  • Guest
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #34 on: 25 Jan 2004, 07:25:03 »
Another question that came up after testing in MP LAN is the following:

Although it is only the host that can move groupes now, if the host gets killed, then he loses the ability to move groupes too!!  

Now to fire the script I have following in Trig:
FirstAction = leader gw1 addAction ["Group1","w1move.sqs"];

As you see I have the action associated with the group leader not an individual unit. So I am confused as to why the player (host) loses the action menu to move groupes when he respawns into one of his teammates??!

Any help on how to fix it is really appreciated!

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Help with action menu pleeeeeeeeeeease :(
« Reply #35 on: 25 Jan 2004, 11:12:31 »
Well the multiplayer part is the most tricky one here.

You have to know that: every custom action happens local

Now everything you do in a custom action, will only be executed, where the action was triggered.

The example, i've sent you would work in multiplayer for
two players. The only thing which would have to be done is:

create different arrays of group, for different players.

Hell, it should even work for more than two players, but only
if everybody playable has to control his own units, without
touching units of somebody else.

Anyway, back to multiplayer and your problem:

Do you acc the actions again, once the player respawns into
the next teammember, or did you only expect them to switch
to the new leader automatically?


Let's say you want to move something by onMapsingleclick.
If the script, where onMapsingleclick is used, was started
from the action menu, then the parameter _pos only exists,
where the action was executed.

Also, if you move a marker's position, the marker will only move,
where the custom action has been executed.

You need to work with:
publicVariable "variablename"

to transfer changed variables from local to global

Also note that you can't use publicVariable for strings or arrays.
You can only do it with: numeric variables, boolean (true/false),
group/object/units.

I do not exactly know, how you did setup your scenario, and
what you've done for multiplayer yet with it.
What i know for sure is: how to make a multiplayer mission

Once i'll make motag fully multiplayer able (not too far from
now), i'll use OPF's multiplayer weakness as to my advantage.

I'll use the fact that things happen local, just to enable everybody to use the very same scripts and variables, without
them comming across somewhere.


If you want to use more complex stuff like strings and arrays
to be transfered, you need to watch out for CoC network services.


hmm - better not confuse you anymore here  :D

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted