Home   Help Search Login Register  

Author Topic: Laptop  (Read 5974 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.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Laptop
« Reply #15 on: 21 Sep 2005, 00:06:55 »
You don't need the model file and the textures in your pbo.

They already exist in the game file.

All you really need is the config and your Laptop.pac.

Try this one:

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


#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

//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



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

      picture="\ArchLaptop\Laptop.pac";
      model="notebook.p3d";
      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[] = {};
   };
};

Although I am unsure if you need a cfgPatches section or not.


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 #16 on: 21 Sep 2005, 00:19:01 »
I changed the config for what you just posted. I removed all the stuff apart from the .PAC.

I opened the editor and placed a west unit.

I put this in the init line,

removeallweapons this; this addweapon "ArchLaptop"

I got a "No Entry 'configbin/CFGWeapons.ArchLaptop'" error.

I tried it with magazine and got the same.
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 #17 on: 21 Sep 2005, 00:21:33 »
Although I am unsure if you need a cfgPatches section or not.

Nope, your config there is perfect Planck. CfgPatches is only usefull when you have different versions of the same addon, CfgPatches will define the version, which will tell OFP which versions to override, and they are also involved with those frustrating "cannot load mission, missing addons" errors that tick us all off.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Laptop
« Reply #18 on: 21 Sep 2005, 00:30:36 »
What about a cfgModels section?


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

Offline Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #19 on: 21 Sep 2005, 00:32:34 »
Wait, you're saying a CfgPatches section is what causes those errors?

-Student Pilot

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #20 on: 21 Sep 2005, 00:34:43 »
Yeah, what about a CFG Models section?
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 #21 on: 21 Sep 2005, 00:38:10 »
Yeah, what about a CFG Models section?

Definatly not, CfgModels is only needed to register new models with proper selections and etc... You don't need it cause your using a model thats allready in the game. And you wouldn't need it anyways because CfgModels is only needed for models with hiddenselctions, or selections that are subject to texture change by the OFP engine, things like faces, muzzle flash, lights, etc...

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #22 on: 21 Sep 2005, 00:41:08 »
So why isn't it working?

Please can someone download it and run it through their Flashpoint to maybe get some idea?
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 #23 on: 21 Sep 2005, 00:45:12 »
Hmmmmm.......this model might already be in the game, but it is not configged anywhere in any of the game configs.

It is one of those many model files that has no config entry.


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

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #24 on: 21 Sep 2005, 00:45:23 »
So why isn't it working?

Please can someone download it and run it through their Flashpoint to maybe get some idea?

Did you "PBO it"? All addons need to be in .pbo format, which is basicaly a way of compressing everything in that folder into one nice, small, convenient file. There are a ton of PBO encrypters out there, personally, I use MakePBO, just because its so simple and hasn't failed me yet.

Offline Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #25 on: 21 Sep 2005, 00:45:33 »
What tool did you use to compile the PBO?

Also, you did name the PBO ArchLaptop.pbo, right?  Make sure the ".pbo" is a part of the file name.  PBOTool will not make the file a .pbo unless you type .pbo at the end of the name.

-Student Pilot

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #26 on: 21 Sep 2005, 00:46:13 »
What tool did you use to compile the PBO?

Also, you did name the PBO ArchLaptop.pbo, right?  Make sure the ".pbo" is a part of the file name.  PBOTool will not make the file a .pbo unless you type .pbo at the end of the name.

-Student Pilot

You're a quick one Mr. Student Pilot, but not quick enough  ;)

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #27 on: 21 Sep 2005, 00:48:57 »
Yeah I did that. I used JaZzBrE's tool. It's always worked for me in the past.

I have the file posted on a previous post. Maybe one of you guys could take a look.

I'd appreciate it. I'm not an addon maker.
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 Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #28 on: 21 Sep 2005, 00:52:24 »
Lol, hey, I'm on dial-up here, give me a break. ;D

-Student Pilot


Kyle Sarnik

  • Guest
Re:Laptop
« Reply #29 on: 21 Sep 2005, 00:53:58 »
Its times like this that it's clear that cable is worth the extra cost.  ;)

Offline Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #30 on: 21 Sep 2005, 01:00:51 »
You misunderstand, we can't even get cable here in this part of Indiana.  We are eagerly awaiting it's arrival ::)

@The-Architect
I will try out the config on my comp and report back.

-Student Pilot

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #31 on: 21 Sep 2005, 01:06:52 »
You misunderstand, we can't even get cable here in this part of Indiana.  We are eagerly awaiting it's arrival ::)

@The-Architect
I will try out the config on my comp and report back.

-Student Pilot

Do you mean you get no cable service at all? Or is that our cable provider doesn't have internet service available? I can't imagine what its like living without cable (No TV!  :o ). Personally, I've become quite acustomed to Digital Cable TV and high speed Cable Internet.

Offline Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #32 on: 21 Sep 2005, 01:08:22 »
This config works for me:
Code: [Select]
//Defines common to ALL addons:


#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

//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


class CfgPatches
{
   Â Â Â class ArchLapTop
   Â Â Â {
      units[] = {};
      weapons[] = {ArchLapTop};
      requiredVersion = 1.30;
   };
};
class CfgWeapons
{
  class default  {};
  class ArchLapTop : Default
  {
      scopeWeapon = public;
      scopeMagazine = protected;

      picture="\ArchLaptop\Laptop.pac";
      model="notebook.p3d";
      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[] = {};
  };
};
A CfgPatches is required.

-Student Pilot

EDIT:
We use satellite TV.  No cable here.
« Last Edit: 21 Sep 2005, 01:09:18 by Student Pilot »

Kyle Sarnik

  • Guest
Re:Laptop
« Reply #33 on: 21 Sep 2005, 01:16:27 »
We use satellite TV.  No cable here.

Oh, I'm so sorry for you  ::)

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #34 on: 21 Sep 2005, 17:13:31 »
Yep. Works now.

Cheers for the help guys it is greatly appreciated.

I still think it would be better in one of the other slots but seeing as I'm only checking if the player or team member has it, I can easily just give it to a team member.

Thanks again.
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 Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #35 on: 21 Sep 2005, 17:29:49 »
If you want the laptop to be in the secondary slot, the one where the AT weapons go, change this line in the config:
weaponType = WeaponSlotBinocular;

to:
weaponType = WeaponSlotSecondary;

The laptop will now take up the secondary slot.

-Student Pilot

P.S.  If any of you saw what I first posted (the message before "Typing Message") and thought "wtf is he on?", I have a reasonable explanation for it.  I loaded up OFP to test the solution, however, the mouse was still in IE.  When I hit enter to go to the mission editor, it posted the message I wasn't finished with. ::)
« Last Edit: 21 Sep 2005, 17:36:17 by Student Pilot »

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #36 on: 21 Sep 2005, 18:11:29 »
What about an ammo slot?
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 Pilot

  • Contributing Member
  • **
Re:Laptop
« Reply #37 on: 21 Sep 2005, 19:26:59 »
You shouldn't need anything in the ammo slots, unless you want something there, that is.

-Student Pilot

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #38 on: 21 Sep 2005, 20:49:42 »
What I would ideally want is for it to take up a couple of ammo slots. No secondary weapon slots, because that puts the model on the players back, a little too high up for it to look ok. Not in a NVG or Binos slot, because the player is going to want both of those.

Ammo slot is ideal for now obvious reasons.

Having it in the Bonos slot is acceptable because I can gve it to another team member. I don't give them Binos anyway.
« Last Edit: 21 Sep 2005, 20:50:42 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 #39 on: 21 Sep 2005, 21:16:59 »
What I would ideally want is for it to take up a couple of ammo slots. No secondary weapon slots, because that puts the model on the players back, a little too high up for it to look ok. Not in a NVG or Binos slot, because the player is going to want both of those.

Ammo slot is ideal for now obvious reasons.

Having it in the Bonos slot is acceptable because I can gve it to another team member. I don't give them Binos anyway.

You simply can't assign a weapon to take up WeaponSlotItem's, so the only way you are going to get it to take up those slots is to make it a magazine. The problem with that is that a unit can't take a magazine without a weapon that can "use" the magazine, and then you would be adding 3x as much extra work than you really need.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Laptop
« Reply #40 on: 21 Sep 2005, 21:19:46 »
I figured that might be the case. Ok, I'll just keep it as is. Thanks for the help guys. Excellant work.
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."