I figured out how the Airstrip works [message #57789] |
Sun, 14 December 2003 05:19 |
|
Basicly, here is the scoop.
Firstly, all "airstrips" (i.e. everything under the Airstrip item in Buildings, have settings for:
Cinematic Slot Index
Drop-Off Cinematic
and some other related items that arent important.
What happens is this:
When the vechicle is purchased, the game creates an instance of the Drop-Off Cinematic object (known as CnC_Nod_Cargo_Drop in stock renegade). This object has Test_Cinematic attatched to it with the cinematic script that is to be used attatched. (i.e. c&c_c130drop.txt in standard renegade)
Also, the game creates the internal data structure behind the Test_Cinematic script (i.e. an instance of the class Test_Cinematic)
Then, at some point, AirStripGameObj::Start_Cinematic gets called.
This function calls VehicleFactoryGameObj::Create_Vehicle which creates the vechicle. It then does some stuff and gets to a point where it calls the Get_Name method of the object (which in this case will be the string "Test_Cinematic"). Then, it compares it to the hardcoded string "Test_Cinematic". Should it not match, it keeps checking all the other script objects. If it fails to find Test_Cinematic, it will break out without doing anything (not sure if that means the vechicle isnt created or if its just created wierdly). Once it finds Test_Cinematic, it takes the Cinematic Slot Index and adds 10000 to it. Then, it calls the Custom method of the object for which Get_Name returns Test_Cinematic. It passes index+10000 as the Message and the ID of the vechicle created by Create_Vechicle as the parameter. Also, interestingly, it passes the ScriptableGameObj corresponding to the Airstrip as both the Sender and the Reciever of the message.
When Test_Cinematic recieves the message, it puts the ID into the right slot. Then, it can be accessed with Attach_To_Bone or whatever as though it was created with Create_Object.
So, it has been confirmed that the airstrip and nod vechicle purchasing in C&C Renegade is most definatly a Big Ugly Hack(TM)
But this discovery does open up the posibility to create a script that does something (which includes creating 1 or more objects) then starts a cinematic and passes the IDs of the objects its just created into the cinematic via this functionality. Or at least I think so anyway
|
|
|