Home   Help Search Login Register  

Author Topic: Weapons  (Read 1565 times)

0 Members and 1 Guest are viewing this topic.

raggy88

  • Guest
Weapons
« on: 11 Jun 2006, 18:06:10 »
I'm making a mission that attack a base. now i want these east men to use weapons other than the standard M16. the weapons i want them to use is LSR_M4_AIM with the magazines LSR_M4MAG

the code i'm using is

Code: [Select]
removeallweapons P1; P1 addmagazine "LSR_M4MAG"; P1 addweapon LSR_M4_AIM; "P1 Addmagazine "LSR_M4MAG"
Now when i attemt to get into the map it get a error message.

" Can Not load mission, Missing Addon: "LSR USMC" (when i load the same into the single player misson editor it works the first time every time.
)

How ever if i them select Start Mission (or what ever it is called) it loads.

Is there a way to get it to load the first time round.


Also how can i make it so i respawn with that weapon every time i/ my team die.

I hope you can help me. plese make it as simple as possible.

I have created respawn script and it works great........
apart from the script every thing i have entered with the weapon commands is in the Intl. field


Hope you can help. thanks for your time..

Noob

Offline Seven

  • Members
  • *
  • Am I a llama?
Re: Weapons
« Reply #1 on: 11 Jun 2006, 19:16:07 »
first make init.sqs
Code: [Select]
p1_armed = true
p2_armed = true
p3_armed = true
p4_armed = true
p5_armed = true
...how many players on map...

Have a rearming script rearm.sqs:

Code: [Select]
_unit = _this Select 0
_type = _this Select 1

RemoveAllWeapons _unit

?(_type == "LSR"): Goto "LSR"

#LSR
_unit AddMagazine "LSR_M4MAG"
_unit AddWeapon "LSR_M4_AIM"
_unit SelectWeapon "LSR_M4_AIM"
exit

Then have two triggers for each player on the map like this:

1
Code: [Select]
set repeatedly
condition : !(alive p1)
activation: p1_armed = false;

2
Code: [Select]
set repeatedly
condition : (Alive p1) And Not(p1_armed);
activation: [p1, "LSR"] Exec "rearm.sqs"; p1_armed = true";

finally in the initfield of each of the players put
Code: [Select]
[p1, "LSR"] Exec "rearm.sqs"

ps: I only added one mag cause I thought that could hold but one mag?

Greetz

raggy88

  • Guest
Re: Weapons
« Reply #2 on: 13 Jun 2006, 07:46:08 »
Ok.

So i create Two (2) scripts and place them in my Operation Flashpoint\Users\raggy88\MPMissions\**Saved Map ** directory

First is Called init.sqs

Code: [Select]
p1_armed = true
p2_armed = true
p3_armed = true
p4_armed = true
p5_armed = true

Second is called rearm.sqs

Code: [Select]
_unit = _this Select 0
_type = _this Select 1

RemoveAllWeapons _unit

?(_type == "LSR"): Goto "LSR"

#LSR
_unit AddMagazine "LSR_M4MAG"
_unit AddWeapon "LSR_M4_AIM"
_unit SelectWeapon "LSR_M4_AIM"
exit

Does the first script have to finish with Exit?

Also what happens if i want the first two soldiers to have LSR_M4_AIM and the other 3 to have LSR_M4_MCOG which uses the LSR_M4MAG.

Soory but i'm a noob to the multiplayer part. and only a noob but not a programmer to the single player editors.


Offline Seven

  • Members
  • *
  • Am I a llama?
Re: Weapons
« Reply #3 on: 13 Jun 2006, 08:26:45 »
I don't think you really need to end the init.sqs with exit


Code: [Select]
_unit = _this Select 0
_type = _this Select 1

RemoveAllWeapons _unit

?(_type == "LSR"): Goto "LSR"
?(_type == "ACOG"): Goto "ACOG"

#LSR
_unit AddMagazine "LSR_M4MAG"
_unit AddMagazine "LSR_M4MAG"
_unit AddWeapon "LSR_M4_AIM"
_unit SelectWeapon "LSR_M4_AIM"
exit

#ACOG
_unit AddMagazine "LSR_M4MAG"
_unit AddMagazine "LSR_M4MAG"
_unit AddWeapon "LSR_M4_MCOG"
_unit SelectWeapon "LSR_M4_ACOG"
exit

& make trigger for those 3  (p3, p4 & p5) other players:

Code: [Select]
set repeatedly
condition : (Alive p3) And Not(p3_armed);
activation: [p3, "ACOG"] Exec "rearm.sqs"; p3_armed = true";

ps: look at chris's ofp script editors; I learned that from his prog  ;)
link: http://www.ofpbase.com/pafiledb/pafiledb.php?action=file&id=262

Greetz
« Last Edit: 13 Jun 2006, 08:29:27 by Seven »