daza 36 Posted July 22, 2010 I've searched for posts on this topic, and have found some instructions which i have followed, as well as watched some Youtube how to's. But my script has an error, showscripterrors reveals "[#] c" Invalid number in expression and wont run at all when i preview the intro. Ive checked examples of other scripts and i cannot see any obvious syntax error. Here is what i have. cutText ["The Ambush", "BLACK FADED",5] titlecut [","BLACK IN",1] _cam = "camera" camCreate [0,0,0] _cam cameraEffect ["internal", "back"] _cam camPrepareTarget jeep1 _cam camPreparePos [9202.99,2442.63,2.13] _cam camPrepareFOV 0.700 _cam camCommitPrepared 0 @camCommitted _cam _cam = "camera" camCreate [0,0,0] _cam camPrepareTarget jeep1 _cam camPreparePos [9187.10,2460.48,15.52] _cam camPrepareFOV 0.700 _cam camCommitPrepared 15 @camCommitted _cam ~20 _cam cameraEffect ["Terminate","back"] camDestroy _cam ~1 End1=true exit I've copied and pasted camera positions as per normal. Any suggestions? Thanks Daza Share this post Link to post Share on other sites
IndeedPete 1038 Posted July 22, 2010 You're creating the camera 2 times.^^ Share this post Link to post Share on other sites
daza 36 Posted July 22, 2010 I just removed the second camera block of code, i still get the same error message. cutText ["The Ambush", "BLACK FADED",5] titlecut [","BLACK IN",1] _cam = "camera" camCreate [0,0,0] _cam cameraEffect ["internal", "back"] _cam camPrepareTarget jeep1 _cam camPreparePos [9202.99,2442.63,2.13] _cam camPrepareFOV 0.700 _cam camCommitPrepared 0 @camCommitted _cam ~20 _cam cameraEffect ["Terminate","back"] @camDestroy _cam ~1 End1=true exit Share this post Link to post Share on other sites
IndeedPete 1038 Posted July 22, 2010 You have a mistake here: titlecut [[b][color="Red"]"[/color][/b],"BLACK IN",1] It should be: titlecut [[b][color="Red"]""[/color][/b],"BLACK IN",1] I've tried it and it works now for me. Share this post Link to post Share on other sites
daza 36 Posted July 23, 2010 Thanks for your reply Pete. I corrected that syntax but still no joy, same error message. I am using Arma2 OA btw. But this shouldnt matter. I dont know why it wont work. *sigh* Share this post Link to post Share on other sites
IndeedPete 1038 Posted July 23, 2010 Strange, i've tested it myself with Arma 2 Combined Operations v. 1.52. Did you try to create a whole new file and paste the code in there? Maybe something's wrong with the file itself... Share this post Link to post Share on other sites
daza 36 Posted July 23, 2010 Thanks again Pete. I just tried that. Still the same. The file does show in dir as a .sqs file. I normally work with sqf when doing other scripting. But im working with other peoples examples as a guide most in sqs. So there is a number expression it doesnt like and aborts the script altogether. Yet you can run the script fine. You can preview it in the editor right? Cutscenes and intros are important in making a mission immersive, hopefully this problem can be solved. The work around, is to have other characters watch the action with lookat etc but still its no where as good as having proper camera sequences. Can you be bothered making a quick intro (just one camera) that i can download and unpbo to try out and look at the script? i can pm my email address for attachment. Thanks Daza Share this post Link to post Share on other sites
Wass 1 Posted July 23, 2010 @camDestroy _cam what you trying to wait? that is command, not condition. and post here log from Arma2.rpt file Share this post Link to post Share on other sites
Junker 0 Posted July 23, 2010 this works :) enableradio false; _camera = "camera" CamCreate [0,0,0] _camera cameraEffect ["internal","Back"]; ;=== 22:44:34 _camera camPrepareTarget [-28700.42,98670.84,-221.01] _camera camPreparePos [4066.50,4191.67,1.24] _camera camPrepareFOV 0.700 _camera camCommitPrepared 0 @camCommitted _camera ;=== 22:44:34 _camera camPrepareTarget [-28700.42,98670.84,-221.01] _camera camPreparePos [4066.50,4191.67,1.24] _camera camPrepareFOV 0.700 _camera camCommitPrepared 8 @camCommitted _camera player cameraEffect ["terminate","back"]; enableradio true; camDestroy _camera exit Share this post Link to post Share on other sites
IndeedPete 1038 Posted July 23, 2010 (edited) @Daza Yes i can preview your script. And here you can find an old intro for a campaign i never finished. Edit: Or even better and more recent, the mission i'm currentrly working on: http://rapidshare.com/files/408605560/LW_01_weal_and_woe.Zargabad.rar.html Edited July 23, 2010 by IndeedPete Share this post Link to post Share on other sites
daza 36 Posted July 24, 2010 Thanks Pete and Junker. I had a look at your intro Pete, nicely done. Abit on the complex side when i had a look at your scripts, u couldnt find where you executed intro.sqs. My little test has the player init with null=this execvm "camtest1.sqf"; I decided to switch to .sqf because i get more detail with showscripterrors. However it still will not play the intro as intended. I rearranged some code lines to match what you had. Here are the errors im getting in rpt. Error in expression <FOV 0.700; _camera camCommitPrepared 0; @camCommitted _camera; _camera camPrep> Error position: <@camCommitted _camera; _camera camPrep> Error Invalid number in expression File C:\Users\Darian\Documents\ArmA 2 Other Profiles\Daza[NZ]\missions\camtest2.Takistan\camtest1.sqf, line 11 In sqs form i just get "[#] c" Invalid number in expression. Error. So i have zipped my test mission (there is no real mission except for 1 soldier on the map) but this was for learning how to do cutscenes and intros. http://www.mediafire.com/file/tu3aqbbya7du3i4/camtest2.Takistan.7z See if you get the same errors, i have left both versions of the script in the folder. Thanks for your help :) Daza Share this post Link to post Share on other sites
IndeedPete 1038 Posted July 25, 2010 Ah, i see. You had two errors.^^ 1. "@" is sqs-only. In sqf you have to use "waitUntil" instead. (That's one reason because i still use sqs for camscripts: when you paste a camera position it automatically adds the "@") 2. "camDestroy" is a command not a local variable. ;) Now it works: In sqf: _camera = "camera" camCreate position player; _camera cameraEffect ["internal", "back"]; showcinemaborder false; _camera camPrepareTarget [21167.52,101684.59,3063.23]; _camera camPreparePos [9202.99,2442.63,2.13]; _camera camPrepareFOV 0.700; _camera camCommitPrepared 0; waitUntil {camCommitted _camera}; _camera camPrepareTarget [104893.42,13861.57,-26835.90]; _camera camPreparePos [9187.10,2460.48,15.52]; _camera camPrepareFOV 0.700; _camera camCommitPrepared 12; waitUntil {camCommitted _camera}; sleep 20; _camera cameraEffect ["Terminate","back"]; camDestroy _camera; sleep 1; Endmission "End1"; And in sqs: _camera = "camera" camCreate position player _camera cameraEffect ["internal", "back"] showcinemaborder false _camera camPrepareTarget [21167.52,101684.59,3063.23]; _camera camPreparePos [9202.99,2442.63,2.13]; _camera camPrepareFOV 0.700; _camera camCommitPrepared 0; @camCommitted _camera _camera camPrepareTarget [104893.42,13861.57,-26835.90]; _camera camPreparePos [9187.10,2460.48,15.52]; _camera camPrepareFOV 0.700; _camera camCommitPrepared 12; @camCommitted _camera ~20 _camera cameraEffect ["Terminate","back"] camDestroy _camera ~1 Endmission "End1" I had a look at your intro Pete, nicely done. Abit on the complex side when i had a look at your scripts, u couldnt find where you executed intro.sqs. Thanks! In my mission folder is a file called "initIntro.sqf". It basically works as "init.sqf" for the intro section. From there i execute the camscript. :) Share this post Link to post Share on other sites
daza 36 Posted July 25, 2010 Thanks alot Pete! It works :) However it still doesnt work in the sqs form :( I pasted in your sqs code, i even tried creating a new file to be doubly sure. But i get the same invalid number expression error. Yet the Sqf version of the script works fine. It sounds like you tested out both versions you amended, so i dont know why its giving me the same error still? Alas at least it works in sqf, so i can work from there. Thanks again Pete, i was about to give up. Daza Share this post Link to post Share on other sites
IndeedPete 1038 Posted July 25, 2010 Strange, sqs works for me. Maybe a wrong execution? "execVM" instead of "exec"? Share this post Link to post Share on other sites
engima 327 Posted June 19, 2011 Daza, I'm currently having exactly the problem you describe. Did you find out what was the problem? ---------- Post added at 09:22 PM ---------- Previous post was at 09:09 PM ---------- AHA! Problem is encoding. My intro.sqs was saved with UTF-8. Saved it as ANSI, and now it works perfectly! First characters in a file stores the encoding, but ArmA2 probably reads them as part of first line, which generates the "invalid number". Share this post Link to post Share on other sites