Home   Help Search Login Register  

Author Topic: Helmet cam script: Changing the frame sprite.  (Read 1477 times)

0 Members and 2 Guests are viewing this topic.

Baphomet

  • Guest
Helmet cam script: Changing the frame sprite.
« on: 23 Nov 2002, 03:41:06 »
Anyone used the helmet cam script? It's very cool. However, as interesting as it is to view my mates via tv screen. I'd like to change the helmet cam frame to use something else. Perhaps Vektorboson's frame sprites for his sattellite cam. I'm not quite sure how to modify the sprites. Especially since the TV set appears to be an internal resource (ie: its not referred to by file name, just "tvset").

Baphomet

  • Guest
Re:Helmet cam script: Changing the frame sprite.
« Reply #1 on: 23 Nov 2002, 13:28:07 »
... Ok then. So nobody knows or cares.  :P

Can anyone at least tell me what the internal name for the V-80's 30mm gun optics are? I could use those I guess, they look cool.

Offline uiox

  • Contributing Member
  • **
Re:Helmet cam script: Changing the frame sprite.
« Reply #2 on: 24 Nov 2002, 13:07:14 »
Sample with Sefe's laser guided scripts.

Define it in description.ext
and use it
titlersc ["YourFrameSprite","plain"]

Offline uiox

  • Contributing Member
  • **
Re:Helmet cam script: Changing the frame sprite.
« Reply #3 on: 24 Nov 2002, 15:38:47 »
Other script, not really helmet camera a camera on shoulder, in it you can see some funny random effects...

Baphomet

  • Guest
Re:Helmet cam script: Changing the frame sprite.
« Reply #4 on: 25 Nov 2002, 11:19:51 »
Well, the shoulder cam script does essentially what the helmet cam script does. Or should I say it uses a similar means to project the frame graphic on the screen:

cutobj ["tvset","plain down",100]
cutObj["tvset","Plain"]

It's pretty much the same stuff. The other one (missile cam), does use a different graphic. However it does not use the same method. I suck at scripting so unless it's something as simple as declaring a new graphic resource in the description.ext file and giving it a name so I can basically change "tvset" to whatever the name of the new graphical resource is. Then I'm pretty much screwed. =P

« Last Edit: 25 Nov 2002, 11:20:49 by Baphomet »

Baphomet

  • Guest
Re:Helmet cam script: Changing the frame sprite.
« Reply #5 on: 25 Nov 2002, 11:46:28 »
Ok, ok. I've taken another look at the desc.ext for the missile cam, and it makes a little more sense now... sorta.

Instead of:cutobj ["tvset", "plain"]

it's...

titlersc ["mire","plain"]

So then. The graphic "mire" better known as bon3.paa is declared in the description.ext and has been applied that name. So. If I did roughly the same thing. Could I use that graphic with its declared name in a "cutobj" command as well?

If so... good. Now follows my next question.

Out of all this mess, what is essential and what isn't? I mean if I were to do the exact same thing to declare a graphical resource that is. I've annotated the entire ".ext" file for things I'm not sure of, and those that I feel have some relevance.

class RscPicture
{
   type=0;
   idc=-1;
   style=48;
   colorBackground[]={0,0,0,0};
   colorText[]={1,1,1,1};
   font="tahomaB24";
   size=1;
};
I'm not too sure about this above, RscPicture is referenced below. However I'm not really sure about the stuff beneath it, yes/no?

class RscTitles
{
   
    class mire Class mire. I'm assuming this has something to do with it...
   {
      
      idd=-1; I don't know what this does...

      // whether the user can move the control or not, doesn't work
      movingEnable=0;

      //duration in seconds
      duration=0.1;
      fadein=0;
I assume the stuff I struck out isn't really necessary...
      
      // the name displayed
      name="mire"; Sounds like it would be...


      controls[]={"pic1"}; Lost again...

      class pic1: RscPicture
      {
         style=48;
         text="bon3.paa";
         colorBackground[]={0,0,0,1};
     Â Â Â   Â Â Â x=0;
         y=0.000000;
         w=1;
         h=1.000000;
      I know this has something to do with it, I'm not quite sure how the other values work... w,h sound like how the object might be resized. x,y sound like it might be used to modify its onscreen position. I don't know what colorbackground does... colors the background?! I dunno...   
                              };

      };
titles[]={"mire"};
Why is this all by itself?
};
I'm going to fiddle around with it. Feedback would be greatly appreciated.

Hm. It looks like that stuff I struck out -is- necessary after all. Declaring the graphic resource and then placing it in with the "cutobj" command didn't work. It however sort of gave me the idea it would work if titlersc was put in place of cutobj. However I don't want the image to have a duration modifier (which it noted the absence of). I'm beginning to wonder if there is a way at all of declaring it at all so it is compatible with the "cutobj" command...

« Last Edit: 25 Nov 2002, 12:52:28 by Baphomet »

Offline uiox

  • Contributing Member
  • **
Re:Helmet cam script: Changing the frame sprite.
« Reply #6 on: 25 Nov 2002, 17:13:51 »
Quote
Could I use that graphic with its declared name in a "cutobj" command as well
No you can't, I think "tvset" is internal OFP object,I've try it--> directly to the desk...

Quote
class RscPicture
Meta classes, for picture some items are not use but you need to declare them, if not you have a bug of no declaration.
But you can declare directly in class area. If you delete style and background in the class no problem cause in the meta class. You can define all items in meta class like this:
Code: [Select]
class RscPicture
{
   type=0;
   idc=-1;
   style=48;
   colorBackground[]={0,0,0,0};
   colorText[]={1,1,1,1};
   font="tahomaB24";
   size=1;
   x=0;
   y=0.000000;
   w=1;
   h=1.000000;
   };

class RscTitles
//  RscTitles are use during the game not like dialog cause keyboard and mouse are active...
{
   
    class mire
   {
      
      idd=-1;
      movingEnable=0;
      duration=0.1;
      fadein=0;
      controls[]={pic1,pic2};
      class pic1: RscPicture
         {
         text="bon3.paa";
         };

      class pic2 : pic1
         {
         text="Esai mire.jpg";
         y=0.8;
         };

   };
   
    class mire2
   {
      
      idd=-1;
      movingEnable=0;
      duration=0.1;
      fadein=0;
      controls[]={"pic1"};
      class pic1: RscPicture
      {
         text="Esai mire.jpg";
         x=0;
         y=0.000000;
         };

      };
titles[]={"mire,mire2"};
};

In this i have put all items related to position in meta class, in class only the directory position of the picture.
If I write " w=0.5;" in the class this value OVERWRITE meta class value...
Note I have remove all not useful items...
Quote
class mire Class mire. I'm assuming this has something to do with it...
Class can be meta class after declare it...


Quote
fadein=0; I assume the stuff I struck out isn't really necessary...
Remove it you will see ... fade by default

For duration the only way I have found is to give a little one (0.1 s) and manage it in a script.

Baphomet

  • Guest
Re:Helmet cam script: Changing the frame sprite.
« Reply #7 on: 29 Nov 2002, 09:21:01 »
Hm. Well that doesn't really change my situation though. If I can't use cutobj, and simply specify an external resource (like the graphic I wish to use instead of "tvset") Then I'm assuming I'd have to alter a lot of other code just to get it to work. Obviously there isn't an easy work-around soltion to this. Thats what I was hoping for because, simply put. I don't have the knowledge to re-script it. It's furthermore, not a priority to learn how to do so. As the priority was to simply change the graphic in the first place. So I'll have to make do.

Offline uiox

  • Contributing Member
  • **
Re:Helmet cam script: Changing the frame sprite.
« Reply #8 on: 29 Nov 2002, 12:35:37 »
I don't understand where is your problem.
If you want manage the duration you do it in infinite loop in a serparate script and a global variable set to true when you want to show the pict.
I do like this in the script montrepict.sqs in laser guidded missile script...

Baphomet

  • Guest
Re:Helmet cam script: Changing the frame sprite.
« Reply #9 on: 30 Nov 2002, 00:40:20 »
Ok. In really simple terms. Perhaps I'm not concise about this.


The graphic frame "tvset" which is used in the helmet cam script, as well as the shoulder cam script. I don't want to use. I simply wanted change the "tvset" graphic to use something else. Specifically I want to replace it with a .paa file called "V80_optika.paa" while modifying as little code as possible to do so. If that isn't possible. As I said. I'll just make do.


Offline uiox

  • Contributing Member
  • **
Re:Helmet cam script: Changing the frame sprite.
« Reply #10 on: 30 Nov 2002, 12:49:06 »
Description.ext :
Code: [Select]
class RscPicture
{
   type=0;
   idc=-1;
   style=48;
   colorBackground[]={0,0,0,0};
   colorText[]={1,1,1,1};
   font="tahomaB24";
   size=1;
};
class RscTitles
{
   class V80
   {
      idd=-1;
      movingEnable=0;
      duration=0.1;
      fadein=0;
      controls[]={"pic1"};
      class pic1: RscPicture
      {
         text="V80_optika.paa";
         x=0;
         y=0.000000;
         w=1;
         h=1.000000;
      };
   };
titles[]={"V80"};
};

A script "showV80.sqs"

Code: [Select]
#Loop
~0.1
?!(showV80pict): goto "Loop"
titlersc ["V80","plain"]
goto "Loop"

In init.sqs

Code: [Select]
showV80pict = false
[] exec "showV80.sqs"

And in your scripts

You want the pict : showV80pict = true

For stop it : showV80pict = false

 ;)