Home   Help Search Login Register  

Author Topic: Varoius cutscenes written in the same script  (Read 690 times)

0 Members and 1 Guest are viewing this topic.

Gooner861

  • Guest
Varoius cutscenes written in the same script
« on: 31 Aug 2004, 12:00:26 »
Hello there,

Just de PBO Farcile Ground by Sui which was a fantastic mission to learn frm it and i noticed there were hardly any .sqs files containing cutscene code. I was expecting quite a few seeing that there are a number of scenes in the mission.
I than found one huge .sqs file that had all the cutscenes in the mission. I didnt know you cud put numerous scenes in one file but how do u call up the scene you want if its in one single file containing loads of other cutscenes.

For example:

Quote
_c1w cameraeffect ["terminate","back"]
camdestroy _c1w
"player addrating 50" foreach ((units alpha) + (units bravo) + (units yankee))
? ((west countside units yankee) + (west countside units buffalo) + (west countside units alpha) + (west countside units bravo)) >= 12: player addrating 500; win1 = true
? ((west countside units yankee) + (west countside units buffalo) + (west countside units alpha) + (west countside units bravo)) < 12: player addrating 250; win2 = true
exit

#Larchefallen
? not (alive player): exit
raduse = true
? alive lt: lt sideradio "SLT_Beenoverrun"
? not (alive lt): player sideradio "SAP_LTdead"

One scene ends with "exit" and than there is another cutscene which starts with #Larchefallen. To play that cutscene Larchefallen is it just a matter of activating it with a trigger [] exec"Larcefallen"???


Just a query, nothing major  ;D

Gooner

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Varoius cutscenes written in the same script
« Reply #1 on: 31 Aug 2004, 12:09:54 »
I haven't actually seen the mission but perhaps you choose the cutscene when calling the script eg:

[Larchefallen] exec "cutscene.sqs"

Code: [Select]
_cutscene = _this select 0

goto "_cutscene"


Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Varoius cutscenes written in the same script
« Reply #2 on: 31 Aug 2004, 13:45:59 »
Hey Gooner,

Coldst33l's almost got it... he just needed to drop the brackets around _cutscene.

If you look right at the start of either scenes.sqs or radio.sqs, you'll see this code:

Code: [Select]
_call = _this select 0
goto _call
hint "Error in Scene.sqs"
exit

All that does is jump the script to where I want it to be, depending on how it was executed. The Larchefallen cutscene is executed by a trigger that detects when there are heaps more bad guys than good guys.

It executes the script like this:

["Larchefallen"] exec "Scene.sqs""

Then the code above will jump the script to #Larchefallen.

The main reason I do this is simply because I don't want to have to juggle 300 .sqs files in my mission directories. There are a lot of other little reasons, but simplicity is the main one ;)

Gooner861

  • Guest
Re:Varoius cutscenes written in the same script
« Reply #3 on: 31 Aug 2004, 15:06:42 »
Hey there Sui,

Thanks for the reply. Just been looking at your scripts etc and there is loads of stuff that i've never seen before.

For example:
Quote
? (_i == 20): _cam camsettarget apache2
? (_i == 20): _cam camcommit 4
? (_i == 30): 10 fademusic 0.8
? (_i == 50): _cam camsettarget apache1
? (_i == 50): _cam camcommit 10

Ok i understand the camsettarget etc but i dnt have a clue wot all that ?(_i==50): is all about?

Sorry you've probs been asked loadsa stuff bout this but im just interested in ur work, it inspired me to make the next best thing (one day)  ;D .

Cheers

Gooner

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Varoius cutscenes written in the same script
« Reply #4 on: 01 Sep 2004, 11:05:49 »
That has to do with making things happen in the middle of a camera loop. The full bit of code is this:

Code: [Select]
_i = 0
#apacheloop2
~0.1
_cam camsetpos [(getpos apache1 select 0) + (sin (getdir apache1 - 10) * 30),(getpos apache1 select 1) + (cos (getdir apache1 - 10) * 30), (getpos apache1 select 2) + 4]
_cam camcommit 0.25
? (_i == 20): _cam camsettarget apache2
? (_i == 20): _cam camcommit 4
? (_i == 30): 10 fademusic 0.8
? (_i == 50): _cam camsettarget apache1
? (_i == 50): _cam camcommit 10
_i = _i + 1
? (_i == 50): playsound "IG2_Oneleg"; apache1 flyinheight 40; apache2 flyinheight 45
? (_i == 100): playsound "IG1_RWRspike"
? (_i == 110): apache1 say "gundish"; apache1 flyinheight 50; apache2 flyinheight 55; dostop apache2
? _i < 165: goto "apacheloop2"

So the whole thing is in the middle of a loop. Every time the loop goes through, it adds one to _i (As well as keeping the camera in the same spot relative to the moving helicopter of course ;) ). So once the loop has been through 20 times, I change the camera to target apache2. Once it's been through 50 times, I change the target back to apache1 etc.

It's just a way of keeping events linear, even though the script is looping around on itself to keep the camera where I want it...

Gooner861

  • Guest
Re:Varoius cutscenes written in the same script
« Reply #5 on: 01 Sep 2004, 16:35:52 »
Oh rite ok thanks. I get you now.

Thanks for the help in this thread.

Gooner  ;D