Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: WMCoolmon on January 20, 2006, 03:01:02 pm

Title: Ship viewer
Post by: WMCoolmon on January 20, 2006, 03:01:02 pm
Originally written for redmeance, to get shots of ships for the wiki. :)

http://fs2source.warpcore.org/temp/scripting.tbl

Requires very latest CVS, I caught a bug and updated renderTechModel to be better. Clicking (and holding) anywhere on the screen with any of the three mouse keys will change that particular rotation axis. There are also a few hotspots.

Very upper-left: Changes to next ship (Starting ship is Ulysses)
Very lower-left: Quits
Very upper-right: Zooms in
Very lower-right: Zooms out
Title: Re: Ship viewer
Post by: WMCoolmon on January 31, 2006, 01:20:42 am
Hmm, did this not work, or did everyone just take one look and go back to the lab? :p
Title: Re: Ship viewer
Post by: Wanderer on January 31, 2006, 02:06:03 am
Well the table missed #End line and after the addition it gives an error report if you try to exit the viewer (keeping left mouse button pressed while moving the cursor to lower left corner)...
Code: [Select]
LUA ERROR: [string "GS_STATE_INITIAL_PLAYER_SELECT"]:68: attempt to call global `setState' (a nil value)

LUA Debug:
------------------------------------------------------------------
Name: setState
Name of: global
Function type: C
Defined on: -1
Upvalues: 0

Source: =[C]
Short source: [C]
Current line: -1

And am i also supposed to be able to take screenies with this (didnt get any :()?
Title: Re: Ship viewer
Post by: WMCoolmon on January 31, 2006, 02:26:23 am
Possibly, they may just go in the clipboard tho.

That function should be "ba.setState"
Title: Re: Ship viewer
Post by: Wanderer on January 31, 2006, 03:05:09 am
hmm.. correct or the one that worked was 'ba.setEvent'... and yeah screenies work too.. via clipboard.. but as there is no way of controlling the lighting it is pretty hard to use this ship viewer properly...

(http://koti.mbnet.fi/vekkup/FS2/Pics/Common/Image3.jpg)
Title: Re: Ship viewer
Post by: starfox on January 31, 2006, 03:05:46 am
I'm geeting following error message

Error: scripting.tbl(line 95:
Error: Required token = [#End], found [53, "Primary friendly hits:"] .

File:\fs2_open\code\parse\parselo.cpp
Line: 618
[This filename points to the location of a file on the computer that built this executable]

Call stack:
------------------------------------------------------------------
------------------------------------------------------------------

Something I missed ?
Title: Re: Ship viewer
Post by: Wanderer on January 31, 2006, 03:08:23 am
Add #End to the end of the scripting.tbl.. and also change setState to ba.setEvent

EDIT: Or atleast that worked for me...
Title: Re: Ship viewer
Post by: starfox on January 31, 2006, 03:15:06 am
OK, now I'm getting the following oddity....

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
------------------------------------------------------------------

LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
Title: Re: Ship viewer
Post by: WMCoolmon on January 31, 2006, 11:40:36 am
That generally means that a function name used in scripting is invalid (Due to a typo, or a build not supporting it). Try a newer CVS build...current CVS works for me.
Title: Re: Ship viewer
Post by: starfox on January 31, 2006, 12:32:30 pm
Strange, I'm using the very latest CVS-Build, fs2_open_r-20060130.
 :confused:

Title: Re: Ship viewer
Post by: Wanderer on January 31, 2006, 12:42:43 pm
I'm using this scripting.tbl (http://koti.mbnet.fi/vekkup/scripting.tbl)... And i get no errors on debug builds and it runs with both builds... with same build as you...
Title: Re: Ship viewer
Post by: starfox on January 31, 2006, 12:51:57 pm
Thanks, it works now !
 :)