Author Topic: Question about "arguments" in SEXP's  (Read 1731 times)

0 Members and 1 Guest are viewing this topic.

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Question about "arguments" in SEXP's
Hi there,

I'm actually not sure if I should post this in the SCP or the campaign forum, but for the moment I think of it more as a code-problem than a problem with the SEXP's (of course, always to look by the others for the failure than by yourself :D ) However, it's a little complex and difficult to explain.

I'm having a problem with the arguments in the SEXP's. In a mission, I escort a capital ship through 4 navpoints. At each navpoints a few fighters or other stuff attacks, and my wingman are ordered to automatically attack them (which works fine)

My problem begins when the battle is over and I want them to get back into CLOSE formation again. At the very beginning, I arranged that by giving each wing it's own "clear goals" SEXP, followed by an "add goal" SEXP. First off, the "clear goals" is necessary, otherwise there was a good chance, that they don't accept the new order (for the same reason I explain below).

Now, a few of you elders around here asked me, why I'm not using the argument SEXP, so I could combine the three SEXP's into one. Well, it's logical and would save me some work, so I tried that and it looks like that :
Code: [Select]

op-when-argument
    op-every off
            alpha1
            beta1
            beta2
            charlie1
            charlie2
    op-true
  op-add goal
           argument
      op-ai-guard   (I also tried "stay near ship)
           (guarding ship)


The "op-true" with no condition is because I chained this SEXP with the previous one which is actually the trigger for this event.

Everytime before I use this SEXP, I have again a similar SEXP before it and clear the goals first, but still some fighters simply don't receive the new orders and continue cruising around having "no orders" (big post, but this underlined part is the core of it :) ). And that's actually a big problem, since it is breaking the autopilot-formation which look very stupid. It can happen that they then fly 5K klicks before you and reach the new navpoint before you do, so you can watch them flying circles in 32x time-compression :wtf:

However, I also noticed that error, when I made all 3 "add goal" conditions into one SEXP's. When I'm not using the clear goals thing before, it's even more worse and some of the conditionals will simply not being executed or accepted by the AI-Ships.

Now, the question is, is this a bug, and if yes, how to fix it ? If you think it's a bug too, I could mantis it and give some of you Coders access to our beta (a few of you already have it), since I think it will be the best when you try it with the missions we have.

As for the moment, my best solution is making 2 seperate SEXP's (clear goals and add goal) for each wing each time, which will result into 24 SEXP's, but at least it will work. And now that the FRED-SEXP limit has been bumped up, I think it's possible, but it's not really a solution for the future and a lot of work too

I hope I explained it understandable :) Any ideas ?

Starman©
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Question about "arguments" in SEXP's
What happens if you add a clear goals < argument > before the add-goal SEXP like this?

when-arguement
-true
-clear-goals
-add-goal

Try adding a message to that event to check if the event is actually being run and that the goals aren't coming from some other rogue event while you're at it (That's something I always do).

Can't see anything wrong with the SEXP as it is though.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Question about "arguments" in SEXP's
Quote
Originally posted by karajorma
What happens if you add a clear goals < argument > before the add-goal SEXP like this?


Has normally no effect, there are still random skips. In fact, I had the feeling that the errors appear more often when I have the clear goals in the same SEXP.

Quote

Try adding a message to that event to check if the event is actually being run and that the goals aren't coming from some other rogue event while you're at it (That's something I always do).


Maybe I explained it not good enough. As you see, I have set 5 ships in the event as argument, but usually 2-4 will get the new order, while one or two don't. So the action will be executed, but it will not reach every member of the argument.

Similar things happen when I use a SEXP and use the same contitional (i.e. add goal) four times or so, then 3 will be executed, and one not.

It's not really reproducable, but noticable :(
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Question about "arguments" in SEXP's
I got you. I was suggesting that you did something to check if the event was working at all.

Try making a new mission which only has the bug in it. IF you can reproduce the error in that then you know it isn't anything you're doing wrong.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Question about "arguments" in SEXP's
It's entirely possible there's a bug in the argument code, for example if it doesn't check all of the arguments for some reason.  (That would also explain the random-of bug.)  Not many people have used it yet. :)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Question about "arguments" in SEXP's
I keep trying to tell them that they should :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Question about "arguments" in SEXP's
This bites :mad:

I made up a test mission, just with the same wing-sheme than in the WCS Mission and played around with the argument SEXP.

Every fighter receives it's goal, but why isn't working with the same SEXP in the big missions ?

Could it be, that there are some problems when you give fighters to many goals ? Because of the nav-point based missions I have more than one mission area, and every fighter will receive 10 or more goals throughout the mission. But I even use clear goals to get rid of the old one, what else can I do ?

Guess it's down to the 24 additional SEXP's, isn't it ? :(
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Question about "arguments" in SEXP's
What happens if you give the fighters in the test mission initial orders and then clear them, then give them new ones.

Also check if the priority of those orders has an effect too.

This does seem like an odd bug though. Something has just come to me though. What happens if you replace the indivicual fighter names with their wing names in the full mission? I've seen cases where when you give the individual fighters in a wing they don't get them but when you give the wing orders they are recieved. (hmmmm. Maybe I should find that mission and report the bug too).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Question about "arguments" in SEXP's
Quote
Originally posted by karajorma
What happens if you give the fighters in the test mission initial orders and then clear them, then give them new ones.


This seems to have no effect either :(

Quote
Also check if the priority of those orders has an effect too.


I always use 89 as prioritiy. Never changed that in my modding time (because I'm not really seeing any sense in doing this :) )

Quote
This does seem like an odd bug though. Something has just come to me though. What happens if you replace the indivicual fighter names with their wing names in the full mission? I've seen cases where when you give the individual fighters in a wing they don't get them but when you give the wing orders they are recieved. (hmmmm. Maybe I should find that mission and report the bug too).


I tried that too. I also used only the wingnames in the argument, the effect stays the same. Random fighters won't receives their goals at random mission stages.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Question about "arguments" in SEXP's
Bloody odd. I suspect it's a bug but it's not as simple as just being a problem with the AI order SEXPs or when-argument so until you can isolate it I can't really think of anything you can try that you haven't already.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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