Home   Help Search Login Register  

Author Topic: Scripting Conditions  (Read 444 times)

0 Members and 1 Guest are viewing this topic.

shadow99

  • Guest
Scripting Conditions
« on: 24 Jul 2004, 03:21:55 »
How do I ask for a condition in a script? In my exit.sqs file I basically want to ask 'not alive dude', and if so, go to outro1.

If he is alive, I want exit.sqs to go to outro2. How is this achieved?

Dubieman

  • Guest
Re:Scripting Conditions
« Reply #1 on: 24 Jul 2004, 04:02:11 »
?NOT ALIVE dude  or  ?not alive dude  or ?alive dude

But why do this from the exit.sqs?

Make the ending triggers different. Make one with the condition, this and ?not alive dude
and make it end2
 and another with just
this and ?alive dude
and goto end1


Actually I confused myself here....
Not sure but that way is kinda half asked.... and probably won't work. :-\ :-\ :P

j-man

  • Guest
Re:Scripting Conditions
« Reply #2 on: 24 Jul 2004, 04:05:05 »
exit.sqs
Code: [Select]
#check
?(!alive dude) : ACTIVATE OUTRO 1; exit

ACTIVATE OUTRO 2

exit

And replace "ACTIVATE OUTRO 1" and "ACTIVATE OUTRO 2" with something to activate the correct outro.

EDIT

Damn ou GRK, you beat me to it >:( :) And by 3 minutes :P
« Last Edit: 24 Jul 2004, 04:06:39 by j-man »

Dubieman

  • Guest
Re:Scripting Conditions
« Reply #3 on: 24 Jul 2004, 04:06:17 »
Never mind what I said then, that's better and mine is crap right now. ::) :P

EDIT:
me=speed + no quality
you = no speed +quality

Now who wins if OFP scripting here? You. ;D
« Last Edit: 24 Jul 2004, 04:07:43 by GuiltyRoachKilla »

shadow99

  • Guest
Re:Scripting Conditions
« Reply #4 on: 24 Jul 2004, 04:27:37 »
Thanks to both of you. You may have helped more than you think, Roach. I also just wanted to know how to have a condition in a script in general.

And thanks for the code j-man. Exactly what I wanted. :)

shadow99

  • Guest
Re:Scripting Conditions
« Reply #5 on: 24 Jul 2004, 04:52:43 »
Hang on... does Outro 1 and 2 activate depending on End#1 and End#2?

eg: If I make a trigger with type: End#1, does that mean the outro that activates will be Outro 1?

If not, then how do I activate an outro of my choice?

CopyrightPhilly

  • Guest
Re:Scripting Conditions
« Reply #6 on: 24 Jul 2004, 05:22:26 »
well what i would do is make a trigger and in its condidtion put

Code: [Select]
!alive unitname
replace unitname with the soldiers name

then in that triggers activation filed put somthing like
Code: [Select]
soldier1dead=true

Now I Dont Know If Outro is a scipt that your onabout or the end trigger so..
if its a trigger then...

now to your exit scipt
simple line
Code: [Select]
?soldier1dead=true: end1=true


now for your end trigger
on the end triggers condidtion filed put
Code: [Select]
end1


but if thats all your exit.sqs file dose then delete it and just put in the end triggers condidtion put
Code: [Select]
soldier1dead

Otherwise if outro is a script then

in your exit.sqs scipt
simple line
Code: [Select]
?soldier1dead=true: [] exec "outro.sqs"

Hope This Helps

Cheers, Philly
« Last Edit: 24 Jul 2004, 05:24:35 by CopyrightPhilly »

shadow99

  • Guest
Re:Scripting Conditions
« Reply #7 on: 24 Jul 2004, 05:26:39 »
Sorry to tell you after putting all that wokr in Philly, but no. You see, this 'soldier1' whom is in my case 'officer1', is your squad leader.

There are two ways of completing the mission, one with him dead and one with him alive.

If he is alive at the end of the mission, I want the game to go to 'Outro2'.

If he is dead, I want the game to go to 'Outro1'.

For the most part, I know how to do that. It's just ACTIVATING the actual correct Outro I have trouble doing.

Thanks anyway, man.
« Last Edit: 24 Jul 2004, 05:28:18 by shadow99 »

CopyrightPhilly

  • Guest
Re:Scripting Conditions
« Reply #8 on: 24 Jul 2004, 05:42:59 »
ok in the officers init or a init.sqs file put
Code: [Select]
officer1alive=0
now make a trigger and it its condition put
Code: [Select]
!alive officer1and in its activation put
Code: [Select]
officer1alive=1
now in your exit.sqs file put
Code: [Select]
?officer1alive==1:goto "outro2"
?officer1alive==0:goto "outro1"

shadow99

  • Guest
Re:Scripting Conditions
« Reply #9 on: 24 Jul 2004, 05:59:33 »
Thank you!