OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: raggy88 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
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
-
first make init.sqs
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:
_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
set repeatedly
condition : !(alive p1)
activation: p1_armed = false;
2
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
[p1, "LSR"] Exec "rearm.sqs"
ps: I only added one mag cause I thought that could hold but one mag?
Greetz
-
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
p1_armed = true
p2_armed = true
p3_armed = true
p4_armed = true
p5_armed = true
Second is called rearm.sqs
_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.
-
I don't think you really need to end the init.sqs with exit
_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:
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