Home   Help Search Login Register  

Author Topic: The best way to mark objectives failed  (Read 899 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
The best way to mark objectives failed
« on: 29 Dec 2005, 23:31:54 »
hello,

What is the best way, at the end of the mission, to mark all the objectives the player didnt complete as failed.

Offline Morglor9

  • Members
  • *
Re:The best way to mark objectives failed
« Reply #1 on: 29 Dec 2005, 23:51:36 »
I usually work it this way. in the same line that i put:
Code: [Select]
"1" objStatus "Done"I also put in
Code: [Select]
(some unused variable)=true and do so for each objective. For instance, objective one might be o1, objective two o2, etc. make sure to set all the variables to false in init.sqs.

then, at the end of a mission, write a script that checks if the different variables are true. for any that are still false, have it do "#" objStatues "FAILED"

something like this:
Code: [Select]
?(o1=true) : goto objective2
"1" objStatus "FAILED"

#objective2
?(o2=true) : goto objective3
"2" objStatus "FAILED"

#objective3
...
etc, etc, etc.

Syntax not garunteed.
Cymbaline

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:The best way to mark objectives failed
« Reply #2 on: 30 Dec 2005, 02:09:54 »
ok, it works but I get an error for o6.


Code: [Select]
?(o1=true) : goto "objective2"
"1" objStatus "FAILED"

#objective2
?(o2=true) : goto "objective3"
"2" objStatus "FAILED"

#objective3
?(o3=true) : goto "objective4"
"3" objStatus "FAILED"

#objective4
?(o4=true) : goto "objective5"
"4" objStatus "FAILED"

#objective5
?(o5=true) : goto "objective6"
"5" objStatus "FAILED"

#objective6
?(o6=true) : goto "end"
"6" objStatus "FAILED"

#end
exit

Offline Morglor9

  • Members
  • *
Re:The best way to mark objectives failed
« Reply #3 on: 30 Dec 2005, 02:51:18 »
wow, my syntax was right and everything. just missed a couple of quotations.

What exactly is the error message?
« Last Edit: 30 Dec 2005, 02:53:01 by Morglor9 »
Cymbaline

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:The best way to mark objectives failed
« Reply #4 on: 30 Dec 2005, 03:13:16 »
Won't the script go to the end by it's self? Do you need the goto "end" bit?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Morglor9

  • Members
  • *
Re:The best way to mark objectives failed
« Reply #5 on: 30 Dec 2005, 04:07:20 »
yes, but if o6=true, the script needs to skip the "6" objStatus "FAILED" part, because that means that the player has completed objective six.
Cymbaline

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:The best way to mark objectives failed
« Reply #6 on: 30 Dec 2005, 04:14:53 »
? !o1 : "1" objStatus "FAILED"
..
..
..
..
? !o6 : "6" objStatus "FAILED"

exit

Maybe???


Planck
I know a little about a lot, and a lot about a little.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:The best way to mark objectives failed
« Reply #7 on: 30 Dec 2005, 21:44:48 »
well, everything is fine except for objective 6

It gives an error message with the

Quote
#objective6
?(o6|#=true) : goto "end"
"6" objStatus "FAILED"

I believe thats where it was
« Last Edit: 30 Dec 2005, 21:45:25 by penguinman »

Offline Pilot

  • Contributing Member
  • **
Re:The best way to mark objectives failed
« Reply #8 on: 30 Dec 2005, 22:05:51 »
All of the objectives have a problem.  They should by using two equal signs:

?(o6==true) : goto "end"

Or just do it the way Planck said.

-Pilot
« Last Edit: 30 Dec 2005, 22:06:37 by Pilot »

Offline Morglor9

  • Members
  • *
Re:The best way to mark objectives failed
« Reply #9 on: 31 Dec 2005, 00:55:23 »
really? two eqaul signs? i've always worked this kind of thing with only one. perhaps because it is asking if o6=true, it doesn't matter. besides, if that were the reason it should be screwing up objectives 1-5 too.

about the script, i really have no idea. maybe try this overly complicated jibberish:
Code: [Select]
#objective6
?(o6=true) : goto "finish"
"6" objStatus "FAILED"
exit

#finish
exit
I have no idea if that will do anything for you. since all the rest seems to work, i may suggest that you check carefully for any spelling or syntax errors in the last section of your script.
Cymbaline

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:The best way to mark objectives failed
« Reply #10 on: 31 Dec 2005, 01:05:31 »
When comparing values using if(?) you must use '=='.

The single '=' is used for assigning values, for example:

myvariable = 10

and for comparisons:

? myvariable == 10 : dosomething


Planck
I know a little about a lot, and a lot about a little.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:The best way to mark objectives failed
« Reply #11 on: 31 Dec 2005, 01:36:04 »
plancks method dosent give any error message, and also dosent mark any objectives to failed.

Pilots method gives me an error

Code: [Select]
(o6==true)|#: "6" objstatus "FAILED" error: type any expected number,somthing, somthing, somthing
and marks all to failed weather their completed or not

im a little suprised that nobody has made a script or anything for this, I thought it was kind of mission essential.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:The best way to mark objectives failed
« Reply #12 on: 31 Dec 2005, 01:53:39 »
ok, Ive found it!
the winning combo

Quote
?o1: goto "obj2"
"1" objstatus "FAILED"

#obj2
?o2: goto "obj3"
"2" objstatus "FAILED"

#obj3
?o3: goto "obj4"
"3" objstatus "FAILED"

#obj4
?o4: goto "obj5"
"4" objstatus "FAILED"

#obj5
?o5: goto "obj6"
"5" objstatus "FAILED"

#obj6
?o6 : exit
"6" objstatus "FAILED"

exit



Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:The best way to mark objectives failed
« Reply #13 on: 31 Dec 2005, 01:53:49 »
I don't think it is failing only on o6, I think it fails on all of them, but it only reports the last error which happens to be o6.

Try removing the line dealing with o6 and you will get the error for o5 instead.

Edit:  Good show.  :)
Perhaps my example above needed brackets.


Planck
« Last Edit: 31 Dec 2005, 01:58:44 by Planck »
I know a little about a lot, and a lot about a little.