Sorry to trouble with this probably silly question, but it's a big problem for me.
I tried to modify a celx script, in order to shorten it.
Launching it everything goes OK, but at half of the script it stops with this error message:
"In line 116=Second argument to celestia:print must be a number"
Well, I counted the lines as normally we do, i.e. one after the other starting from the beginning, but line 116 is way BEFORE the point in which the error message popped on the screen.
Moreover, I have no commands written as celestia:print
Where is the trick?
Please help me, I'm getting mad to understand how it works.
Thanks a lot.
Bye
Andrea
Command lines count in celx scripts
Command lines count in celx scripts
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Command lines count in celx scripts
Andrea,
Could you provide the whole script? That would help.
Could you provide the whole script? That would help.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Re: Command lines count in celx scripts
Sure, Vincent, you can find it here:Vincent wrote:Andrea, Could you provide the whole script? That would help.
http://ftp.tiscali.it/andrea_celestia/futuro_del_sole-no2.celx
BTW, it's your script future_of_our_sun_celestia1.5 that I translated in Italian and slightly modified mainly to shorten it a bit, due to time problems (just one hour to show Sun birth, life and death, alas!).
Thanks a lot, Vincent.
Bye
Andrea
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Command lines count in celx scripts
Andrea,
First of all, you may want to use notepad 2 to edit your scripts.
Unlike the version of notepad provided with Windows, notepad 2
offers many features dedicated to code and script editing.
Then, to fix the issue you're getting with your Italian version of the script,
just replace line 497 ('Seconda fase di Gigante rossa' section):
with:
and line 506:
with:
In both cases, the text argument was missing in the displaySunInfo function,
which is declared in line 116 and called many times all along the script.
First of all, you may want to use notepad 2 to edit your scripts.
Unlike the version of notepad provided with Windows, notepad 2
offers many features dedicated to code and script editing.
Then, to fix the issue you're getting with your Italian version of the script,
just replace line 497 ('Seconda fase di Gigante rossa' section):
Code: Select all
displaySunInfo(sun_age,sun_radius, sun_lum, sun_temp, 2)
Code: Select all
displaySunInfo(text23, sun_age,sun_radius, sun_lum, sun_temp, 2)
and line 506:
Code: Select all
displaySunInfo(sun_age,sun_radius, sun_lum, sun_temp, 4)
Code: Select all
displaySunInfo(text23, sun_age,sun_radius, sun_lum, sun_temp, 4)
In both cases, the text argument was missing in the displaySunInfo function,
which is declared in line 116 and called many times all along the script.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Re: Command lines count in celx scripts
Thank you Vincent, I forgot that notepad2 gives the line number on left (and many more advantages over Microsoft Notepad, BTW), and this is very useful for this purpose.Vincent wrote:Andrea, First of all, you may want to use notepad 2 to edit your scripts. Unlike the version of notepad provided with Windows, notepad 2 offers many features dedicated to code and script editing.
OK, now I can understand the function of the line 116, i.e. it gives the general rule for text displaying all along the script.Vincent wrote:Then, to fix the issue you're getting with your Italian version of the script,
just replace line 497 and line 506.
In both cases, the text argument was missing in the displaySunInfo function,
which is declared in line 116 and called many times all along the script.
I changed the lines as you suggested and now all works flawlessly.
Thanks a lot, VERY appreciated.
Bye
Andrea
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO