Author Topic: Slightly less random turrets  (Read 3577 times)

0 Members and 1 Guest are viewing this topic.

Offline Spicious

  • Master Chief John-158
  • 210
Slightly less random turrets
As you may have guessed from the title, I've made a few sexps to try to allow some better control over turrets. Turrets can be set to prioritise certain ships and subsystems on those ships. Have a play and/or try this demonstration I prepared earlier.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Slightly less random turrets
Can you post a diff of the code please? :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Slightly less random turrets

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Slightly less random turrets
Has anyone tried this?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Slightly less random turrets
On the list to try tonight actually. I mentioned it in a post earlier today. :)
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: Slightly less random turrets
Okay, had a look at the code and on the whole it seems fairly acceptable to me. I would however spin off the code for setting and copying the priorities into a function in ships.cpp if you can. First something like that really has no business being in SEXP.cpp anyway really and secondly if someone ever decides to make it possible to set priorities in FRED from the ship editor (and they should!) they'll need some way of doing what you're currently doing in the SEXP code anyway.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Slightly less random turrets
Fair enough. Have you got any preferences over the parameters? Otherwise I'll probably just go with subsystem and the appropriate target list.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Slightly less random turrets
Sounds good to me.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Slightly less random turrets
I've updated the files linked earlier.

Out of interest, would it be possible to nest subsystems within a ship in the sexp tree?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Slightly less random turrets
Not sure what you mean by that.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Flaser

  • 210
  • man/fish warsie
Re: Slightly less random turrets
I guess making a subsystem part of another...say, OSM thruster 1-1 is part of thruster 1 which is part of engine. The problem is how to carry on damage. So if you shoot the engine subsystem the thrusters are blown....or are they?
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Slightly less random turrets
That isn't just an issue with the SEXP tree though. You'd need to change the entire way the game handles subsystems to do it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Slightly less random turrets
Something like
Code: [Select]
+ship
--subsystem
--subsystem
...

rather than
Code: [Select]
-ship
-subsystem
-subsystem
...

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Slightly less random turrets
Not really. It would require that you make the ship name an operator of some sort which took subsystem arguments in order to do that.

BTW I've just noticed this but you might want to consider using OPF_SUBSYS_OR_GENERIC rather than OPF_SUBSYSTEM. The latter will cause a crash if you use the SEXP on a ship which changes class at any point before the SEXP is called (either through loadout or the change-ship-class SEXP).

It also gives you the <all turrets> subsystem which you might find useful to handle in your SEXPs. :)
« Last Edit: July 10, 2008, 02:05:28 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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