Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Dark Hunter on November 18, 2006, 07:20:24 pm
-
#1. Why cannot an event be triggered true by an event that comes after it in the list? This seems ridiculous to me. See: what I'm trying to do is created an infinitely-looping chain of events, but my efforts to make the chain of events actually... loop have been defeated.
What I have right now:
Event 1
Event 2
|_when
|_or
|_ is-event-true-delay
|_Event 1
|_ is-event-true-delay
|_Event 4
Event 3
|_ when
|_is-event-true-delay
|_Event 2
Event 4
|_when
|_is-event-true-delay
|_Event 3
Suggestions?
#2. I've been trying to make a ship invisible to sensors at first but have it appear later. One of those "track down the disabled ship in the nebula" missions. So: I've tried having the opening event (which triggers true after 0 seconds have elapsed) use the ship-stealthy SEXP. Then I have a later event use the ship-unstealthy SEXP. Problem is: the initial ship-stealthy SEXP never triggers. This is surprising because the other stuff in the event triggers just fine. So, I try making the ship "Hidden from Sensors" via the Misc. button in the Ships Editor. Of course... the ship-unstealthy SEXP doesn't seem to work when a ship is hidden from the beginning. I'm wondering if I should just use the ship-create SEXP in conjunction with a couple of ship status-altering SEXP's to make it appear damaged. My question is: what's wrong with the cloak/decloak SEXP's?
-
1) You problem there would seem to be that event 2 has already become true for the rest (3 & 4) to trigger, thus it won't happen again when 4 becomes true. Events just aren't designed to be fashioned into loops, so it's gonna be difficult. I can't think of any easy way to do it actually, and i've never tried it myself so I can't give you a tried-and-tested solution either.
My best shot at how it might be done would be to not trigger the events based on a previous event becoming true, but by variables hitting a certain number. That way you could put a high repeat count on the events you want to loop and modify the variables to determine whether an event can trigger or not. I'm thinking something like this:
Event 1: Do stuff, set event2 variable to 1.
Event 2: Can trigger when event2 = 1. Does stuff, and sets event2 variable to 0 so it won't repeat, sets event3 variable to 1.
Event 3: Can trigger when event3 = 1. Does stuff, sets event3 to 0, sets event4 to 1.
Event 4: Can trigger when event4 = 1. Does stuff, sets even4 to 0, and finally sets event2 to 1 to let the whole loop repeat.
Could use every-time instead of a repeat count, but would need a safeguard against event 1 going off more than once. This might work, might not, but it's the best idea I've got at the moment.
2) Try using ship-invisible instead. When using a sexp to set it, also make sure that the ship is actually in the mission when the sexp triggers.
-
or Hunter, set the visibility setting under the nebula editor lower, and tell the ship that you're following to not stray too far away from you. Easier said than done, but you can figure it out. have you tried that trick I told you about?
-
:rolleyes:
Spartan, it's not visibility I'm worried about, it's the ship's radar signature.
@Shade: Alright, I'll try that. I know that looping event sets are possible because I can think of at least one that I've seen in a campaign...
This would be a whole lot easier if I just knew how to code that stupid music.tbl.....
-
The biggest problem I see is that all four events will evaluate to true in the first frame. I really can't see what you're trying to do here.
If any event is set to loop it will also trigger every repeat too. There's no way to break the chain of executions.
-
Hm, true. They would. No way it could work like I described... I blame posting at 3am for that little bit of idiocy :p Would need to have the variable evaluation paired with at least one more conditional using 'and', with the different events having mutually exclusive conditionals to keep it from looping every frame.
For example, event 2 could also require a ship to be within 100m of location A, and send it towards location B on execution. Event 3 needs it within 100m of location B and thus has to wait for it to get there before it can execute, etc. That should create a delay. And of course it could be anything and not necessarily a moving ship, as long as it will keep the events from going off immediately.
-
So what you're saying is that after triggering true, each event would also have to be triggered false before they repeated? I'm not sure that's... possible... :doubt:
-
is this what you're looking for?
loop.fs2 (http://www.mydatabus.com/public/tureyhall/z/loop.fs2)
-
So what you're saying is that after triggering true, each event would also have to be triggered false before they repeated? I'm not sure that's... possible... :doubt:
What we're saying is that the entire set of events is screwed up because they'll all instantly come true the second the mission started.
-
:rolleyes:
Spartan, it's not visibility I'm worried about, it's the ship's radar signature.
I know Hunter, that's what I was saying. If the ship's radar signature is unknown, and you have the visibility just right, and have the ship stay close to you, the radar should read it as a grey spec.