Home   Help Search Login Register  

Author Topic: addAction trouble [SOLVED]  (Read 1346 times)

0 Members and 1 Guest are viewing this topic.

addAction trouble [SOLVED]
« on: 12 Jan 2009, 02:22:39 »
Folks,

I've finally managed to get my AP mine script/addon working (just need a cool model) but when I try to used addAction (see below), the action never appears in-game.
Code: [Select]
_mine = "RoadCone" createVehicle [0,0,0];
_mine setPos _mineMarker;
_id = _mine addAction["Disarm Mine", "disarmMine.sqs"];
(For now, I'm using the RoadCone till I draw a custom model)

I've tried using "nearObjects" to find _mine and it's there. I've also tried adding the action to the first object in the nearObjects array in the hope it would fool the game but alas... it didn't.

Oddly enough, the _id value increased when I added an additional action (just to test) but they still don't show?

I've also tried creating a "Logic" and adding the action to that, but no matter what I do, I can't addAction to anything created using the createVehicle command.

Have you guys seen this before and is there a workaround (appart from adding the action to the player?

Thanks for your help.
« Last Edit: 13 Jan 2009, 14:48:01 by DeadActionMan »
There are 10 types of people in the world. Those who understand binary, and those who don't

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: addAction trouble
« Reply #1 on: 12 Jan 2009, 04:28:07 »
You need to be pointing directly at an object to pull up the action for it. The smaller the object, the harder it is to find the exact angle, so it can be easier if you aim through your weapon in order to see your exact direction of view. This is why people often add the action to the player while they are within a couple of meters of it (using a trigger).

If you are struggling, use a car or something big to make sure that you are adding the action to it. The only issue I'd suggest is whether _mineMarker is the correct position, but I guess you'd be able to see the road-cone if that is fine (and you aren't complaining that you can't create a roadcone, only that you can't add the action).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Re: addAction trouble
« Reply #2 on: 12 Jan 2009, 12:13:37 »
Thanks Spooner. As a test, I've just tried adding the action to a "bigger" object/_mine and it still didn't show up. However, I've discovered that after the mission has been running for about 15 seconds, the action appears as it should! I wasn't expecting the delay and wrongly assumed the action wasn't working.

For reasons I can't figure out, actions added to createVehicle objects take time to become available (they seem to be added immediatly as the ID increases). Any action added to an editor placed object show straight away.

Thanks again!
There are 10 types of people in the world. Those who understand binary, and those who don't

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: addAction trouble
« Reply #3 on: 12 Jan 2009, 12:59:50 »
That's true, problably related to the knowsabout level related to the new created object.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: addAction trouble
« Reply #4 on: 12 Jan 2009, 13:53:49 »
http://community.bistudio.com/wiki/reveal

should help me make it available faster for CV'ed objects.