OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DarkCell on 23 Aug 2004, 17:06:45

Title: problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 17:06:45
well i made this map that Begins with a Scud launcher riding towards his base and there he gonna prepare the scud for launch after that The Scud will launch in 3 minutes and when you don't destroy it in 3 minutes Mission will be failed!

I don't have Problems with starting the scud and launching it but problem with Scud is not alive anymore!

When the scud is destroyed the mission still saying Failed after 3 minutes! ???

and the Mission was supposed to fail when the scud is launched!
and the scud cant be launched when the scud is dead!
 :-\


Can anyone tell me what I did wrong with it?
and how the Scud can be destroyed succesfull without letting the mission be failed in 3 minutes when scud is dead already!

I only want the mission to be failed in 3 mins when scud is alive and launches the scud.

Can someone Help me with it?  :)
Title: Re:problems with Scud Launch
Post by: macguba on 23 Aug 2004, 17:13:57
When the scud is destroyed you need to use a variable to "turn off" the mission failed ending.
Title: Re:problems with Scud Launch
Post by: Tyger on 23 Aug 2004, 17:19:30
Make two triggers, one has the min, mid and max set for 180 (3mins) and in the On Activation: timeOut = true

the second trigger has:
Condition: !(alive scud_1) and !(timeOut)
On Activation: "1" ObjStatus "Done"; player AddRating 1000; ForceEnd

and hav it set to End 1

P.S. To make the mission failed after 3 mins:
Condition: timeOut
On Activation: "1" ObjStatus "Failed"; player AddRating -10000000000; ForceEnd

and hav it set to End 2

Cheers :cheers:
Tyger
Title: Re:problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 17:23:22
but the mission has to continue when scud is destroyed so when I want mission to continue I leave the Forceend away?  ???
Title: Re:problems with Scud Launch
Post by: Tyger on 23 Aug 2004, 17:26:46
Oh, then tke out the End 1 and End 2 and the ForceEnds. :P
That should do it.
Title: Re:problems with Scud Launch
Post by: macguba on 23 Aug 2004, 17:52:22
Quote
the second trigger has:
Condition: !(alive scud_1) and !(timeOut)
On Activation: "1" ObjStatus "Done"; player AddRating 1000; ForceEnd

and hav it set to End 1

If you have it set to End1 you don't need the forceEnd command.      In any case forceEnd is for emergencies, you don't need it in the ordinary course of events.

You would need to initialise the variable timeOut somewhere or it won't work.     !alive is problematic with vehicles:  they can look destroyed when they are not.    I usually use:-

not canFire scud1 and not canMove scud1

Quote
one has the min, mid and max set for 180 (3mins) and in the On Activation: timeOut = true

 To make the mission failed after 3 mins:
Condition: timeOut
On Activation: "1" ObjStatus "Failed"; player AddRating -10000000000; ForceEnd

This will end the mission whether the scud has been destroyed or not.    ::)



What you need is something like this:-

Trigger1:-
Type:   End#2
Condition:     scudState scud1 >= 4
On activation:     "1" objStatus "failed"

Trigger2:-
Condition:   (scudState scud1 < 4) and (not canFire scud1)
On Activation:    "1" objStatus "done"

The timing of the scud firing should be controlled in the scud firing script/trigger.    

Syntax, etc. not guaranteed.  I haven't tested whether canFire works with scuds.

Title: Re:problems with Scud Launch
Post by: Tyger on 23 Aug 2004, 17:57:40
Quote
Quote:one has the min, mid and max set for 180 (3mins) and in the On Activation: timeOut = true

To make the mission failed after 3 mins:
Condition: timeOut
On Activation: "1" ObjStatus "Failed"; player AddRating -10000000000; ForceEnd

This will end the mission whether the scud has been destroyed or not.    

forgot to add the
Code: [Select]
&& alive scud ;D :P

about the End 1 command, sometimes the mission wont end for me if I have End 1 selected, so I use ForceEnd to back it up. But yeah, you dont need it. Put it there just outta habit i guess
Title: Re:problems with Scud Launch
Post by: macguba on 23 Aug 2004, 17:59:55
Quote
about the End 1 command, sometimes the mission wont end for me if I have End 1 selected

You've probably got a stray End1 trigger somewhere else in the mission.    I've had that a couple of times and it can be hard work sorting it out.    The end won't occur unless all End1 triggers are fired.
Title: Re:problems with Scud Launch
Post by: Tyger on 23 Aug 2004, 18:03:03
thats probably it. gotta make sure I dont do that then. even i learned something today!

cheers :cheers:
Tyger
Title: Re:problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 18:07:55
well you all can't fix the problem, The mission still fails wether the scud is been destroyed or not.  :(


Here is some info about all the triggers I use for this scud:


Trigger 1: Scud preparing for launch

activation: Vihicle
condition: this
on activation: scud1 action ["SCUD launch"]


Trigger 2 : Launches the scud (mission failed)

activation: vihicle
condition: this
on activation: scud1 action ["SCUD start"]


Trigger 3: Mission failed

type: end2
condition: scudState scud1 >= 4
on activation: "1" objStatus "failed"


Trigger 4: Mission Completed

condition: (scudState scud1 < 4) and (not canFire scud1)
on activation: "1" objStatus "done"





you people see what I did wrong????  ???

Title: Re:problems with Scud Launch
Post by: Tyger on 23 Aug 2004, 18:15:53
are you failing the mission immediatly, or after you've killed the scud?
Title: Re:problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 18:18:57
the missions fails after 3 mins when scud is launched

I put the timer in Trigger 2 , after 3 mins Trigger 2 get's activated and Scud is launched
But how can I let trigger 2 not activate when Scud is Destroyed??  ???
Title: Re:problems with Scud Launch
Post by: macguba on 23 Aug 2004, 18:29:01
This feels as if it might be an OFP bug:  if you order scud1 to fire, then the scudState records that whether or not scud1 is actually able to fire.    (Scuds were originally intended to be just for looks so you should always expect odd things like this when using them.)

Try:

Trigger 2
Condition:   this and alive scud1

Or:

Trigger3
Condition:  (scudState scud1 >= 4) and alive scud1

Or both, obviously.
Title: Re:problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 18:43:57
still no use the script just doesn't work :(


is there realy no way to DEACTIVATE trigger 2?

nobody knows a way to DEACTIVATE the timer on trigger 2??
Title: Re:problems with Scud Launch
Post by: macguba on 23 Aug 2004, 19:00:55
Quote
still no use the script just doesn't work

What do you mean?  What did you do?   What happened?    I've put some time and effort into trying to solve your problem and I'd appreciate a little feedback on how things went when you tried my last suggestion.    I suspect you have failed to follow it properly.

We can't help you unless you give us all the relevant information.    I know you're frustrated but throwing your toys out of the pram doesn't actually help.    Go and have a cup of tea and a chocolate biscuit and come back to this later.  ;)




Title: Re:problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 19:11:35
lol No I'm not that frustrated  :P

the only thing is this mission is almost complete and this is the only problem that is holding it up  :(

I know you people trying to help me maybe I am doing some noob thing or whatever :P

well this is what I changed to Trigger 2 and 3


Trigger 2 : Launches the scud (mission failed)

activation: vihicle
condition: this and alive scud1
on activation: scud1 action ["SCUD start"]


Trigger 3: Mission failed

type: end2
condition: (scudState scud1 >= 4) and alive scud1
on activation: "1" objStatus "failed"


I did 1 of the 2 things you said and I took them both at the same time

so I did 3 things but it still would'nt work

it's like Nothing can stop Trigger 2 from counting down  :-\





I grouped all the triggers to the scud is that good?
or chould some triggers not be grouped?



Title: Re:problems with Scud Launch
Post by: macguba on 23 Aug 2004, 20:36:53
The triggers should NOT be grouped to the scud.  Or anything else.   Why didn't you tell us that in your first post?   You MUST tell us what is going on.

I still don't understand what you have done.    What is "vihicle"?   Tell us more about what happens in the mission.

Does the scud launch?   When?

What happens after the scud launches?

What happens if you destroy the scud before it launches?

What happens if you destroy the scud after it launches?


There is no way to stop the countdown trigger from counting down.   However, that doesn't matter.   What matters is what happens when the countdown is complete.




Title: Re:problems with Scud Launch
Post by: DarkCell on 23 Aug 2004, 20:51:08
Vihicle = Vehicle I typed it wrong  


But the Scud launches when the time is up
and then the mission is failed offcourse and the mission ends Like supposed to be.

But when I destroy the scud the mission still will fail becease the triggers can't see that the scud is not alive anymore :-/
 
In effects I added the tekst : MISSION FAILED
when the scud launches and even when the scud is destroyed within the time it say's MISSION FAILED  :-\

in Trigger 4 I added effects to when scud is destroyed I added the tekst : GOOD JOB
but I don't see that tekst coming
So I guess Trigger 4 won't go off when scud is destroyed  ???


So you know what I mean?
something has to Detect that Scud is DEAD not alive anymore and stop trigger 2 from ending the game!
but it won't work   :'( :'( :'(
Title: Re:problems with Scud Launch
Post by: Planck on 23 Aug 2004, 21:09:17
Activation = Vehicle is wrong.

This is because you have the triggers grouped to the scud.

Otherwise you wouldn't get this.


Planck
Title: Re:problems with Scud Launch
Post by: Dagon on 24 Aug 2004, 05:59:59
I'm going to upload an example of how to do a SCUD mission... assuming  I can do one. That way, you can copy it for your own mission.
Title: Re:problems with Scud Launch
Post by: Dagon on 24 Aug 2004, 07:50:30
take this link:

www.freewebs.com/kroth/Scud%20Launch%20Countdown.zip

in the zip file is 2 forms of the SCUD trigger script - one is in a mission-like format, the other is just the plain SCUD script. Timer is set low on the plain one since it's mostly for testing. There's three triggers involved, but that shouldn't be much of a problem.

What triggers do:

One trigger will prepare the missile after 120 seconds.

One trigger will test that the missile is still alive before it fires (Note: This tends to be buggy at higher times. For this reason, I've set it to go off 10 seconds before the missile fires. Try to test it and find the closest you can get to 180 seconds and still have the missile go off - otherwise you might still lose the mission afterwards.

One trigger will fire the missile; assuming the aforementioned alive test is passed.

I'll leave the file hosted for a week or so.