Home   Help Search Login Register  

Author Topic: addaction  (Read 674 times)

0 Members and 1 Guest are viewing this topic.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
addaction
« on: 06 Dec 2004, 22:59:35 »
simple question, but the comref doesn't help, and i can't find anything here:
can you use arguments with addaction?
ex: player addaction ["do stuff",[vehicle,unit] exec "dostuff.sqs"]
or something to that affect?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:addaction
« Reply #1 on: 06 Dec 2004, 23:09:59 »
I don't think so.

IIRC ihere was a thread about this a few months back.   In some circumstances you can work around it, and as you know some arguments are passed automatically.
« Last Edit: 06 Dec 2004, 23:10:12 by macguba »
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:addaction
« Reply #2 on: 06 Dec 2004, 23:17:41 »
If I recall correctly 3 things are passed by addaction.

[_obj, _loon, _index]

_obj is the object the action was attached to
_loon is the loon that activated the action
_index is the index number of the action


Planck
« Last Edit: 06 Dec 2004, 23:18:09 by Planck »
I know a little about a lot, and a lot about a little.

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:addaction
« Reply #3 on: 06 Dec 2004, 23:21:25 »
My advice, use global variables instead. It may be dirty, but it sure as h$%% gets the job done.
« Last Edit: 06 Dec 2004, 23:22:24 by MachoMan »
Get those missions out there you morons!

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction
« Reply #4 on: 06 Dec 2004, 23:34:27 »
Planck:what is the difference between obj and loon? how do you attach an object to the action, that might work for what i'm doing

MachoMan: not an option, i'm making somethingthat is
A) for multiplayer(if i can)
B)it involes a bunch of scripts together - one calls 3-4 actions, which might give you 2-3 more options, all sorts of stuff, thats a lot of variables

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:addaction
« Reply #5 on: 06 Dec 2004, 23:43:22 »
Planck:what is the difference between obj and loon? how do you attach an object to the action, that might work for what i'm doing

obj = the object to which you attached the action, using addAction.
For example: You have created a chopper and with a custom script. The script allows the pilot and gunner to launch flares. The pilot activites the flares.
Now:
obj = chopper
loon = pilot
Get those missions out there you morons!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:addaction
« Reply #6 on: 06 Dec 2004, 23:47:23 »
If you use:

player addaction ["NameOfAction", "RunThis.sqs"]

Then I think the action will be attached to the player.

Just change the 'player' part to the relevant unit.

Remember that anyone who gets close enough to a unit that has an action attached, is able to activate it, thats why there is a difference in who has the action attached and who activates it..............A large sentence don't you think?  ::)

EDIT:   Hmmmm.......I'm getting slow


Planck
« Last Edit: 06 Dec 2004, 23:49:10 by Planck »
I know a little about a lot, and a lot about a little.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction
« Reply #7 on: 07 Dec 2004, 00:06:09 »
so then i could, say, give the vehicle i'm dealing with the action, and then the player would activate it, and so the vehicle would be this select 0 and the player would be this select 1

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:addaction
« Reply #8 on: 07 Dec 2004, 00:11:47 »
No.............this select 1 would be whoever activated the action......not necessarily the player.


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

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction
« Reply #9 on: 07 Dec 2004, 00:31:21 »
will ai use actions?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:addaction
« Reply #10 on: 07 Dec 2004, 00:49:19 »
Ahaaaaaaaaa...........No.........Not of their own free will........cos they don't have any.

You would need to order them to do it I suppose.

But in MP another player could activate the action attached to another player.


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

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction
« Reply #11 on: 07 Dec 2004, 01:03:06 »
actually, that makes everything easier, thanks all