Home   Help Search Login Register  

Author Topic: Phantom addaction  (Read 1923 times)

0 Members and 1 Guest are viewing this topic.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Phantom addaction
« on: 07 Feb 2004, 14:19:08 »
I have this line of code in my init.sqs.    sn1 is the player unit and leader of a squad.

morphineAction = sn1 addAction ["Use morphine", "morphine.sqs"]

I'm pleased to say the whole thing works perfectly.    

However, it seems that the action is also being added to the group members:   when you hit say F5 - 6, at the top of the list of "take m16 mag" etc. there is "Use morphine".      Why is it there?   How can I get rid of it?  
Plenty of reviewed ArmA missions for you to play

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Phantom addaction
« Reply #1 on: 07 Feb 2004, 14:24:20 »
Not an expert, but, if you add an action to a group leader doesn't it add it for the whole group also?

As you want to add it to the player, maybe you could try:

morphineAction = player addAction ["Use morphine", "morphine.sqs"]

Just a guess though.


Planck
« Last Edit: 07 Feb 2004, 14:25:12 by Planck »
I know a little about a lot, and a lot about a little.

deaddog

  • Guest
Re:Phantom addaction
« Reply #2 on: 07 Feb 2004, 14:25:10 »
I've noticed that kind of thing, as well.  Send them away (or "stop" them and move somewhere else) and see if the action is still there.  I'm thinking that it has to do with the fact that actions have a "distance" associated with them.

I don't know if it is possible to get rid of that.

gundernak

  • Guest
Re:Phantom addaction
« Reply #3 on: 07 Feb 2004, 14:28:04 »
If you add an action to a unit or vehicle or object, the action can be seen by anyone who is in a certain range to the unit having the action.

I guess if you add the action to your unit, and other units can see only its action when they are close...

And of course if they use athe action it will not be applied to them, but to the unit who is haveing the action in deed.

If you add an action to your player, the action is always available, because you are always close to yourself... ;)

This is my experience, though I have not read abouti anything.

I hope it is clear, and if I am wrong, please anyone correct me.

gundernak

  • Guest
Re:Phantom addaction
« Reply #4 on: 07 Feb 2004, 14:31:41 »
Anyway does anybody know or is it possible to detect exactly who performed the action.

It will be nice if we could pass units or arrays to the script executed by the action...


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Phantom addaction
« Reply #5 on: 07 Feb 2004, 14:32:39 »
Ahhhhh.........the clouds have receded and everything has become clear.....thanks gundernak.

Actually I lie............it is snowing.   ::)


Planck
I know a little about a lot, and a lot about a little.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Phantom addaction
« Reply #6 on: 07 Feb 2004, 15:32:37 »
Yep, Gundernak is right here.

To answer Gundernaks question:

The script, which gets executed by the custom action
will receive a few parameters automatically.

_this select 0
and
_this select 1

are the two parameters, where you can indicate who
has executed the command and to which object the action
is assigned to.

I can't remember which one stands for what, but it shouldn't
be hard to figure that out  ;)

Soz, but i can't try it out at the mo

~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 Welshmanizer

  • Members
  • *
Re:Phantom addaction
« Reply #7 on: 08 Feb 2004, 03:18:20 »
I did a bit of messing around with this before.

When an AddAction is used, there are 4 things passed to the script:


_this select 0 is the object which has the action

_this select 1 is the object 'using' the action

_this select 2 is the number '0'

_this select 3 is a null value


If you try more (_this select 4 for example) you start getting Zero division errors.

I tried to figure out what the Zero and Null values represented, but I couldn't find anything. I tried all the settings for the object and the ones for the unit 'using' the action, including health, rank, init, skill, name, all of them. Also I tried speed, altitude, rating, units killed but non of these affect the Zero and Null values.
Also I tried using members of my team to use the action but this didn't tell me anything about these 2 values.



Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Phantom addaction
« Reply #8 on: 08 Feb 2004, 06:59:43 »
Welshmanizer,

_this select 2 represents the action-id

If you want to remove the action straight by the script which
was executed, you would use _this select 2 then.

If you would have tried two actions, it would have shown
you more than only a '0'  ;)
Same goes for adding and removing and readding an action.
_this select 2 increases from action to action.

~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 Welshmanizer

  • Members
  • *
Re:Phantom addaction
« Reply #9 on: 08 Feb 2004, 12:22:31 »
Nice one. I forgot about the action ID. 8)

Anyone know if _this select 3 is used by anything?
« Last Edit: 08 Feb 2004, 12:24:23 by Welshmanizer »

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Phantom addaction
« Reply #10 on: 08 Feb 2004, 15:00:19 »
potatoes are best served with brown sauce made upon a roasted hen.
Once  the pan is at some 156 dgr's you should down the temp. to some 110.

Now, this is where you add the carrots.  :)




( ::) )


« Last Edit: 09 Feb 2004, 16:21:56 by Tomb »

Offline Welshmanizer

  • Members
  • *
Re:Phantom addaction
« Reply #11 on: 08 Feb 2004, 15:02:16 »
ya could use in in vehicles...


this select 0 == a tank
this select 1 == the Commander
this select 2 == the gunner
this select 3 == the driver

eh?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Phantom addaction
« Reply #12 on: 09 Feb 2004, 16:11:35 »
Thanks chaps.   I'll just change it to a radio call rather than an action.    My intention is just to provide a "get out of jail free" card if the player can't walk.    The mission is set on The Hill on Kolgujev and you know how easy it is to pick up damage on those steep slopes.

Tomb m8, I have no idea what you're talking about.   ;D
Plenty of reviewed ArmA missions for you to play

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Phantom addaction
« Reply #13 on: 09 Feb 2004, 16:29:40 »


neither do I  :) :moon: