Home   Help Search Login Register  

Author Topic: addaction ids  (Read 582 times)

0 Members and 1 Guest are viewing this topic.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
addaction ids
« on: 15 Dec 2004, 03:35:39 »
if you are using a script to give multiple vehicles an action could you do something like:
placebomb = vehicle addaction ["place bomb","bomb.sqs"]

or would placebomb only reference one of the vehicles action. i think i already know the answer, and its not the one i want, so, can anyone give me a quick answer?

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:addaction ids
« Reply #1 on: 15 Dec 2004, 07:15:29 »
Let me get this straight... you want to use the same line of code:

placebomb = vehicle addaction ["place bomb","bomb.sqs"]

On a bunch of different vehicles? Like this?

placebomb = vehicle1 addaction ["place bomb","bomb.sqs"]
placebomb = vehicle2 addaction ["place bomb","bomb.sqs"]
placebomb = vehicle3 addaction ["place bomb","bomb.sqs"]

And you want to know if placebomb will have the right action ID for all the vehicles? Is that right?

Well, obviously placebomb only contains the action ID of the very last action added, since you overwrite the variable each time except the last. So the answer is, not always. It will only be the same if all the vehicles already had the same number of actions added before you added this action to them.

Is that what you were after? I'm not really sure I understand...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction ids
« Reply #2 on: 15 Dec 2004, 14:48:21 »
alright, that means it should work, i'm using foreach to give a bunch of vehicle a few actions, right at the beginning (execing with a trigger to get the list, which will be instant since it covers stuff that will activate it)

thanks

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:addaction ids
« Reply #3 on: 16 Dec 2004, 03:04:28 »
watch out. If you remove the action then the action id becomes null, and you cannot reassign it.

I had this problem with one of my scripts, and learned it the hard way.  :'(
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction ids
« Reply #4 on: 16 Dec 2004, 03:40:25 »
that won't be a problem, thanks for your concern tho  ;)

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:addaction ids
« Reply #5 on: 16 Dec 2004, 04:52:49 »
theres a mission in the addons depot in the misc section and it has an exellent way of 1 vehicle getting destroyed.. Yes I know you need multiple vehicles but it may be helpful..  ;)
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction ids
« Reply #6 on: 16 Dec 2004, 05:07:42 »
that, to tell you the truth, has nothing to do with what i am asking, or what i am trying to accomplish (if it works you'll see what it is in the script beta test board). thanks though