Ok, so I decided I was gonna try and write up some simple scripts for Black Wolf to Fred with. I thought I'd start with a simplistic gravity function to test with. Four and a half intensely frustrating hours later, I hadn't achieved a thing except crashes with increasingly cryptic errors.
Along the way I decided to try using a script WMC posted a long time ago here:
http://www.hard-light.net/forums/index.php/topic,39161.msg796489.html#msg796489 which was meant to just shift the radar along when 1 was pressed in game.
It didn't work at all in the latest build, so I thought I'd see if I could update it with new syntaxes based on the generated scripting.html. An hour or so later, I'd had to delete the FRED variable because of a weird "( near <eof>" error, rearrange the SEXP so it didn't need to return anything because that resulted in some sort of "userdata, expected number" error, add square brackets around the script-eval-num call because it didn't like it otherwise and rewrite the function because mn.getShipByName and ma.newVector no longer existed.
After all that the only thing that happened was a once per second tiny shift in the radar dish that crashed the game when the fenris exploded. :\
Giving up on that, I decided to try and adapt this...semi working.... script to just shift the player down whenever 1 was pressed
Ever more cryptic error after after cryptic error later, I'd chopped the script down to a barebones of:
#Global Hooks
$GameInit: [
Gravity = function()
theship = mn.Ships[0]
theship.Position = theship.Position + ba.createVector(0, -10, 0)
end
]
#End
Which just crashes as soon as you press 1 in game with this error:
LUA ERROR: attempt to call a string value
LUA Debug:
------------------------------------------------------------------
Name: (null)
Name of:
Function type: C
Defined on: -1
Upvalues: 0
Source: =[C]
Short source: [C]
Current line: -1
I still haven't a clue where in those 4 lines of code something is going wrong.
![:(](https://www.hard-light.net/forums/Smileys/HLP/frown.gif)