Home   Help Search Login Register  

Author Topic: two animation in cpp?  (Read 981 times)

0 Members and 1 Guest are viewing this topic.

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
two animation in cpp?
« on: 10 Aug 2003, 22:51:33 »
ok hi and welcome

i have a problem and hear gose im makeing some addons of a dubble gate and was wondering how to get the open command to run two animation with only one button press ive got them working useing a script but it seems to have a glitch and animation dont work when useing two gates any help would be great
Code: [Select]
      class wizwall4 : Fortress1
      {
      vehicleClass="Tower_Pack";
      side=TCivilian;
      scope=public;
      armor=20000;
      model="\h_w_walls2\wizwall4.p3d";
      displayName="h_w_Gate";
      simulation="house";
      mapSize = 16
      animated=1
      class Animations
      {
         class gate1
         {
            type="rotation";
            animPeriod=1
            selection="gate1";
            axis="osa_gate1";
            angle0=0
            angle1=-1.600000;
         };
         class gate2
         {
            type="rotation";
            animPeriod=1
            selection="gate2";
            axis="osa_gate2";
            angle0=0
            angle1=-1.600000;
         
         };
         };
         class UserActions
         {
         class Opengate
         {
            displayName="Open Gate";
            position="osa_con";
            radius=2.500000;
            condition="this animationPhase ""gate1"" < 0.5";
            statement="[this] exec ""\h_w_walls2\Scripts\gateopen.sqs"";"
         };
         class Closegate
         {
            displayName="Close Gate";
            position="osa_con";
            radius=2.500000;
            condition="this animationPhase ""gate1"" >= 0.5";
            statement="[this] exec ""\h_w_walls2\Scripts\gateclose.sqs"";"

now the scripts are just the

gateclosed.sqs
Code: [Select]
; scripted by wizzywig
titletext["Attention Main Gate shuting","PLAIN DOWN"]
this animate ["gate1", 0];
~1
this animate ["gate2", 0];

gateopen.sqs
Code: [Select]
; scripted by wizzywig
titletext["Attention Main Gate Opening","PLAIN DOWN"]
this animate ["gate1", 1];
~1
this animate ["gate2", 1];

any help please would go down a treat

thanks

Kaliyuga

  • Guest
Re:two animation in cpp?
« Reply #1 on: 10 Aug 2003, 23:22:52 »
you can have multiple statements in your User Actions class..

in the statement line where you are calling the script from like this:

condition="this animationPhase ""gate1"" < 0.5";
statement="[this] exec ""\h_w_walls2\Scripts\gateopen.sqs"";"
};

you can simply put:
condition="this animationPhase ""gate1"" < 0.5";
statement= "this animate [""gate1"", 1]; this animate [""gate2"", 1]";


and then both animations should occur for you at the same time
:toocool:





Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:two animation in cpp?
« Reply #2 on: 11 Aug 2003, 00:04:34 »
ok ill give that a go