Home   Help Search Login Register  

Author Topic: random 'takeweapon' ?  (Read 456 times)

0 Members and 2 Guests are viewing this topic.

Offline nigel

  • Members
  • *
  • I'm a llama!
random 'takeweapon' ?
« on: 15 Nov 2004, 13:34:52 »
Greetings folks,

Long time reader, first time poster. Anyhow, I'll cut to the chase.  I have ammo crates with 6 types of weapons in them (ammo too!), and I was wondering if it was possible to have a trigger that says to a group of people to take whatever is available.  I've tried the 'rearm' action, the takeweapon action (but it has to be like 'Oooh, an rpg! I'll take THAT!")

Know what I'm saying ?

Cheers!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:random 'takeweapon' ?
« Reply #1 on: 15 Nov 2004, 14:55:54 »
I don't really know whether to write

Welcome to the forum!

or not.   So, since you're a long time reader, I won't.   ;D

Anyway, the answer is basically yes.     I would recommend a script called from a trigger rather than trying to do it all in the trigger, although if this is for MP then scripts are not always the best solution.

It's not possible to detect what is in an ammo crate, so the script will already "know" what is in the crate (because you put it there.)     I haven't the time or the skill to write the script now but the gist of it would be that you take each loon in turn, generate a random number using the random command, and give him a weapon based thereupon.    For example, if the random number is between 0 and 1 he gets an RPG, if it's >1 and <=2 he gets a PK, etc..
Plenty of reviewed ArmA missions for you to play

Offline nigel

  • Members
  • *
  • I'm a llama!
Re:random 'takeweapon' ?
« Reply #2 on: 16 Nov 2004, 05:40:54 »
thanks macguba, i'll give it a whirl.  never used the random thingy yet.. but sounds like a good plan.

cheers!

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:random 'takeweapon' ?
« Reply #3 on: 16 Nov 2004, 07:06:18 »
how come i never got a welcome to the forum on my first post >:(
well i dont think thats possible, but i might be wrong
you can script almost anything in ofp

u could get an array of all the weapons in the crate and make a script that has them take a random one.

im kinda odd i guess, i can figure out a way to script almost anything but i cant do any actual scripting, is anybody else like that or just me? ;)

EDIT
oops i guess thats kinda what macguba wrote.
« Last Edit: 16 Nov 2004, 07:07:50 by penguinman »