Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: northtwilight on February 21, 2006, 11:04:35 am

Title: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 21, 2006, 11:04:35 am
Hi all,

Lua scripting has been removed from the latest CVS release (as of 31 Jan, from http://fs2source.warpcore.org/cgi-bin/cvsweb/cvsweb.cgi/fs2_open/configure.ac?f=h).

So I decided to drop the old version of configure.ac , 1.26, back in place.

Here are the lines dealing with Lua code from configure.ac:

---
AC_ARG_ENABLE(lua,
   AC_HELP_STRING([--disable-lua],
      [Disable Lua scripting support]),
      [fs2_lua=$enableval],
      [fs2_lua=yes],
---

&

---

if test "$fs2_lua" = "yes" ; then
   AC_DEFINE([USE_LUA])
   FS2_CXXFLAGS="$FS2_CXXFLAGS -I../lua"
fi

---

However, after I clean the folder of previous builds, run make and install the binary, the modifications I've loaded into the file

     data/tables/scripting.tbl   (as per http://www.hard-light.net/wiki/index.php/FS2_Open_Lua_Scripting#Quick.2C_a_full_example.21 )

do not ever load.

Quote:
By this point, you may be bored of all this exposition. So here's your typical "Hello, World!" example.

For this amazing trick, we'll make our very own splash screen. Turn off all Freespace 2 mods, and create a file called "scripting.tbl" in your data/tables directory. Open that up in a text editor, and write:


#Global Hooks
$Splash:   [
   --Set the color to white
   Graphics.setColor(255, 255, 255)
   --Write "Hello, world!"
   Graphics.drawString("Hello, world!", 5, 10)
]
+Override: YES
#End

Now, when you start up FS2_Open, you should see "Hello, world!" in the upper-left, as it loads.
End quote


I've also been playing around with other settings, and discovered through trial and error that the one core component required for the Linux binary to run is root_fs2.vp (I've moved the mediaVPs, original and 3.6.8 series, to their own folders, then symlinked them back to the data folder) ---


... then discovered to my shock that the root_fs2.vp file is just a huge set of plaintext tables.




....

So:

Why might the Linux binaries not run Lua-scripted files ?     



And, if this is not changeable, should I modify a mediaVP file [I really, really, really hope not] ?


Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: taylor on February 21, 2006, 12:24:01 pm
Lua support wasn't removed, it's just no longer an option.  It will always be enabled from now on.   That "Hello, World!" test doesn't display any text for me either, but it does appear to run as a script.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 21, 2006, 03:42:07 pm
Don't know what happened to the reply I thought I had typed a few hours ago ... but anyway:


Ooo! That makes me quite chuffed indeed. Thanks as always, boss!

Cheers
Mass

[edit] will have a look tonight. I'm a bit perplexed by one thing you mentioned, though. If the sample text won't display, how can I test script fragments and know whether or not they work? More editing to follow if needed [/edit] 
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: taylor on February 21, 2006, 04:21:41 pm
Actually I'm not sure why the sample didn't work either.  Hopefully WMCoolmon will pop in here and give an educated opinion.  I still have one of the scripted mainhalls and it works, but the "Hello, World!" did nothing for me except prevent display of the normal splash screen.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 21, 2006, 06:27:56 pm
:) He's gonna resent the hell out of me for asking. A few days ago he put up a call for scripters (http://www.game-warden.com/forum/showthread.php?t=1674) over at GW's BSG mod, and he stated that we should be able to figure basic things out without hassling him about it. Which is of course a fair restriction.

He goes on to state that if there is a genuine issue with the documentation or the scripting part of fs2_open that msgs are OK, but I'll wait for a spell before mentioning it to him directly as I'm not sure if it's a Linux thing or a 'MyInstallTM' issue. But the fact that you cannot see it either could mean it's the former.

thanks for listening
Mass

[edit] It must be said, I am really enjoying playing FS2 Open on the retail build. What a game.
 
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: WMCoolmon on February 22, 2006, 03:41:59 am
It definitely looks like it's a code problem, but I'm not quite sure what it is. Try using a call to drawImage() in place of drawString; it may be that the font graphic hasn't been loaded yet. I don't really have the time to trace that out right now, though; sorry.

If that doesn't work, a last-ditch thing is to try throwing in a call to clearScreen(), I don't see a gr_clear() call in the function.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 22, 2006, 08:42:11 am
OK. As ever, will have to check this tonight. Thanks man!!


Cheers
Mass

Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 22, 2006, 09:09:20 pm
In the interest of documenting the error:

Well, it almost worked. Adding Graphics.drawImage("text", yyy, zzz) in place of Graphics.drawString results in allocation of memory errors. The game doesn't boot.

Adding Graphics.clearScreen() at the start of the function, and retaining Graphics.drawString :  does nothing, but the game loads as before (no screen, then straight to pilot selection).  drawImage or no, the game works, but does not splash.

Putting clearScreen after setColor, and then drawString :   makes no change, the game still boots without splash.  drawImage makes no difference.


I'll try to have a look through the language implementation on FS2. Cheers, M

Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: WMCoolmon on February 23, 2006, 01:26:33 am
drawImage does exactly what it says it does, so you'll have to specify an image for the first parameter rather than just text. ;)

I'll do a more in-depth check of this tomorrow or Friday, whenever I have time.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 23, 2006, 09:12:20 am
drawImage does exactly what it says it does, so you'll have to specify an image for the first parameter rather than just text. ;)

/me feels sheepishly dumb  :wtf: 
   Guess there might be a nude pic of Tricia Helfer I could stick in there somewhere ... :)

I'll do a more in-depth check of this tomorrow or Friday, whenever I have time.

Thanks boss, very much appreciated.  Cheers, Mass
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: WMCoolmon on February 23, 2006, 10:32:06 pm
Turns out that it was, indeed, that the fonts weren't getting loaded before the splash screen. I swapped it around so that fonts are loaded right before the splash screen, I doubt this will add much noticeable delay before the splash screens.

taylor:
Although I did wonder if it would be possible to move the gr_font_init function into the if(!is_standalone) control, or if that would be more trouble than its worth.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 24, 2006, 03:53:00 pm
Thanks WMC. As it happens I wasn't able to look at it yesterday, and it may well be that I won't get a chance to look at it at all this weekend (work is beyond insane atm). But I appreciate it nonetheless.

Does it look something like this?

   #Global Hooks
   $GameInit: [Graphics.clearScreen()]

   $Splash:   [etc]

   #End

Cheers,
Mass
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: WMCoolmon on February 25, 2006, 12:51:13 am
Well just:
Code: [Select]
$Splash: [Graphics.clearScreen(255, 0, 0)]
+Override: YES

should clear the screen to red in any of the recent builds (You'd see red before the pilot select screen), because it doesn't matter that the text isn't loaded.

Edit: Ugh. WinCVS really needs to embrace the concept of dialog boxes. Apparently freespace.cpp didn't get committed, so the font fix didn't go in. I re-committed and this time it worked, so check the next CVS build. :sigh: It should work with the wiki example.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on February 26, 2006, 06:31:54 pm
Thank you again, I do value you taking the time out to walk me through like this. As luck would have it, the latest set of nvidia drivers appear to be slightly broken so I'm having to debug that asap (right after this post). I'll update local CVS again as soon as I'm back up (Win for work atm).

I will try to keep traffic here to a minimum, in any event. Cheers!


Kind regards,
Mass
Title: Re: DCQ 7: scripting works! but mv_core.vp has a buggy table
Post by: northtwilight on February 28, 2006, 10:08:56 pm
Hey, Lua works (does a  little dance) !!

 ;)

However, I'm now getting mv_turretangle-shp.tbm errors:

cyclone@toque:~/BSG-BTRL/SCP$ ./FSORCVS-20060227
ERROR: "mv_turretangle-shp.tbm(line 7: Error: Missing required token: [+delay:]. Found [+relative_angle:                        90,180,0]  in ship: GTB Medusa instead." at parse/parselo.cpp:629


(These are some of the modifications for the BSG turrets? Cool!)

Through substituting some of the symlinks back and forth I've found this table lives in mv_core.vp. I've looked through Karajorma's FAQ again and found Polonius, but suffer from the same unicode problem mentioned in Polonius' thread.

Thanks anyway!
Mass

Title: Re: DCQ 7: scripting works! but mv_core.vp has a buggy table
Post by: taylor on February 28, 2006, 10:59:54 pm
However, I'm now getting mv_turretangle-shp.tbm errors:
Just refresh your CVS update, it was fixed a day or so ago.
Title: Re: DCQ 7: scripting works! but mv_core.vp has a buggy table
Post by: WMCoolmon on March 01, 2006, 01:41:15 am
However, I'm now getting mv_turretangle-shp.tbm errors:
Just refresh your CVS update, it was fixed a day or so ago.

Or check out my post at the bottom of this page (http://www.hard-light.net/forums/index.php/topic,37272.200.html), it has the fixed version.
Title: Re: DCQ 7: scripting removed from latest release - how to re-install?
Post by: northtwilight on March 01, 2006, 09:14:35 am
Dudes,

You guys completely rock. Thanks again!!

Cheers!
Mass