Home   Help Search Login Register  

Author Topic: Completing the LPD-29  (Read 6350 times)

0 Members and 1 Guest are viewing this topic.

Offline Absolution

  • Members
  • *
Re: Completing the LPD-29
« Reply #15 on: 16 Jun 2011, 04:24:43 »
I used the FSF as a learning tool because it was the only ship I was aware of at the time. Are you worried that I will not credit you? I understand if that is the case.

Yes, it is meant to be static.

Here is a snippet from where I define one of my ship parts (the other two inherit from this one):
Code: [Select]
class CfgVehicles {
class StaticShip; //loading old class for inheritance
class LPD_SEC_MID : StaticShip { // inheriter to : inherit from
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-29 Mid Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD17\LPD_SEC_MID.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 200;// size of icon when placed in editor
icon = "\MEU_LPD17\LPD_icon_mid.paa"; //icon used in editor

class MarkerLights
{
    class BlinkRedMid
   {
   name="BReM1";
   color[]={1, 0, 0, 1};
   ambient[]={1, 0, 0, 0};
brightness=0.100;
blinking=1;
};
};
         };
« Last Edit: 16 Jun 2011, 04:26:52 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Completing the LPD-29
« Reply #16 on: 16 Jun 2011, 18:59:29 »
Quote
I used the FSF as a learning tool because it was the only ship I was aware of at the time. Are you worried that I will not credit you
No, no no! Its just the FSF is mobile, Kuznetsov is static. Two very different addons.

PM you soon.

Offline Absolution

  • Members
  • *
Re: Completing the LPD-29
« Reply #17 on: 01 Jul 2011, 03:33:25 »
I finally got a chance to sit down and work on this. First thing I am doing is making sure the init script works and that I can place my ship pieces all at once. Good news is that the script works as advertised... the bad news it wont stop! I cut out all the parts that I didn't think I needed and when I went to preview it the ship pieces were replicating infinitely as the game ran. The script is obviously looping but I can't figure out why.

Code: [Select]
// Original LHD placement script by ArMaTeC
// Adjust for Kuznetsov by Gnat
// Adjusted again for LPD-29 by Absolution

if (isServer) then {
_lpdspawn = _this select 0;
_lpddir = getdir _lpdspawn;
_lpdspawn setpos[getposasl _lpdspawn select 0, getposasl _lpdspawn select 1, 0];
_lpdspawnpoint = [getposasl _lpdspawn select 0, getposasl _lpdspawn select 1, 0];
_XSin = sin(_lpddir);
_XCos = cos(_lpddir);
_vx = (_lpdspawnpoint select 0); // + (_XSin * 19.916) + (_XCos * 8.87891);
_vy = (_lpdspawnpoint select 1); // + (_XCos * 19.916) - (_XSin * 8.87891);
_vxS1 = (_vx)+ (_XSin * -80) + (_XCos * 0);
_vyS1 = (_vy) + (_XCos * -80) - (_XSin * 0);
_vxS2 = (_vx)+ (_XSin * 80) + (_XCos * 0);
_vyS2 = (_vy) + (_XCos * 80) - (_XSin * 0);
_vxS3 = (_vx) - (_XSin * 19.916) + (_XCos * -4.9);
_vyS3 = (_vy) - (_XCos * 19.916) - (_XSin * -4.9);

_xx = 50 preloadObject "lpd_sec_aft";
_xx = 50 preloadObject "lpd_sec_mid";
_xx = 50 preloadObject "lpd_sec_bow";

_dummy = "lpd_sec_mid" createvehicle _lpdspawnpoint;
_dummy setdir (_lpddir+180);

_dummy0 = "lpd_sec_aft" createvehicle _lpdspawnpoint;
_dummy0 setdir _lpddir;
_dummy1 = "lpd_sec_bow" createvehicle _lpdspawnpoint;
_dummy1 setdir _lpddir;

_dummy0 setpos [_vxS2, _vyS2, -0.1];
_dummy1 setpos [_vxS2, _vyS2, -0.1];

};

My other issue is that I do not know how to use the "_vx" type expressions at the top. I understand they relate to setting the position of the various pieces but I don't know enough to know what each expression does specifically.

*edit*
I was running rptmod at the time and it gave me no errors. It looks like we just have a runaway script.
« Last Edit: 01 Jul 2011, 03:36:52 by Absolution »

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Completing the LPD-29
« Reply #18 on: 01 Jul 2011, 10:45:19 »
Supect thats an easy one.
You are (re)spawning an addon with the build script again.
Quote
      class EventHandlers
       {
         init = "_this execVM  "build"


So the build script creates a new bit ..... that bit spawns and triggers the INIT. That INIT trigggers another build script .... that spawns and triggers another addon ..... etc etc etc
The bit you place on the MAP should be the ONLY addon that triggers the Build script ..... once.

Offline Absolution

  • Members
  • *
Re: Completing the LPD-29
« Reply #19 on: 26 Jul 2011, 01:08:22 »
Luckily I am not getting paid for this because I would have been fired a LONG time ago. I've sorted out the infinite loop (thanks Gnat) and I only need to sort out the positioning. When I spawn my anchor piece I get the other two pieces but they are off-set by dozens of meters. It's like having three ships sailing side by side but none of them are complete ships. :) At least I got them to point in the right direction.

I need help understanding the position portion of the init script:
Code: [Select]
if (isServer) then {
_lpdspawn = _this select 0;
_lpddir = getdir _lpdspawn;
_lpdspawn setpos[getposasl _lpdspawn select 0, getposasl _lpdspawn select 1, 0];
_lpdspawnpoint = [getposasl _lpdspawn select 0, getposasl _lpdspawn select 1, 0];
_XSin = sin(_lpddir);
_XCos = cos(_lpddir);
_vx = (_lpdspawnpoint select 0); // + (_XSin * 19.916) + (_XCos * 8.87891);
_vy = (_lpdspawnpoint select 1); // + (_XCos * 19.916) - (_XSin * 8.87891);
_vxS1 = (_vx) + (_XSin * -100) + (_XCos * 0);
_vyS1 = (_vy) + (_XCos * 0) - (_XSin * 0);
_vxS2 = (_vx) + (_XSin * 0) + (_XCos * 0);
_vyS2 = (_vy) + (_XCos * 100) - (_XSin * 0);

I understand the mathematics behind this (cos of 0 = 1, etc) but what I don't get is what part of the equation relates to a given direction. I've been doing trial and error for about an hour and I don't feel any closer to understanding it.

What variable tells the object to move left/right/forward/back?

Offline Absolution

  • Members
  • *
Re: Completing the LPD-29
« Reply #20 on: 31 Jul 2011, 22:29:23 »
RELEASED:
http://forums.bistudio.com/showthread.php?t=123082

The short of it is I am tired of trying to make this thing perfect. I incorporated the placement scripts as best I could. It works when you point it at 0 degrees or 180 degrees but none other. The equations are obviously broken but I've stressed over it enough.

Thank you all for the help. This would have been impossible without you guys.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Completing the LPD-29
« Reply #21 on: 01 Aug 2011, 16:36:41 »
Well done!
Congrats on the release.

To bad about the position script. Someone with time and patience will work it out ;)