OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: divzero_nemesis on 14 Jul 2003, 15:18:54
-
Hi, my problem:
i am creating a mp-mission, where the host is able to select 3 levels of difficulty.
there are 3 mines on a road, but if the host sets to easy, there should be no mines.
i have already tried with "mine1 setpos [0,0,0]", "mine1 setpos getpos someobject", but the mines dont move!
since it looks like one cannot move mines this way (and i dont know another), i tried to let them get deactivated by an engineer: "someguy action ["deactivate", mine1]", but it doesnt work somehow..the guy knees down, makes a "deactivation" move, but the mine is still armed
i hope somebody knows the right command for moving the mine, or at least deactivate one
-
Mines are very difficult - they don't respond to some commands. I did manage to figure out a workaround, which I'm going to turn into a proper tutorial when I get time. In the meantime go to my website (http://www.freewebs.com/macguba)and download the beta mission Regina Proeliorum. un-pbo it and have a look at the mine scripts in there. (I can't remember what I did so I can't tell you I'm afraid .....) Feel free to nick anything that is useful, if you do I'd appreciate a wee mention somewhere when your mission is published.
-
wow thanks!
it was quite tricky, but it worked!
for anybody who wants to know the solution:
dont place the mines the conventional way, instead create a marker for each mine, and then create a mine at each marker position with the camcreate command:
mine1 = "mine" camCreate getmarkerpos "marker1_1"
mine2 = "mine" camCreate getmarkerpos "marker1_2"
mine3 = "mine" camCreate getmarkerpos "marker1_3"
;make the markers invisible on the map:
"marker1_1" SetMarkerType "Empty"
"marker1_2" SetMarkerType "Empty"
"marker1_3" SetMarkerType "Empty"
now if you want the mine to be removed b a specific trigger(or in a script), just write:
mine1 setpos [0,0]
in the "on activation" field (or in the script)
if you want the mine to be moved to a new place: mine1 setpos [(someplace getpos 0), (someplace getpos 1)]
You see the "setpos" command just takes x and y coordinates as input...but it doesn't work at all if you don't create the mine via the "camcreate" command