FreeSpace Releases > Scripting Releases

Axem's Script & Lua SEXP Collection

<< < (2/8) > >>

Axem:
Just added a new script, an Extended Loading Screen script!


--- Quote ---This script will allow the modder to more finely customize mission loading screens. Added features include customizeable loading bars, randomized loading images, ability to automatically draw the mission's title, and random text (for tips or lore, as well as associated images). Care must be taken with the placement of the loading bar, random text and images, since they will not scale with the game's resolution (however, the background does have the ability to scale). This script only overrides missions that are inside the loading screen table. (A nightly after July 23, 2018 is needed to use this script)
--- End quote ---

The best part about this script is you can now use loading screens of any resolution, and they'll look great!




This is also the first script to use the brand new tbl parser now available to lua scripting, no more needing to use JSON for the config files now!

Nightmare:
I have a feature request on behalf of the INF team, which also goes as bug report: Using the In-mission jump script for capital ships is... troublesome. The warp-in part and damage application is fine; but while jumping out the ship (a corvette) reaches only 3 m/s, and during the part where it is supposed to be in subspace it produces a clearly visible warp in the distance. Could you do something about it?

Axem:
The in mission jump script is only meant for fighters, not capital ships. Cap ships should use the techniques that I have here in my tutorial about in mission jumps.

Why doesn't the script work with capital ships? Because the script solves a problem that's more unique to fighters. The methods to do it with a capital ship are quite simple without any scripts. You tell the ship to warp out, copy the damage to the new unarrived ship, and cue the new ship to arrive. It's 3 small things and we're done.

What do I need to do for my wingmen or the player? I can't tell any of them to depart. For the player the mission would end, and for the wingmen; the wingman gauge is now going to be incorrect. (And the comm menu isn't going to work right if I cue in some fake Alpha wingmen) So I need to fake the warp. This means telling all ships to play dead for a bit and cut to 1/3 throttle (thats why the corvette is going so slow), figuring out where to place warp portals, stash the ships somewhere far for transit time, then make a new warp portal, place the ships at the portals*, and restore the AI. The script automates all of that because I was super tired of doing that.

* Actually the scripting system has a :warpin() function that basically makes the ship redo its warp in effect which is why capital ships would redo that part correctly. But there's no simple way to make them "fake depart". I mean I coooould, but I think the way the game could do it now is good enough.

Nightmare:
Well my understanding of LUA is near 0, but I know how to help myself with SEXPs, so here's a part of the solution I was thinking of (I did this when I actually ran into the fighter issue, with comm menu and wingmates being depicted as departed by the HUD):

   ( set-object-position
      "Alpha 2#Replacement"
      ( get-object-x "Alpha 2" )
      ( get-object-y "Alpha 2" )
      ( get-object-z "Alpha 2" )
   )
   ( set-object-position
      "Alpha 3#Replacement"
      ( get-object-x "Alpha 3" )
      ( get-object-y "Alpha 3" )
      ( get-object-z "Alpha 3" )
   )
   ( set-object-orientation
      "Alpha 2#Replacement"
      ( get-object-pitch "Alpha 2" )
      ( get-object-bank "Alpha 2" )
      ( get-object-heading "Alpha 2" )
   )
   ( set-object-orientation
      "Alpha 3#Replacement"
      ( get-object-pitch "Alpha 3" )
      ( get-object-bank "Alpha 3" )
      ( get-object-heading "Alpha 3" )
   )
   ( set-object-position
      "Alpha 2"
      70000
      70000
      70000
   )
   ( set-object-position
      "Alpha 3"
      70000
      70000
      70000
   )
   ( add-goal
      "Alpha 2#Replacement"
      ( ai-warp-out 89 )
   )
   ( add-goal
      "Alpha 3#Replacement"
      ( ai-warp-out 89 )
   )
   ( friendly-stealth-invisible
      "Alpha 2"
      "Alpha 3"
   )
   ( ship-stealthy "Alpha 2" "Alpha 3" )

3 things remain that are not included in this:
-the ship that jumps out as decoy has to be created first (like ship create, which would take the place of set-object-position and set-object-orientation)
-the decoy needs to receive proper speed (i.e. taking over the values of the actual ship) - this could be done via ship-maneuver.
-the visible warp could simply be fixed by sending the ship 1000km away. That's not a problem EXCEPT for the player ship, which then self destructs in such cases.

Also, this script has the advantage that you can easily define the position and vector where a ship is supposed to re-arrive through waypoints, something that is elseway only possible through using an invisible blip, having it face away from the target, and than spetting the ship#2's arrival parameters to "in front of", what is mildly said not user-friendly.

The way it works for fighters is fine for me, though.

Nightmare:
It's not like I wouldn't value the script as it is. Think about the way "it's so useful, I want more of that ;7 ". :) Sure I have my own ideas about it - like that one could add a "proper" event as cue for the ships' re-arrival (like you can with normal ships) instead of a fixed delay and specify "no arrival warp" as flag, so you could set up an event like "Stage 2 Start", on which all ships from Stage 1 re-appear. Some directly at the beginnig without warp, some arrive a couple moments later with warp; while in the meantime all ships that weren't present in Stage 1 arrive due to having this Event as arrival condition.

But that's all out of my formal INF request, and just my thoughts of what I think what could be a useful feature - but perhabs somebody reads and does actually make it reality. Who knows. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version