Author Topic: Axem's Script & Lua SEXP Collection  (Read 2834 times)

0 Members and 1 Guest are viewing this topic.

Offline Axem

  • Administrator
  • 211
Re: Axem's Script & Lua SEXP Collection
Dunno what's up with that early targeting. I can't reproduce it and the script says it should be unstealthed when its warping in. For a third of a second I don't think it's worth it too much to dive into since it doesn't look like anything super obvious.

So I've committed some new lua sexps as well as updates to a few other scripts.

New:
Misc Functions: A variety of misc lua sexps that can aid a FREDder to do some neat stuff. Like forcing a target for the player, getting the player's target, reversing waypoints and other fun stuff.
Scroll Write: Add cheesy one character at a time subtitle reveals, complete with sound effects!
Waypoint Assist: A system to help guide the player through waypoints with a pointer object. FREDder can keep track of which waypoint the player is at or if waypoints are completed.

Updated:
Cloak: Forcing the cloak now works properly
In Mission Jump: For the AI, play dead orders now cleared after jumping, the ship-maneuver lasts shorter, which in conjunction with a now 2 second minimum transit time, allows the AI ship to slow down to zero before jumping back in without any odd orientation errors when the ship is pointing up on the y-axis. The player is not bound by these restrictions. (I hope this solves your issues with fighters jumping, Nightmare!)
Loading Screen: Added a scale zoom option so backgrounds will be intelligently scaled for the resolution being used. Intelligently scaled means no stretching or skewed aspect ratio. Portions of the background may be clipped to fit.
Prompt Box: When using repeating events, stuff can get screwed up because the last answer to a reference is always kept. So 'lua-clear-prompt' was added to clear the reference can be cleared.

 
Re: Axem's Script & Lua SEXP Collection
Quote
In Mission Jump: For the AI, play dead orders now cleared after jumping, the ship-maneuver lasts shorter, which in conjunction with a now 2 second minimum transit time, allows the AI ship to slow down to zero before jumping back in without any odd orientation errors when the ship is pointing up on the y-axis. The player is not bound by these restrictions. (I hope this solves your issues with fighters jumping, Nightmare!)

That works now, thanks! :nod:
However... there are some things that work (different):
-most importantly, when I have a ship jumping out with the player following a couple seconds later into subspace, the game now throws out a debug warning:
Code: [Select]
LUA ERROR: [string "imjump-sct.tbm - On Game Init"]:81: attempt to index local 'entry' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
------------------------------------------------------------------


------------------------------------------------------------------

stack traceback:
[C]: ?
[string "imjump-sct.tbm - On Game Init"]:81: in function 'Monitor'
[string "imjump-sct.tbm - On Frame"]:265: in main chunk
------------------------------------------------------------------

------------------------------------------------------------------

Aside the debug warning, it does not seem to have any other negative side effects. I compared it with the old script; the error only occurs with the new version. To make sure it isn't the result of some other broken script in my mod I tested it with WoD - it worked fine with the original, but again errors with the new one.

-Probably a minor thing: since the player won't move anymore inside of the subspace tunnel, the warp just forms in front of the player without moving towards it.
-Just an idea: maybe run the set-motion-debris-override SEXP when the player is inside the tunnel?


Regarding the Scroll Write script: it's a super neat thing, but could you add some documentation (and a sample) for showing the fiction files with lua-scroll-write-file? In my cluelessness I tried to feed it with the next best fiction file I had and it crashed immediatly... :(

 

Offline Axem

  • Administrator
  • 211
Re: Axem's Script & Lua SEXP Collection
Kay, I think I fixed the issues.

Not sure why that entry is nil error started popping up. It might have to do with how the player and AIs now will be forced to do things a little differently. I just did a simple check to see if the entry is valid or not. 99% of the time that solves the issue, but if it looks like something weird is happening let me know. I also made the player continue on the ship-maneuver thing for longer so you should hit the warp portal.

The scroll write file thing I also fixed (and added an example mission and fiction file). There is no special syntax or format. Just any text file will work. I hadn't actually tested it recently. I wrote the script over a year ago and it worked then, but since then the file handling with lua has gotten stricter and the script did not keep up. My bad on that one. :blah: (I did test it so it's all good now!)

 
Re: Axem's Script & Lua SEXP Collection
Beautiful work you did there! :) :yes: