OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: pazuzu on 26 Dec 2004, 20:58:44
-
I'm making a mission for Afghanistan island where the 2nd objective is to capture Bin Laden alive.
I'm using (damage binladen) > .3 for the condition on 2nd obj.
The idea is to shoot him in the leg wounding & disabling him & that is counted as capturing him to end the mission.
The problem I have is a player doing a long distance shot & wounding Osama then the mission ends as a success even though Osama is still surrounded by alot of enemy units.
I was wondering if it is possible to have a condition for how close the player gets to Osama or some other way of forcing the player to get close to him to capture him(mainly by shooting him in the leg).
Is it possible to use the "knowsabout" command as a condition or something along those lines?
Thanks.
-
Possibly something like:
? ((damage binladen) > .3) && (player distance binladen) < 5) : setcaptive binladen
Or something like that.
Planck
-
Hmm,
What does (player distance binladen) < 5) mean?
Does player have to get 5 meters from him?
& I dont get the setcaptive binladen...
Is this like the setcaptive true command?
Thanks for replying so quickly.
-
setCaptive binladen marks him as captive.
You can always put a different distance in there, it doesn't need to be 5 metres...put whatever you need.
Try it out anyway, it might need some syntax tweaks.
Planck
-
Great, I'll test it right now...
Thanks again.
-
you can also check whether there are any other enemies nearby other than binladen
an easy way to do all of this is make a trigger:
Trigger
name: trig1
size: distance from binladen (circle)
type: anyone present
condition: this && east countside thislist == 1 && west countside thislist >= 1
on activation: binladen setcaptive true;binladen setcombatmode "blue"
then put a setpos loop on the trigger keeping it on binladen
#loop
trig1 setpos getpos binladen
~.5
goto "loop"
-
Hey the (player distance binladen) < 5 command works great. Thank you.
Is it possible to make it so this includes any member of my team?
Thanks for the help.
-
Is it possible to make it so this includes any member of my team?
Yes........just use:
(nameofmemberofteam distance binladen) < 5
Planck
-
I thought of that but not sure how to type it out....
If I put: (player1 distance binladen) < 5; (player2 distance binladen) < 5; (player3 distance binladen) < 5 .....etc.
Wouldn't that mean that all the players listed have to be within that distance?
How do I make it so it doesn't matter which player accually get to Osama first?
Thanks.
-
Try:
((player1 distance binladen) < 5) OR ((player2 distance binladen) < 5) OR ((player3 distance binladen) < 5) .....etc.
Planck
-
Hmm, that doesn't work...
For some reason when I put that condition to include all members of team it cancels out the damage condition (damage binladen) > .3 so when any member of team gets close to bin it fires trigger even though bin is not injured.
Also it wont eccept ((player1 distance binladen) < 5) .....I had to remove a couple (
Typed it as (player1 distance binladen) < 5
I can just make it so leader has to be the one to capture bin.
Thanks for the help.
-
just use what i said at the begining, by keeping a trigger on binladen
-
I don't really understand what your trigger does or how to set it up...
Where do I put:
#loop
trig1 setpos getpos binladen
~.5
goto "loop"
& does this make it so the trigger follows him?
-
that would be a script
you would exec in some unit init (for ex. binladen)
[] exec "triggerpos.sqs" or whatever you decide to name it, and put that in the script
yes it will keep the trigger on him
then you can group it to the group of people wo have to catch him, set it to any member, and then put in the other stuff you need for him to be set captive
you can add something like what i did earlier to make it so there can't be anyone on binladens side in the trigger as well.
basically the distance thing was simulating a trigger over him, but just making it harder to do