Author Topic: Disabling Turrets  (Read 3178 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
I'm writing a mission where I want something to happen once a certain number of turrets on a ship have been disabled. Only problem is that I can't think of any way to do it that doesn't involve a shed-load of SEXPs.

Am I having a brainfart or is there no easy way to have an event trigger after 5 turrets are dead?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Blaise Russel

  • Campaign King
  • 29
    • http://mysite.freeserve.com/sbre/index.html
I think you're stuck with either one event with all the different combinations of turret destruction under one or SEXP, or one event for each turret's destruction incrementing a variable by one and triggering the event that does stuff when the variable is equal to five. The former may be more SEXP intensive than the latter, I'm not entirely sure and it may depend on number of turrets.

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Only give the ship 5 turrets, and when they're all destroyed, it'll check with a ship-disabled thingamabob... Though, that doesn't really fit what you want though...
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline vyper

  • 210
  • The Sexy Scotsman
Sorry Kara I suspect you're stuck with something like Blaise said, perhaps something the SCP team could tackle if they're short of SEXP's to add some day ;)
"But you live, you learn.  Unless you die.  Then you're ****ed." - aldo14

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
I was thinking about this again and I had an idea. What would be really nice would be a logic SEXP similar to or.

Any x

Unlike the Boolean SEXP's  this one takes an arguement which is the number of SEXP nodes below it that must evaluate to true before Any x itself evaluates to true.

You'd use it like this

when
-Any x  
--2
--Is subsystem destroyed-delay
---Ship Name
---Subsystem Name
---Delay
--Is subsystem destroyed-delay
---Ship Name
---Subsystem Name
---Delay
--Is subsystem destroyed-delay
---Ship Name
---Subsystem Name
---Delay
--Is subsystem destroyed-delay
---Ship Name
---Subsystem Name
---Delay

This event will become true when two subsystems are destroyed. Change the number and you can make it come true from a different number of subsystems.

I've had a look at the or SEXP (which this is basically an alteration of ) and it doesn't look like it would be very hard to code this (the or SEXP is only about 30 lines) but unfortunately I'm a Java programmer not a C one so I'm not 100% what would need changing if I were to try and make my own SEXPs.  :D

I'll play about a little bit though but if someone like Goober wants to code this feel free to do it as it will probably be weeks before I even figure out how to compile the source let alone add my own stuff to it :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
I would not think much on the solution, I would use a variable and tons of events.
This may be because I am a complicated spirit.
« Last Edit: July 11, 2004, 11:09:00 am by 1079 »
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by TopAce
I would not think much on the solution, I would use a variable and a lots of events.


I tell you what. I'll send you the mission and YOU FRED that part then. Bear in mind I was giving a simplified example in the original post though :D What I'm actually after is even more complicated :D

There has been a couple of other times I've wanted something similar to the any x SEXP though.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline vyper

  • 210
  • The Sexy Scotsman
[q]it doesn't look like it would be very hard to code[/q]

Famous. Last. Words.

Whatever happened to the great SEXP thread anyway?
"But you live, you learn.  Unless you die.  Then you're ****ed." - aldo14

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
It's in the FAQ forum.
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline vyper

  • 210
  • The Sexy Scotsman
Kara, I posted about this in that sexp thread (linkin back here) because I'm actually quite interested in this being implemented. Hope you don't mind.
"But you live, you learn.  Unless you die.  Then you're ****ed." - aldo14

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
No problem :)
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!
Quote
Originally posted by Blaise Russel
I think you're stuck with either one event with all the different combinations of turret destruction under one or SEXP, or one event for each turret's destruction incrementing a variable by one and triggering the event that does stuff when the variable is equal to five. The former may be more SEXP intensive than the latter, I'm not entirely sure and it may depend on number of turrets.


The former will definitely be more sexp intensive, as you'd need one for each potential combination - and there'd probably be quite a few of those. This is the sort of situation the variable system was designed for...shame it's so buggy though.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
The variable system? Buggy? :wtf:
It has always been working OK to me.
If the SEXP you are talking about will be implemented, your job will become far easier.
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
I've had problems with it fairly regularly (I've posted in Mantis if you want details) for years - others have as well -  but the problems very, very random. You may just have not run into it yet.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
I've been noodling the idea of this kind of thing for a while... I think I even posted about it somewhere.  I can take a look, but it might take a while for me to get around to all these requests. :)

 

Offline magatsu1

  • 210
Quote
Originally posted by Black Wolf


The former will definitely be more sexp intensive, as you'd need one for each potential combination - and there'd probably be quite a few of those. This is the sort of situation the variable system was designed for...shame it's so buggy though.


my first question in these forums was about a vari. bug.

And that was copying the shipyard.complete sexps
Blitzerland: Knows what he's talkin' about