Author Topic: FRED help - Now there's a topic you don't see every day :)  (Read 1209 times)

0 Members and 1 Guest are viewing this topic.

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
FRED help - Now there's a topic you don't see every day :)
Not any more anyway.

Right. Here's the deal. I want a big-guns-in-front flag. But at the moment, It looks quite possible that I'm not going to get it any time soon. So I'm trying to fudge it in game with sexps. The desired result is this.

  • Ship A jumps in and begins attacking Ship B, moving towards it.
  • Ship A reaches a certain distance from Ship B (1000m) then turns around and heads the other way.
  • Ship A gets a certain distance away from Ship B (4000m) then turns around.
  • Rinse, Repeat.


Unfortunately, it's not as simple as all that, at least, when it comes to the Repeat section. My current sexp setup has this happening

The Apo (Ship A) arrives with initial orders to attack the GTCv Dignity (Ship B).

The first sexp checks for two things
 - Is the Apo Less than 1000m from the Dignity
 - is the Variable  (Interstingly enough, also called "Apo") equal to 0 (It's initial value)

It then clears the Apos goals, gives it new orders to head for a waypoint about 7000m away and sets the Apo variable to 1

The next sexp checks for three things.
 - Has the above event happened
 - What's the status of the Apo variable (ie. is it = to 1)
 - Has the Apo either reached its waypoint or gotten at least 3500m from the Dignity

If it all three return true, its orders are cleared, the variable is set back to 0 and the Apo is given orders to attack the Dignity.

Now, as far as I can tell, that should be an infinitely looping pair of sexps. As long as neither ship is destroyed or disabled or whatever, the conditions for being true will keep switching on and off, and the Apo should go in and out forever. But it doesn't. It'll go in on its initial orders, then out once and then back in, but after that it starts doing FS2s usual "Circle around the baddie until he's dead" routine, which, given its weapons configuration, is useless, and ends up killing the Apo, as well as the other two ships that should, in theory, be doing the same thing as it (with different waypoints of course).

So, can anyone see what I'm doing wrong and/or a way to fix it? My current theory is that sexps will only fire once, no matter how many times the conditions oscillate between true and false. Is this correct? If so, is my only option to just chain together a crapload of these sexps every time I need to make a mission using these ships (Which will be fairly common), or is there a way around it?

Oh, and please, don't suggest changing the table flags over to bomber AI. That would possibly solve this problem (I say possibly because I'm not sure how FS2 would react to a bomber with no primary or secondary slots), but would create others, since FS2 doesn't like bombers as big as this ship is, and will like it even less when I have to apply the technique to a much bigger ship that works on the same principles (ie. big guns in front).

EDIT - Doh - missed my 3000th post - ah well - w00t! 3020 posts!
« Last Edit: June 10, 2004, 10:18:28 am by 302 »
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: FRED help - Now there's a topic you don't see every day :)
Ah. A FRED problem.  What a nice birthday treat :) I think I'll try this one out in FRED myself :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: FRED help - Now there's a topic you don't see every day :)
Works now

I really should trust my gut instincts more often :D

From the first time I read this post I was rather disturbed by this bit

Quote
Originally posted by Black Wolf

The Apo (Ship A) arrives with initial orders to attack the GTCv Dignity (Ship B).

The first sexp checks for two things
 - Is the Apo Less than 1000m from the Dignity
 - is the Variable  (Interstingly enough, also called "Apo") equal to 0 (It's initial value)

It then clears the Apos goals, gives it new orders to head for a waypoint about 7000m away and sets the Apo variable to 1

The next sexp checks for three things.
 - Has the above event happened
 - What's the status of the Apo variable (ie. is it = to 1)
 - Has the Apo either reached its waypoint or gotten at least 3500m from the Dignity

If it all three return true, its orders are cleared, the variable is set back to 0 and the Apo is given orders to attack the Dignity.


The variable already gives you the ability to check whether the above event has occured or not so why are you also doing a is-event-true check? I thought about posting and saying you should remove it cause it's redundant but thought I was just being pedantic. After all what harm was it doing?

Turns out that that check is the cause of the problem. I can't explain it but either chaining or checking that the first event occurs causes the second event to fail. (BTW are you sure you wrote those two events down the right way around? When I tried this the apo just flew away and never came back rather than endlessly circling).

I suspect that this is an FS2_open bug/feature cause I'm surprised if it would have occured under FS2. What appears to be happening is that event 1 repeats before event 2 comes true. Since the apo is now far away enough event 1 evaluates to false which means that event 2 never fires.

Anyway just in case your problem was different I've included the mission file of my working version :)

Either way I think I've uncovered a serious trap for unwary FREDders using repeating events. :nervous:
« Last Edit: June 10, 2004, 04:25:54 pm by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
FRED help - Now there's a topic you don't see every day :)
Thinking about it, that does make a weird kind of sense - I really should have started by trimming off all the redundant stuff anyway. Ah well, it works and that's what counts. Thanks a crapload Kara :D
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED help - Now there's a topic you don't see every day :)
No problem BW. I actually enjoy solving FRED problems :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline JarC

  • 28
FRED help - Now there's a topic you don't see every day :)
;) happy b-day ;)
Use the WiKi Luke
See You @ WIGGY's

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED help - Now there's a topic you don't see every day :)
A little late but thanks :D

Reminds me. BW, did you mantis that variable problem you were having earlier?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
FRED help - Now there's a topic you don't see every day :)
No, I didn't, but now that HLP is back, and I can get the mantis link again, I will.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp