Home   Help Search Login Register  

Author Topic: UserActions  (Read 3031 times)

0 Members and 1 Guest are viewing this topic.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
UserActions
« on: 02 Jul 2009, 03:18:48 »
I'm trying to add an extra couple of UserActions to every Man unit... have tried various permutations in an attempt to add a few more (and used numerous examples) - nothing has worked.  If someone could advise, that'd be fantastic.  Other items in the config.cpp work fine, so there's obviously just something I'm doing wrong with the CfgVehicles section!

Code: (config.cpp) [Select]
class CfgVehicles {
class Man;
class CAManBase : Man
{
class UserActions
{
class HMM_OPT_TurnOn
{
displayNameDefault = "OPT On";
displayName = "OPT On";
position = "action";
showWindow = 0;
hideOnUse = 1;
radius = 0.1;
onlyForPlayer = 1;
priority = -1000;
condition = "not(HMM_OPT_Status==""ON"")";
statement = "HMM_OPT_Status=""ON"";";
};
class HMM_OPT_TurnOff
{
displayNameDefault = "OPT Off";
displayName = "OPT Off";
position = "action";
showWindow = 0;
hideOnUse = 1;
radius = 0.1;
onlyForPlayer = 1;
priority = -1000;
condition = "HMM_OPT_Status==""ON""";
statement = "HMM_OPT_Status=""OFF"";";
};
};
};
};

Thanks in advance (again).

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: UserActions
« Reply #1 on: 02 Jul 2009, 11:32:03 »
 
i can see a few potential problems that may help

1. radius = 0.1; expand this try 2 or more, it seems arma2 needs bigger radius some say 5 is minimum but i have had 2 work in planes.

2.position = "action";  is this an actual position ? if not then better to try a known selection such as head or spine etc.

3.condition = "not(HMM_OPT_Status==""ON"")";  write a little script that will verify that these conditions are true, Arma2 is apparently a lot stricter now on variables that are not set a value in the init ( this aint gospel and i am trying to find some better info ).


I love ofp

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: UserActions
« Reply #2 on: 02 Jul 2009, 12:50:50 »
Thanks Deano, I've got it working.  #1 seemed to make a difference, but #2 is fine as-is.  The condition also didn't work as it was, but will work on fixing that :)

Another issue that has cropped up, though, is that the position given only applies to a Man (obviously), but that same position obviously doesn't exist in the variety of vehicles.  Do you know if there's any 'standard' position that I can add that allows the actions to be visible everywhere?

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: UserActions
« Reply #3 on: 02 Jul 2009, 12:57:40 »
 i believe if you leave it empty the engine will add it to the chosen thing , but needs a decent radius , so
position = ""; would be worth a try
in addition most things have a memory point called zamerny (center ?) so you could add memory = 1; and position "zamerny" ; giving it a decent radius for larger vehicles.

for planes try canopy or something common within the class.



 
« Last Edit: 02 Jul 2009, 13:18:06 by DeanosBeano »
I love ofp

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: UserActions
« Reply #4 on: 02 Jul 2009, 13:14:19 »
Well, using "zamerny" or leaving it empty does work in all of the land vehicles, ships and static guns... but not in the air vehicles.  I can't seem to find something that works properly in air vehicles (but, in all honesty, I have no idea where I'm looking...)

Thanks very much for your help thus far, Deano :)