Author Topic: Setting AI classes, turrets, etc via sexp. When and effect on wings.  (Read 1511 times)

0 Members and 1 Guest are viewing this topic.

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Setting AI classes, turrets, etc via sexp. When and effect on wings.
I want to set up AI class and the ships loadout via event.  I know some sexps (beam-free for example) can't be used before a ship arrives.  Can things like turret-change-weapon and change-ai-class be called before ship arrival or do they have to be done after arrival?  If the ship is in a wing do these only change the current ship (Delta 1 for instance) or does it change the ship in all waves (Delta 1 7 13 etc).  Might need to use change-ship-class as well. 

Is there any way to tell what sexps can be used before a ship arrives and which ones can't?

No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Setting AI classes, turrets, etc via sexp. When and effect on wings.
It basically depends on how thorough the original programmer was. In most of these cases the programmer won't have bothered to make it possible to alter ships that haven't arrived yet.

One good rule of thumb is that any SEXP that does the same as a ship flag will work on ships that haven't arrived yet. There are other SEXPs that do work on ships that haven't arrived yet though (change-ship-class for instance works, but only cause I'd added a function for other reasons which made it easy to allow that behaviour).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Setting AI classes, turrets, etc via sexp. When and effect on wings.
What about the effect on ships in wings?  Is the carry over dependent on each sexp as well? 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Setting AI classes, turrets, etc via sexp. When and effect on wings.
Yes. Although off hand I can't think of any I can be certain work with wings. I'd have to look at the code.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Setting AI classes, turrets, etc via sexp. When and effect on wings.
Is there something in the code that stands out as to if it can be used prior to arrival and if it effects following waves?   
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras