Home   Help Search Login Register  

Author Topic: Mission Problem  (Read 1171 times)

0 Members and 1 Guest are viewing this topic.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Mission Problem
« on: 31 Oct 2011, 22:26:03 »
Hi guys

I'm making a new mission but I've got problems wit it.

Objectives.

Destroy two shilkas, save a files on a USB and get out of there.

On Editor:

I've put two shilkas with name Zsu1 and Zsu2, and Computer with name Pc1. I wanted different ends (I did them)

Ends:

1. If the player didn't destroy anything
2. If the player destroyed a shilka but he doesnt save the file
3 If the player destroyed two shilkas but no file saved
4. If the player just saved the file.
5. If the player destroyed a shilka and saved the file on the USB
6. If the player did all objectives (counting two shilkas)

Well my problem is the the end #2 it always appear, other ends don't appear. I made those scripts for my mission I want to know what it's wrong.

1 Script: This script is to do the 2 objective "The file". If the player is near pc, he will get a action. this is paremeter---> On activation player addAction ["Conect USB" , "drive.sq"] Now the script


player removeaction 0


Code: [Select]
"2" obJstatus "done"
player AddRating 7000

poplachno = false
Poplach = true

Ah I forgot it: In a init.sqs file I put that : poplachno = true and Poplach = false. Well let's continue.

Well I don't put a trigger for the shilkas but wit the next script, the objective one can active.

I put a trigger with these paremeters:

Active by player ;
 type : Switch ;
condition: Player in thislist
On activation : [] exec "checkout.sqs"

Well this is fucker script who I cannot fix, I don't know what it's wrong. Check out.

Code: [Select]
_a = Zsu1
_b = Zsu2

#Check

if (Alive _a or Alive _b  && poplachno) then {goto "anything"}
if (not alive _a or not alive _b && poplachno) then {goto "AShilka"}
if (not alive _b && not alive _a && poplachno) then {goto "TwoShilka"}
if (poplach && alive _a && alive _b) then {goto "JustPc"}
if (not alive _b && not alive _a && poplach) then {goto "All"}
if (not alive _a or not alive _b && poplach) then {goto "Twoobjectives"}
goto "Check"

#AShilka

"1" objStatus "done"
"2" objStatus "failed"
"3" objStatus "done"

Fnu = true

goto "Exit"

#Anything

"1" objStatus "failed"
"2" objStatus "failed"
"3" objStatus "done"

Fnf = true

goto "Exit"

#TwoShilka

"1" objStatus "done"
"2" objStatus "failed"
"3" objStatus "done"

Fnd = true

goto "Exit"

#JustPc

"2" objStatus "done"
"1" objStatus "failed"
"3" objStatus "done"

Fnt = true

goto "Exit"

#All

"1" objStatus "done"
"2" objStatus "done"
"3" objStatus "done"

Fnc = true

goto "Exit"

#Twoobjectives

"1" objStatus "done"
"2" objStatus "done"
"3" objStatus "done"

Fns = true


#Exit

Exit

To finish I also put 6 ends

End #1 is actived by Fnu
End #2 is actived by Fnd
End #3 is actived by Fnt
End #4 is actived by Fnc
End #5 is actived by Fnf
End #6 is actived by Fns

That's all, please help me, If you can't understand those scripts tell me and I'll send my mission.

Cheers,
Aldo15
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Walter_E_Kurtz

  • Guest
Re: Mission Problem
« Reply #1 on: 31 Oct 2011, 23:00:44 »
You need more brackets to better define your conditions. If you write "A or B and C", do you mean:
      "(A or B) and C"      which needs A and C in order to become true
OR  "A or (B and C)"      which becomes true with just A

Quote
if ((Alive _a && Alive _b) && poplachno) then {goto "anything"}
if ((not alive _a && not alive _b) && poplachno) then {goto "TwoShilka"}
if ((not alive _a or not alive _b) && poplachno) then {goto "AShilka"}
if ((alive _a && alive _b) && poplach) then {goto "JustPc"}
if ((not alive _a && not alive _b) && poplach) then {goto "All"}
if ((not alive _a or not alive _b) && poplach) then {goto "Twoobjectives"}

Edit: also moved the TwoShilka line ahead of AShilka - checks for both conditions (&&) should be done before those for either condition (or).
« Last Edit: 01 Nov 2011, 00:28:31 by Walter_E_Kurtz »

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: Mission Problem
« Reply #2 on: 03 Nov 2011, 20:56:43 »
Thanks WEK. Now it's work fine...  :good:
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom