Home   Help Search Login Register  

Author Topic: Laptop  (Read 5971 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Laptop
« on: 20 Sep 2005, 13:53:03 »
Just an addon that does nothing whatsoever.

It just fills an inventory space.

Everything about the Laptop is scripted by the mission maker. The addon is like the Nampack radio and it's spin-offs.

What do you say? 5 mins in O2 or whatever it's called.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #1 on: 20 Sep 2005, 21:29:49 »
You can do this VERY easily yourself. OFP allready has a laptop model in the data.pbo somewhere (its in one of the data files). All you need to do is find the name and model path to it, and rig up a config like this:

Code: [Select]
class CfgWeapons
{
   class default  {};
   class LapTop : Default
   {
      //--
      scopeWeapon = public;
      scopeMagazine = protected;

      picture=YOURPICTURE;
      model=MODELNAME+PATH;
      modelOptics="";

      valueWeapon = 5;

      weaponType = WeaponSlotBinocular;
      magazineType = WeaponNoSlot;
      ammo=; // no ammo
      displayName = "Laptop Computer";
      reloadTime=0.0;
      sound[]={,0,1};
      canLock=LockNo;

      optics = false;
      forceOptics = false;

      primary = false;

      magazines[] = {};
   };
};

Of course you would probably want to get an inventory picture and include it where I said YOURPICTURE, and MODELNAME+PATH is the path and name of the laptop model.
« Last Edit: 20 Sep 2005, 21:30:40 by Kyle Sarnik »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Laptop
« Reply #2 on: 20 Sep 2005, 22:13:44 »
Well, yes.....the model name is notebook.p3d.........and it has no classname anyway.   ;D ;D

So you could make one up as KS said.


Planck
I know a little about a lot, and a lot about a little.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #3 on: 20 Sep 2005, 22:29:43 »
That binocular bit. How would I change it to a single ammo space?

EDIT: I found some textures, I'm now looking for the p3d model.
Do they go together?
« Last Edit: 20 Sep 2005, 22:35:45 by The-Architect »
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Laptop
« Reply #4 on: 20 Sep 2005, 22:42:56 »
The model uses 11 textures, you don't need to worry about all that, just write the config, it will find the model and the textures fine.


Planck
I know a little about a lot, and a lot about a little.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #5 on: 20 Sep 2005, 22:45:36 »
I've never used that O2 thing. I'm walking in the dark. What do I do with the config once I've written it?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Laptop
« Reply #6 on: 20 Sep 2005, 22:49:47 »
You don't need to use O2 at all.

The model exists in Data3d.pbo and the textures are in Data.pbo.......so you don't need to worry about that.

Write the config, then PBO it, then put it in your Addons folder.


Planck
I know a little about a lot, and a lot about a little.

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #7 on: 20 Sep 2005, 22:51:39 »
Make sure you include the basic defines or else that config won't work.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Laptop
« Reply #8 on: 20 Sep 2005, 22:56:42 »
Basic Defines

Code: [Select]
//Defines common to ALL addons:

// some basic defines
//#define TEast    0
//#define TWest    1
//#define TGuerrila    2
//#define TCivilian    3
//#define TSideUnknown    4
//#define TEnemy    5
//#define TFriendly    6
//#define TLogic    7

//#define true       1
//#define false    0

// type scope
//#define private    0
//#define protected    1
//#define public    2


I think thats them all, but I suspect there are more for weapons.

EDIT

Code: [Select]
//Defines specifically for weapon addons:

//#define WeaponNoSlot          0// dummy weapons
//#define WeaponSlotPrimary       1// primary weapons
//#define WeaponSlotSecondary            16// secondary weapons
//#define WeaponSlotItem               256// items
//#define WeaponSlotBinocular         4096// binocular
//#define WeaponHardMounted        65536


Be sure to remove the '//' from the start of each line.


Planck
« Last Edit: 20 Sep 2005, 23:01:15 by Planck »
I know a little about a lot, and a lot about a little.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #9 on: 20 Sep 2005, 22:58:29 »
I'll do my work then show it.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #10 on: 20 Sep 2005, 23:13:47 »
That binocular bit. How would I change it to a single ammo space?

Never tried it, I don't think OFP supports weapons being in Item Slots, so that won't work unless its a magazine, which you could do but its alot better to make it a weapon that goes into a binocular space.
« Last Edit: 20 Sep 2005, 23:14:06 by Kyle Sarnik »

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #11 on: 20 Sep 2005, 23:20:06 »
If I do that I won't be able to have NVGs and Binos with the addon.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #12 on: 20 Sep 2005, 23:26:50 »
Here is the file I made.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #13 on: 20 Sep 2005, 23:32:55 »
Didn't work.

Do I remove every set of // I see?

Also, I have the model name. What is the path? And do I write it Model.p3d+Path like you put?

Open source of newest version is here.

« Last Edit: 20 Sep 2005, 23:34:30 by The-Architect »
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #14 on: 21 Sep 2005, 00:05:16 »
I was hoping you could figure part of that out on your own... No, I was only using a variable to show you how to do it, MODEL+PATH is something like "\pboname\model.p3d", where pboname is the name of the pbo file that the file is in. In this case there is no path because its in the data.pbo, and thats the DEFAULT path (by default I mean if you don't use a path it will automatically look there). So like Planck said, its "notebook.p3d".

And yes about the //, I don't know why Planck has them there in the first place  :P and he should have removed them himself. You see, two slashes like that tell OFP NOT to read whatever follows it, so its usefull for adding comments, for example:

Code: [Select]
class CfgWeapons
{
// This is where we code
// the laptop addon!

   class default  {};
   class LapTop : Default
   {
      scopeWeapon = public;
      scopeMagazine = protected;

That text is there only for the purpose of the reader's sake, OFP ignores anything after the // marks. In our case, we WANT OFP to read the defines, so you gotta remove them.