Jump to content
Sign in to follow this  
j-man

Speed up boats?

Recommended Posts

I'm making a new MP mission were two groups have to junps into boats and race to a small island to capture the flag. The only problem is that the boats are so slow that they take 5 minutes to get to the island. Is there anyway to speed them up?  rock.gif

Also, I was wondering what the resistance equivalent is to the black op?

Share this post


Link to post
Share on other sites

1: as far as I know it is only possible if you mod the boat itself.

It could be made with "setVelocity" but then you need to calculate which direction the boat is facing, then in a mysterious way making this into valid x,y,z coordinates...

Doolittle knows how this is made.

Haven't seen him around for a while tho

Share this post


Link to post
Share on other sites

MrZig: the resistance equivalent to blackop is not spetsnaz lol - that's EAST smile_o.gif

Anyway

1) It's easy enough to mod the boat. You don't need to edit any models or whatnot, just create a small config.cpp file and change the maxspeed variable (I forget exactly what it's called but I have the 1.90 config.cpp reference to hand so I can find it easily). I can help you with this if you wish.

2) For creating a resistance blackop, do the same as 1, mod the WEST blackop except change the side to resistance (again, a rather easy process.)

If you want me to help, just PM me and I'll sort something out with ya.

Scott

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

_boat setVelocity [1.05*(velocity _boat select 0),1.05*(velocity _boat select 1),0]

@((speed _boat)<100)

goto "loop"

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

_boat setVelocity [1.05*(velocity _boat select 0),1.05*(velocity _boat select 1),0]

@((speed _boat)<100)

goto "loop"

can this be rewritten to handle "tossing" of objects in the direction an object/player/vehicle is facing?

Share this post


Link to post
Share on other sites

Sorry, I don't understand what you want to do?! smile_o.gif

If you mean what I think you could mean: I don't know if this does also work with static objects, which wouldn't be moved normally (they have no "motor")

Share this post


Link to post
Share on other sites

It's still Spetznaz.

See, resistance kills an east spetz and steals their clothes and-nevermind.

For the speed, try something like this.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">v0=70; v0 = v0/3.6; dir=getDir(this);vBase = [sin(dir),cos(dir), 0] ;this setVelocity [(vBase select 0)*v0,(vBase select 1) * v0, 0]

Change v0=70 to like v0=100 to make it go 100 mph (is it mph or kph?) instead of 70.

Share this post


Link to post
Share on other sites

Thnx for the scripts. biggrin_o.gif

But still, is there no equivalent to the black op for the resistance? rock.gif Mabey i'll just get some resistance snipers and change their weapons.

Share this post


Link to post
Share on other sites
Change v0=70 to like v0=100 to make it go 100 mph (is it mph or kph?) instead of 70.

I think it's in meters per second actually.

I'll try this script later this afternoon

Share this post


Link to post
Share on other sites

HOW TO CREATE YOUR OWN ADDON

By Scott "Tracy" Tunstall

Before you read this, it helps if you have programmed in an object oriented language so you understand the concepts of inheritance and polymorphism.

The config scripting language appears to be a subset of C++, but does not AFAIK allow multiple inheritance of classes.

Anyway, the first thing to do when creating a new addon is to copy the #defines below into the top of your new addon's config.cpp. They make the code a lot more readable.

Then, Create your CfgPatches class. If the word "class" frightens you then I recommend you look up C++ classes (from msdn.microsoft.com, for example)

CfgPatches is used by OFP to determine what addons are to be added to the addon database, and what version of OFP is required in order to run them.

The contained class ScottT_Boat holds the important information:

The units[] array is a comma separated list that specifies the CLASS NAMES of the units we want to add to the OFP database. We only have one custom unit, and that is defined in class SuperFastBoat (nerd info: usually I would prefix the class with capital C, as per Microsoft C++ practices, but I haven't here. Do as I say, not as I do lol)

The requiredversion variable states that only operation flashpoint version 1.75 (ie: Resistance) and over can use this addon.

Next, you need to create a CfgVehicles class. CfgVehicles is, again, a standard OFP class, and is responsible for containing the implementation details of your custom addons. You MUST NOT leave CfgVehicles as an empty class!

Now, this is where it gets fun. Look at class All{}. To the uninitiated, class All looks like an "empty" class containing no data. However, this is wrong. When you declare class All in this way, you are telling the OFP config parser to IMPORT the standard operation Flashpoint "class All" data from BIS's own config.cpp.

We can see that class AllVehicles inherits from class All. Without class All{} you cannot have a class AllVehicles{} - try to declare class AllVehicles{} without class All{} and you'll crash to desktop pretty fast. Again, we want AllVehicles to be imported from BIS's config.cpp, hence the {} "empty implementation".

Now, if you have not done so already, download OFP: RES 1.90 config.cpp from

http://web.quick.cz/fholesinsky/OF/config190.zip

You now need to identify what vehicle you want to "subclass" - subclassing means, "to take an existing class and derive a new class from it". In my case, I wanted to tweak the Mark II PBR ship.

In config190.cpp you can see the Mark II PBR ship is defined in class BoatW. (The DisplayName variable gives it away.)

To make a new version of BoatW, not only do you have to derive a class from BoatW, but you have to import all the "super classes" (I don't like using object oriented tech speak, but it's for the best). The super classes basically are all the classes that BoatW inherits from.

In Config190.cpp, we can see that BoatW inherits from class SmallShip. In turn, SmallShip inherits from Ship, and Ship inherits from AllVehicles.

So I import the existing BIS Ship, SmallShip and BoatW classes into my config.cpp like so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class Ship: AllVehicles {};

class SmallShip: Ship {};

class BoatW: SmallShip {};

(Note that the order of class declaration is very important.  Try moving class Ship to the bottom of the list - again, OFP will quit back to desktop!)

OK, now I have imported the Mark 2 PBR into my project, I want to make my new super-ship.

I create a new ship like so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class SuperFastBoat: BoatW

and this time, because I want to make my boat act differently from BoatW, I add some implementation details to class Superfastboat.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

{

       scope = public;     // So this appears in OFP editor

       vehicleclass = "Superfast Armoured Ships";

       side = TWest;       // Make ship West

       // Maxspeed of 100 = 85kph, 300 = 110 kph, 500 = superfast!

       maxspeed = 500;     // Higher number = more speed

}

The scope variable determines how this new unit will appear to the OFP editor. (Note: the scope #defines are misleading. The Public, Protected and Private declarations have nothing to do with C++ inheritance specifiers!!!)

Public - seen in easy & advanced mission editor mode

Protected - seen only in advanced editor mode

Private - the class is only to be used as a "base" class, and cannot be used in the editor at all.

VehicleClass is the TYPE of the unit that will appear in the mission editor unit type Drop Down List. This name will not appear in game. You can call it "Scott's special boat" for all I care smile_o.gif

DisplayName is the NAME of the unit that will appear on the mission editor map, and in game.

Side can be a number from 0-7.

East = 0

West = 1

Guerrila (resistance) = 2

Civilian = 3

Unknown = 4 (don't use this)

Enemy = 5 (don't use this)

Friendly = 6 (don't use this)

Logic = 7 (can't see a use for this, lol)

OK, the last thing I need to do for my super fast boat is to make it super fast!

Therefore, all I do is change the maxspeed variable from 60

(as it is set in BoatW class - see config190.cpp) to something mad like 500.

Now, I check that all the braces and semicolons are in the correct place, then I save my new config.cpp to a new folder, cunningly called SuperFastBoat. I use MakePBO utility to convert the contents of the directory into a .PBO file, and put it in Res\Addons.

Et voila! A new boat under West | SuperFast Armoured Ships.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#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

class CfgPatches

{

       class ScottT_Boat

       {

       units[]={SuperFastBoat};

       requiredversion=1.750000;   // version of OFP you need

       };

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

   class Ship: AllVehicles {};

   class SmallShip: Ship {};

   class BoatW: SmallShip {};

   class SuperFastBoat : BoatW

   {

       scope = public;     // So this appears in OFP editor

       vehicleclass = "Superfast Armoured Ships";

       displayName = "Fast Armoured Mark2 PBR";

       side = TWest;       // Make ship West

       // Maxspeed of 100 = 85kph, 300 = 110 kph, 500 = superfast!

       maxspeed = 500;     // Higher number = more speed

   }

}




			
		

Share this post


Link to post
Share on other sites
Glad you liked it!!! Let me know if u use it in any of your missions biggrin_o.gif

Sure will ;)

I rewrote it abit so it appears under "Armored" and baptised it

"Scott's MARK II PBR"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#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

class CfgPatches

{

class ScottT_Boat

{

units[]={SuperFastBoat};

requiredversion=1.750000; // version of OFP you need

};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Ship: AllVehicles {};

class SmallShip: Ship {};

class BoatW: SmallShip {};

class SuperFastBoat : BoatW

{

scope = public; // So this appears in OFP editor

vehicleclass = "Armored";

displayName = "Scott's MARK II PBR";

side = TWest; // Make ship West

// Maxspeed of 100 = 85kph, 300 = 110 kph, 500 = superfast!

maxspeed = 500; // Higher number = more speed

}

}

Share this post


Link to post
Share on other sites

Help! Saw this thread, having the same problem and do not understnad making addons. Anyone know where I can find this?

Quote[/b] ]Just download:

www.freewebs.com/tunstals/superfastboat.pbo

and that does the trick!!!

I tried the link and OFPEC with no luck. Can someone send me the pbo?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×