OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: KTottE on 21 Jul 2003, 20:11:51

Title: UserAction and weapons
Post by: KTottE on 21 Jul 2003, 20:11:51
Okay, I've tested this a little bit, with the class UserAction bit.
What I want to know if there is some way of getting it to work with handheld weapons. I.E an M16, M4 or M249, because I've had problems with getting that to work.
It works when I add it to a unit for instance, but when I add it to the gun itself the action doesn't show up for my player. I'm guessing this is because the action is added to the object?
But shouldn't anyone close enough get the action?
And you'd think that someone holding a gun would be close enough to it :)

But maybe the problem is you can't use actions of objects that you are holding?
I'll be helpful for any information that I can get.
Title: Re:UserAction and weapons
Post by: Jackal326 on 22 Jul 2003, 01:27:31
From what I understand, weapon actions are not possible. Looking at the (demo) HK model, it seems as if BIS were planning on including a functional light (all the Memory L.O.D. points are there), but for whatever reason it hasn't been included. I guess this is because they decided against user actions for weapons etc.

If however, you do find a way to get it working, let me know as I can find great use for it :).
Title: Re:UserAction and weapons
Post by: KTottE on 22 Jul 2003, 15:57:34
Sif I can't :P

I was thinking earlier today, that if you make a config that does:

Code: [Select]
cfgVehicles
{
  class default{};
  class Man : default
  {
      class UserActions
      {
           class OurCoolAction
           {
               foo=bar;
           };
      };
   };
};

Now, that would define all following cases of units inheriting from class Man (all units in fact) to be able to use said action. But I'm not sure how this works when creating an addon. However, with a mod and an accompanying config.bin it would be different, and all units in the mod would be able to use it, I think that's how the FDF Mod guys added the "Medic" action to everyone.

So, that's a solution to make all men able to use the action, when the condition is met (player hasWeapon "weaponname").
Not sure however, and like cbfa creating an entire mod just to find out. People in the process of doing their own mods however, can go ahead and try this :)
Title: Re:UserAction and weapons
Post by: CrashDome on 02 Aug 2003, 06:34:46
How does BIS add the actions for placing satchels? Is that Ammo specific or on All units?
Title: Re:UserAction and weapons
Post by: KTottE on 02 Aug 2003, 10:16:22
That's a whole different thing. They have the weapon "put" coded into the game, and the satchel weapon has a property in the config that tells it to be placable as such.
But you can't use that to fire your own scripts, which is what I want to do.