Home   Help Search Login Register  

Author Topic: Addaction questions  (Read 788 times)

0 Members and 1 Guest are viewing this topic.

kevind2003

  • Guest
Addaction questions
« on: 03 Jan 2004, 14:38:30 »
Hi,

Can someone explain the actionid returned by Addaction? for example:

player addaction ["Camera on","menu.sqs"]
player addaction ["Use Radio", "menu.sqs"]

after pressing the "Camera on" action, what kind of values will return to menu.sqs?

How to know if the player has pressed "Camera on" or "Use Radio"?

Thanks

Offline rhysduk

  • Former Staff
  • ****
Re:Addaction questions
« Reply #1 on: 03 Jan 2004, 14:49:13 »
Quote
after pressing the "Camera on" action, what kind of values will return to menu.sqs?

Im not intirely sure but i dont think that any values are returned to the script.. doesnt this jut mean that when the Action "Camera on" is pressed in the Action menu, the script entitled "menu.sqs" is executed ??

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Quid Novi

  • Guest
Re:Addaction questions
« Reply #2 on: 03 Jan 2004, 15:42:03 »
yes - correct - addaction makes a script execute and within that script is where you write the code for what you want to happen...

plus, remember to name your actions like this:

actionname1 = player addaction ["Camera on","menu.sqs"]

and that means you can remove the action later:

player removeaction actionname1

kevind2003

  • Guest
Re:Addaction questions
« Reply #3 on: 03 Jan 2004, 17:30:35 »
I tried

player addaction ["Camera on",{["A"] exec "menu.sqs"}]

but it doesn't work, any ideas to exec values in addaction?  ???

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Addaction questions
« Reply #4 on: 03 Jan 2004, 18:13:52 »
In my experiance you can't pass values with addaction other than the ones it passes by default.. umm.. which are the person who executes the action and umm.. I forgot the rest. Anyhow you must work yourself around it somehow.
Not all is lost.

kevind2003

  • Guest
Re:Addaction questions
« Reply #5 on: 03 Jan 2004, 18:18:58 »
sorry... which value will addaction pass by default? the actionid?

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Addaction questions
« Reply #6 on: 03 Jan 2004, 19:54:34 »
Yea that's one of them.

I can't remember them right now, but you can easily learn them by adding an action and activating a test script with it which has the following

_pass1 = _this select 0
_pass2 = _this select 1
_pass3 = _this select 2
_pass3 = _this select 3
;and so on

hint format ["%1\n\n%2\n\n%3\n\n%4",_pass1,_pass2,_pass3,_pass4]
exit
Not all is lost.

Rappy

  • Guest
Re:Addaction questions
« Reply #7 on: 03 Jan 2004, 20:29:26 »
It's a real shame you can't pass variables though, instead of having one script for several addactions you gotta have one for each because of a fairly minor difference, either that or find a workaround in some other way.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Addaction questions
« Reply #8 on: 03 Jan 2004, 20:43:40 »
Hey m8y, tell us what u want to do instead, put the script in here and we'll see if we can work around it somehow.

:beat: *Gets Scripted* :beat:

kevind2003

  • Guest
Re:Addaction questions
« Reply #9 on: 03 Jan 2004, 22:07:59 »
Thanks for the help, I solve it out, just did a "if equal" statement with the actionid ;D

Code: [Select]
? (count _this == 3): actionid = _this select 2

?(actionid == action1): player sidechat "working"; exit

action1 = player addaction [ "Camera on", "menu.sqs"]

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Addaction questions
« Reply #10 on: 04 Jan 2004, 12:34:32 »
da actions return 3 values

da man dat did da action

da object da action is attached 2

da action ID

@ kevin

wen u solve da prob us solve botton ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta