Home   Help Search Login Register  

Author Topic: Different weapons for different units  (Read 1986 times)

0 Members and 1 Guest are viewing this topic.

lizard

  • Guest
Different weapons for different units
« on: 22 Sep 2005, 14:19:57 »
I need a bit of help sorting out equipment for a MP mission that is otherwise nearly ready for beta testing.

What I want to know is if its possible to allocate different weapons to different units in a MP game, or do they all have to share from the same pool?

Because I'm trying to create a realistic two man sniper mission I don't want the observer paired up with the sniper to be able to choose a sniper rifle. Each man has been named in the editor (sniper & observer) so is there a way I could script this?

i.e. sniper has a choice of sniper rifles, observer has a choice of assault rifles (ala M16+M203)

Many thanks

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Different weapons for different units
« Reply #1 on: 22 Sep 2005, 16:25:37 »
1:Remove the standard weapons of the unit,and run a script:
In init.sqs:
RemoveAllWeapons sniper
RemoveAllWeapons observer
?(local player) and (player=="sniper"):[]exec sniperweapons.sqs
?(local player) and (player=="observer"):[]exec observerweapons.sqs

2.Your script will give them new weapons:

2.1:A dialog shows the options and let them choose:
2.2:Random allocation give them weapons :
2.3:Weaponholder is created so they can pick the weapon they want:

And there are other options for sure,maybe tell us what u want before we start working on
sniperweapons.sqs and observerweapons.sqs.
http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

lizard

  • Guest
Re:Different weapons for different units
« Reply #2 on: 22 Sep 2005, 18:39:15 »
Many thanks for the reply.

I haven't 100% finalised which weapons I'd like the sniper and observer to choose from (too many lovely addons  ::) ) but if you could help me with the script I'd imagine I could simply add more by adding their classnames into the script?

Sorry, despite designing lots of OFP missions my scripting abilities are still very weak  :-[

In your suggestion 2.1 and 2.2 would the players choose their weapons as normal at the briefing stage?

Also, I'm confused, if the player only gets to choose their weapons once a script is running surely the mission will have already started? If so, I'll have to add a waiting time for the helicopter insertion otherwise you might be dumped on the beach with no weapons at all if you don't choose quickly enough...

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Different weapons for different units
« Reply #3 on: 22 Sep 2005, 20:00:15 »
Option 2.1 requires an intro\cutscene with some camera scripting so U can open your dialog and wait for the players decisions.The rest of the game needs a delay then.

Option 2.2 needs no changes,but it would be or choose 1 weaponsetup or choose a random weaponsetup.(Not a player decision)

Option2.3 creates all the possible weapons when player hits the ground so he can choose.

Option 2.4 let the player choose his weapon in briefing.

http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

lizard

  • Guest
Re:Different weapons for different units
« Reply #4 on: 22 Sep 2005, 20:52:21 »
Well, as the mission starts with a covert insertion by helicopter I don't think 2.3 would be suitable.

2.1 is probably out because personally I don't like MP missions with intro's, so I didn't intend to make one for this mission.

So I guess its either 2.2 or 2.4.

Kyle Sarnik

  • Guest
Re:Different weapons for different units
« Reply #5 on: 22 Sep 2005, 20:58:35 »
?(local player) and (player=="sniper")
?(local player) and (player=="observer")

Hey now, this won't work, player isn't a string, you wanna get rid of those quotation marks.

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Different weapons for different units
« Reply #6 on: 22 Sep 2005, 22:44:26 »
Ok but he could wear a string  :P j/k

So 2.1:
U can put all in init.sqs

RemoveAllWeapons sniper
RemoveAllWeapons observer
sniper addmagazine "C8XM4mag";
sniper addmagazine "C8XM4mag";
sniper addmagazine "C8XM4mag";
sniper addweapon "C8XM4reflex";
sniper selectweapon "C8XM4reflex";
sniper addweapon "TACTObjCarry";
sniper addmagazine "TACTbandage";

observer addmagazine "c8xaks74umag";
observer addmagazine "c8xaks74umag";
observer addmagazine "c8xaks74umag";
observer addweapon "C8XAKS74Ucobra";
observer selectweapon "C8XAKS74Ucobra";
observer addweapon "TACTObjCarry";
observer addmagazine "TACTbandage";

These weapons are part of Marpat

If U want a random selection u need to put all your weapons in an array,create a random whole number and select an element out of the array.

For 2.4:
Can someone pls explain how to add weapons to the briefing,i am sure it is somewhere on the
forums but cant find it right away.
« Last Edit: 22 Sep 2005, 22:45:08 by Platoon Patton »
http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

lizard

  • Guest
Re:Different weapons for different units
« Reply #7 on: 22 Sep 2005, 23:42:17 »
Thanks for your help guys. I can add additional weapons to the briefing using the description.ext file.

Not entirely what I hoped for, but its better than forcing players what weapons to use.