Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Scripting requests

An area for discussing new ideas and additions to Oolite.

Moderators: another_commander, winston

JD
Deadly
Deadly
Posts: 182
Joined: Thu Nov 25, 2010 10:42 pm
Location: London, UK

Re: Scripting requests

Post by JD »

Hope this isn't a daft request. Would it be possible to add a property to ships etc that the game would use if the entity was destroyed, and would be inherited by the resulting explosion? The effect would be a kind of time accelleration (or rather decelleration) factor, causing the explosion to unfold at a slower rate than normal.

What I'm looking for is the ability to create an explosion that lasts longer, and looks more imposing thanks to its more ponderous progression, without weighing down the game's performance with a string of secondary explosions.
JD
Deadly
Deadly
Posts: 182
Joined: Thu Nov 25, 2010 10:42 pm
Location: London, UK

Re: Scripting requests

Post by JD »

OK, a bit of a resounding silence on that one, which I suppose answers my question. Not really a runner then?
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripting requests

Post by Wildeblood »

JD wrote:
Would it be possible to add a property to ships etc that the game would use if the entity was destroyed, and would be inherited by the resulting explosion? The effect would be a kind of time accelleration (or rather decelleration) factor, causing the explosion to unfold at a slower rate than normal.

What I'm looking for is the ability to create an explosion that lasts longer, and looks more imposing thanks to its more ponderous progression, without weighing down the game's performance with a string of secondary explosions.
From memory the normal explosion has only two parts: there are a few frames of the small explosion image displayed, then a larger explosion image for a few frames, and that's it. It doesn't progress smoothly, so the progression couldn't be slowed. (I could be very wrong about this.)
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripting requests

Post by Smivs »

JD wrote:
What I'm looking for is the ability to create an explosion that lasts longer, and looks more imposing thanks to its more ponderous progression, without weighing down the game's performance with a string of secondary explosions.
Providing appropriate testing is done, a cascade explosion need not adversely affect game performance. We found this while developing Xeptatl's Sword which features some of the most impressive explosions you'll see in Oolite. Some of these are three-stage cascades and are huge and last for some seconds.
My creaky old computer proved to be an excellent test-bed for these, and the end results should be fine on all but the weakest of computers, and are still spectacularly awesome.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16063
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Scripting requests

Post by Cody »

Smivs wrote:
... a cascade explosion need not adversely affect game performance. ... Xeptatl's Sword which features some of the most impressive explosions you'll see in Oolite.
Yeah, explosions like this - awesome stuff!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Scripting requests

Post by JensAyton »

Wildeblood wrote:
From memory the normal explosion has only two parts: there are a few frames of the small explosion image displayed, then a larger explosion image for a few frames, and that's it. It doesn't progress smoothly, so the progression couldn't be slowed. (I could be very wrong about this.)
Yes, you’re very wrong about that. :-)

An explosion consists of up to four elements (not counting debris): two particle systems, described as “fast sparks” and “slow clouds” in the code (both use the same “particle blur” texture as flashers), a “particle flash” (the same quasi-lens-flare texture as is used for laser impact points) and, for large explosions, a ring. All of these are smoothly animated (try it with TAF set to 1/16), but the “particle flash” texture won’t look good if it’s shown for more than a fraction of a second. As of 1.74 or so, the “sparks” and “clouds” are fully spacial 3D particle systems and quite lightweight.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripting requests

Post by Wildeblood »

Ahruman wrote:
Yes, you’re very wrong about that. :-)
Excellent news, thank you.
JD
Deadly
Deadly
Posts: 182
Joined: Thu Nov 25, 2010 10:42 pm
Location: London, UK

Re: Scripting requests

Post by JD »

OK, thanks everybody.
El Viejo wrote:
Yeah, explosions like this - awesome stuff!
Wow. Now if I could just make something like that last for a while I'd be sorted.
Smivs wrote:
... a cascade explosion need not adversely affect game performance. ... Xeptatl's Sword which features some of the most impressive explosions you'll see in Oolite.
I'll take a closer look at Xeptatl's Sword and see if I can take inspiration (or blatantly steal!).

Cheers.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripting requests

Post by Smivs »

This post might be of interest :wink:
Commander Smivs, the friendliest Gourd this side of Riedquat.
JD
Deadly
Deadly
Posts: 182
Joined: Thu Nov 25, 2010 10:42 pm
Location: London, UK

Re: Scripting requests

Post by JD »

Smivs wrote:
This post might be of interest :wink:
Thanks Smivs. The mechanism I currently have in place is pretty similar to what you've described there. I've had the impression that I maybe get a slight stutter sometimes when the explosions fire. That's only an occasional thing, but it's stopped me getting too ambitious in stretching out the effect as much as I'd like.

What I'm trying to do is generate a bit of solar activity around the rim of the sun. It works, and it can look ok, but it's a bit more underwhelming than I'd been hoping for. I'd really like to extend it for several more seconds at least. I'll maybe try a few more iterations of the explosions, but I'm not confident it won't turn into a cpu/gpu hog.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripting requests

Post by Smivs »

Ah, I see. I suppose the problem really is that suns are BIG, even Oolite suns. So to even be noticeable these effects would have to be enormous.
It's a nice idea, and I know many aspects of suns are often debated here so maybe a better solution will come along. :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re:

Post by Eric Walch »

Commander McLane wrote:
Following my trials and tribulations up to here, I'd like to know: Is there a good reason that the shipWasScooped and shipScoopedOther handlers do not fire if the scooped entity is an escape pod?
In 1.76 this has changed and shipScoopedOther fires for every pod that is scooped. There is just one limitation: You can't read the cargo that was actually scooped. You can only see the name of the pod. Also did this trigger before the pod was added to the cargo, so you couldn't see the cargo from the increase from the manifest also.

In trunk there are now two new ship properties: commodity and commodityAmount. I assume the names say enough. commodity returns the cargo as a string.

A special case is scripted cargo. Those pods enter the universe with undefined cargo. Undefined cargo returns the string "goods". On scooping time of a scripted pod, the pods shipScript runs. If it sets cargo for itself, the pod will be added as cargo to the hold as cargo. If not, the pod will end to exist after the script has ran. commodity will return null and commodityAmount will return 0
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripting requests

Post by Wildeblood »

Is it worth adding a .displayName2 to ships and switching between the two every two or three seconds, for things like Bounty Scanner and ship naming scripts to use instead of appending strings to the existing .displayName? Or would that cause more problems than it solves?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Scripting requests

Post by cim »

Wildeblood wrote:
Is it worth adding a .displayName2 to ships and switching between the two every two or three seconds, for things like Bounty Scanner and ship naming scripts to use instead of appending strings to the existing .displayName? Or would that cause more problems than it solves?
Someone would be bound to ask for a displayName3 if we went down that route. That suggests that it should really be an array, but changing displayName to be an array now would break too many existing OXPs. Still, there might be another way.

Is it just the name in the STE that you'd want changing this way, or would you want the switching to also occur in the comms log, etc.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2290
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Scripting requests

Post by Wildeblood »

cim wrote:
Wildeblood wrote:
Is it worth adding a .displayName2 to ships and switching between the two every two or three seconds, for things like Bounty Scanner and ship naming scripts to use instead of appending strings to the existing .displayName? Or would that cause more problems than it solves?
Someone would be bound to ask for a displayName3 if we went down that route. That suggests that it should really be an array, but changing displayName to be an array now would break too many existing OXPs. Still, there might be another way.

Is it just the name in the STE that you'd want changing this way, or would you want the switching to also occur in the comms log, etc.
Forget I mentioned it. Anyway, it's easy enough to do with a timer in the same OXPs that are messing about with .displayName, and easier to make the timing adjustable there. It's just something I've been meaning to ask about for months.

On an unrelated note, I have some (very, very simple, uncontroversial) code changes I'd like incorporated into trunk. Who can I send it to?
Post Reply