Author Topic: SEXPs and capship AI  (Read 3252 times)

0 Members and 1 Guest are viewing this topic.

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Hi there! Dear SCP gods. Do we have any of the following SEXPs? If not, please can I request them.

1. A string->number conversion SEXP.
2. A number->string conversion SEXP.
3. A string concatenate SEXP.
4. Background nebulae/star add/edit SEXPs (or a randomise background option in FRED mission specs) whichever is easier

Also, it would be nice to have a way of telling capships to attack any ship near them. Something akin to the chase-any AI behaviour of fighters. For those big Battle of Endor type moments when you have 10 capships per side and really don't want to script which ship attacks which.
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
You can do something similar to 4 with skyboxes and the when-argument/random-of SEXP. It's not really what you want though most likely cause after talking to CF and looking at Babylonian History X I think you'll be needing backgrounds rather than skyboxes.

As for the other 3 AFAIK they don't work (Although I've never actually tried assigning a number SEXP to a string and visa versa)

I've actually wanted a concatenation function for quite a while.

Can I suggest having the ability to cut a substring from a string variable too. With a concatenate and Substring function I could implement limited arrays in FRED which is something I've wanted to have for f**king ages.

Of course having SEXPs that actually implement arrays in FRED would be better :D
« Last Edit: September 29, 2005, 11:16:23 am by 340 »
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
Just checked. As I suspected FRED won't let you do 1 to 3. Editing in notepad might work but I very much doubt it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Quote
Originally posted by karajorma
Of course having SEXPs that actually implement arrays in FRED would be better :D


I was going to ask for arrays but I chickened out. I figured they probably wouldn't appreciate it and liken it to asking for geomodding or something. I don't think string <-> numeric conversion and a string concat are much to ask for though. How difficult can they be? (he says setting himself up nicely for a SCP god to stick the boot in)
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by IPAndrews
I was going to ask for arrays but I chickened out. I figured they probably wouldn't appreciate it and liken it to asking for geomodding or something.


It depends on how they're implemented. Making it so that arrays worked everywhere variables work might be very tricky (or it might be easy, I can see it going either way to be honest).
I'd imagine that implementing them as a completely new object which couldn't be used directly would be much simpler however. All you'd need to do would be implement the new object and then the mission designer could pull the data he wanted out of the array and plug it straight into a variable.

The problem lies in making sure that the game doesn't try to plug data in the form of a string into an integer variable. But even purely string and purely integer arrays would be useful (especially if we get the two int>>string and string>>int casting SEXPs you mentioned)

Of course this is for one dimentional arrays. Things probably get harder if we asked for multidimentional ones.


Quote
Originally posted by IPAndrews
I don't think string <-> numeric conversion and a string concat are much to ask for though. How difficult can they be? (he says setting himself up nicely for a SCP god to stick the boot in)


I agree it does seem easy. There may of course be something lying beneath the surface that makes it difficult of course but try as hard as might I can't think what could possibly prevent a concat SEXP from working.
« Last Edit: September 30, 2005, 07:28:30 am by 340 »
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
Actually arrays may be easier than any of the string stuff... :nervous:

You'd better repost your original SCP requests, karajorma, before I go off and revolutionize the sexp system again. :lol:

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Even the concat stuf? I can see parsing a string into an integer being a nightmare (Unless you simply make it do it and leave it up the FREDder to make sure he's not adding invalid data) but I would have thought concatenation wouldn't be too hard.
 I assume that means that arrays are easy ;)

If I'm drawing up a SEXP wishlist I'd rather have an implementation of proper collections than arrays. (Hmmmm I'll have to stick to Java terms cause I don't know the C++ ones. Hope they're similar enough that you can follow me :) ).
 Problem with arrays is that they can't grow and shrink as you add and remove data and that's pretty much a must for any implementation if it is going to be used by more than a handful of FREDders. No insult meant to my fellows but very few of use string variables or when-argument because they find them complicated. Dealing with errors cause by an array out of bounds is much harder. If the collection can grow dynamically that's gonna take care of about half the problems I've seen with them.  
 I'd like for it to be possible to access the collection as either LIFO, FIFO or by an index (preferably zeroth order as almost everyone who is ever going to touch a collection in FRED will almost certainly have some training as a programmer).

Sooner or later I'm going to want to do something like building a collection which contains a bunch of details something like this

[Ship Name, Hitpoints, pilots_callsign]

and then put several of those into a collection. I don't foresee myself needing any more multidimentionality than that although if it can be implemented at no cost I'd be the last to complain about the room to grow. What would be nice would be to be able to access say the hitpoints of ship 3 without having to first get and store the 3rd collection and then look up what the 2nd object is.

I'd need the collection to be able to return it's own size via a SEXP as it's a pain to keep track of it and could also be a big source of errors.

I'd want a player and campaign persistant version of this of course and when you get around to the team loadout changes I'd like the ability to use them there as well as variables.


Don't ask for much do I? :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Quote
Originally posted by Goober5000
Actually arrays may be easier than any of the string stuff... :nervous:

You'd better repost your original SCP requests, karajorma, before I go off and revolutionize the sexp system again. :lol:


It'd be nice if the SEXP system used floats instead of integers. :nervous:
-C

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
I think I know how to make a very small change to the SEXP system that will allow it to not only handle floats but arrays, vectors, and anything else you want to throw at it. :)

I'll have to finish my iff code and the other requests first though. ;)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by Goober5000
I think I know how to make a very small change to the SEXP system that will allow it to not only handle floats but arrays, vectors, and anything else you want to throw at it. :)


Great :) Look forwards to seeing it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Hey there SCP dudes. So we have background editting SEXPs now. How cools is that? Well it's very cool. I wonder though, has anyone taken an interest in looking at my other requests? Namesly string -> number, number -> string, and string concat? Goober, will your proposed change make these possible?

Also. How difficult is it to add font support to the subtitle sexp so I can display subtitles in a B5 appropriate font?
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.