OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Woodpeckersam on 26 Mar 2005, 14:43:36
-
Hi i need help, i have a script where at the end of it, i made the player have 2 mines, and i gave the player a waypoint to plant it over the bridge..
How do i make it so that when the player have no mines, a script will activate? Thxs in advance
-
use the hasweapon command?
? (player hasWeapon "Mine") : Exit
[] exec "yourscript.sqs"
Maybe you should use a count to know if he has more mines
Good luck
-
always check the comref (http://www.ofpec.com/editors/comref.php?letter=H#hasWeapon) ;)
-
I did check the comref but i saw the word weapon but mine is known as a magazine so... i thought it would not work. But thanks!
So now this is what my script looks like. is it Correct?
_plyr = _this select 0
~0.1
goto mine
#mine
_plyr domove getpos flagg
? (_plyr hasWeapon "Mine") : goto "nomine"
goto mine
#nomine
nomine = true
exit
-
You've kind of got the right idea... ;)
As far as OFP is concerned, a mine isn't technically a weapon. The weapon used to 'fire' the mine is "put".
So you need to check the unit's magazines. Try this:
? ("Mine" in magazines unit): run script/etc.
-
and i gave the player a waypoint to plant it over the bridge..
Your mission will be non-functional in Veteran mode. And a little dull in Cadet mode.
Use the Briefing, cutscenes, radio sidechat or some other method to tell the player that he must plant mines on the bridge. Waypoints should be only a bonus for Cadets. Good waypoint are precise enough to be helpful, but vague enough to prevent the mission from being just a prescriptive list of instructions.