Author Topic: Having A Problem With My Script? Can anyone Help Please?  (Read 691 times)

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Having A Problem With My Script? Can anyone Help Please?
« on: July 24, 2010, 08:42:50 pm »


               I knew I couldn't keep away from here for long.'<img'>

I'm having a bit of a problem with my airship script. (people who have replied to my airship cutscene posts over on the recently deceased Bioware forums.... you'll probably remember who I am) Can anyone try to advise me please?

Okay.... this is the basic crane cam script I've been using, which works prety well by itself. (using the gestalt system)



#include
"in_g_cutscene"

void
main()

{

 // Find actors

   object oPC = GetFirstPC();

 
 GestaltCameraCrane (0.0,

                                    270.0, 20.0, 90.0, 12.0,

                                    270.0, 20.0, 90.0, 12.0,

                                    10.0, 30.0,

                                     oPC, 0);

 

 
GestaltCameraCrane (8.0,

                                        270.0, 20.0, 90.0, 12.0,

                                        270.0, 20.0, 90.0, 22.0,

                                        10.0, 30.0,

                                         oPC, 0);

 

 

GestaltStopCutscene (20.0, oPC);

 

 }




Now, THAT..... works well by itself as I said.
But then when I add my full script..... Thus......


#include
"in_g_cutscene"

void
main()

{

 // Find actors

object
oPC = GetFirstPC();

 
GestaltStartCutscene(oPC,
"run_airship_cut");

 
GestaltCameraCrane (0.0,

                    270.0, 20.0, 90.0, 12.0,

                    270.0, 20.0, 90.0, 12.0,

                    10.0, 30.0,

                    oPC, 0);

 
// Make sure it only fires once, if you want
it to fire multiple times ask me and I'll show you how to do that

  if (GetLocalInt(OBJECT_SELF,
"done") == 1) return;

  SetLocalInt(OBJECT_SELF, "done",
1);

  // Name our four waypoints

  object oWP1 =
GetNearestObjectByTag("wp_smoke1");

  object oWP2 =
GetNearestObjectByTag("wp_smoke2");

  object oWP3 =
GetNearestObjectByTag("wp_smoke3");

  object oWP4 =
GetNearestObjectByTag("wp_smoke4");

  // ...and their locations

  location lWP1 = GetLocation(oWP1);

  location lWP2 = GetLocation(oWP2);

  location lWP3 = GetLocation(oWP3);

  location lWP4 = GetLocation(oWP4);

  // The smoke effect

  effect eSmoke =
EffectVisualEffect(VFX_FNF_SMOKE_PUFF);

  // Delay variable

  int nDelay;

  // Set a sound object in the area with the
sound you want to accompany the smoke and set it to inactive initially

  // Then, the first line will activate it and
tell it to start playing with the second line telling it where to stop

  DelayCommand(0.1,
SoundObjectPlay(GetNearestObjectByTag("<insert tag of the appropriate
sound object here>")));

  DelayCommand(12.0,
SoundObjectStop(GetNearestObjectByTag("<insert tag of the appropriate
sound object here>")));

  // Now we apply our visuals.  The VFX_FNF_SMOKE_PUFF only lasts two or
three seconds, so I'm telling it to play multiple times.  I have it starting 0.1 seconds

  // after you first enter the trigger and it
plays for 1 minute.  This is easily
adjustable to play for however long you want and start however long you want
after

  // someone enters the trigger.  FNF stands for Fire and Forget, so if you
find a different visual you prefer that can loop or has a duration, you can
avoid

  // having to make this large list

    for(nDelay = 0; nDelay < 12; nDelay +=
2) {

    DelayCommand(IntToFloat(nDelay),
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eSmoke, lWP1));

    DelayCommand(IntToFloat(nDelay),
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eSmoke, lWP2));

    DelayCommand(IntToFloat(nDelay),
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eSmoke, lWP3));

    DelayCommand(IntToFloat(nDelay),
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eSmoke, lWP4));

  }

 // We can go ahead and throw in a screen shake
for good measure if you'd like, remove this part if you don't want it

 // It's set to play at the location of the
trigger itself

DelayCommand(0.1,

ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(OBJECT_SELF)));

DelayCommand(3.0,
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(OBJECT_SELF)));

DelayCommand(6.0,
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(OBJECT_SELF)));

DelayCommand(9.0,
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(OBJECT_SELF)));

 
GestaltCameraCrane (15.0,

                        270.0, 20.0, 90.0, 12.0,

                        270.0, 20.0, 90.0, 20.0,

                        10.0, 30.0,

                        oPC, 0);

 
DelayCommand(26.0,
FadeToBlack(oPC, FADE_SPEED_SLOW));

AssignCommand(oPC,
ActionWait(28.0f));

AssignCommand(oPC,
ActionJumpToObject(GetObjectByTag("WP_Port_Cabin")));

if
(!GetIsPC(oPC)) return;

 
}



It is now.... nearly perfect. But I'm still having trouble with the crane cam at the start.'<img'>

Thing is..... the camera won't start at the "height off the ground" I set it at, in the beggining.
Instead, it just sits closer to the ground. The 2nd crane cam script works absolutely fine though.

I suspect there is something in the script which is preventing my first one to work correctly.
But I don't have a single clue what is causing it.'<img'>

Can anyone out there, please have a look at my script, tell me why I'm having this problem, and correct it for me?
It would be bvery helpful if they could.

Regards,
"MissJaded"  'B)'
               
               

               


                     Modifié par MissJaded, 24 juillet 2010 - 07:55 .
                     
                  


            

Legacy_ChaosInTwilight

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
Having A Problem With My Script? Can anyone Help Please?
« Reply #1 on: July 24, 2010, 10:54:19 pm »


               
GestaltStartCutscene(oPC,
"run_airship_cut");



Line not present in first code block.



Coincidence unlikely Sheppard, Commander.
               
               

               
            

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Having A Problem With My Script? Can anyone Help Please?
« Reply #2 on: July 25, 2010, 07:00:44 am »


               

ChaosInTwilight wrote...

GestaltStartCutscene(oPC,
"run_airship_cut");

Line not present in first code block.


I took this script from page 1 of Getsalts manuals.

#include "in_g_cutscene"
void main()

{

object oPC = GetLocalObject(GetModule(),"cutsceneviewer");
   
GestaltStartCutscene(oPC,"mycutscene");
   
GestaltStopCutscene(5.0,oPC);

}


It looks like Gestalt used "mycutscene" as a name, which is what he called that script. (for e.g.)
So I copied that line to start my script, and changed "mycutscene" to "run_airship_cut" because that is what I called my script.

Is that what that means? If not... then I have no idea what else it means.
Could you explain this please?

Also, in the first line of that script, I don't understand why it was named "cutsceneviewer"


Coincidence unlikely Sheppard, Commander.


I'm not sure what you mean by this. I'm sorry.
Again.... could you explain please? ':police:'
               
               

               


                     Modifié par MissJaded, 25 juillet 2010 - 06:09 .