Jump to content

[Help] Implementing Vehicles


Recommended Posts

  • Replies 604
  • Created
  • Last Reply

Top Posters In This Topic

8877 is working good for me no crash yet but also no new vehicle support eather, I wish NetSky would release those new sql's atleast :cool:

as of 8896 something has happened again to the branch, I did my normal pull and updated mangos then compiled got a mess of warnings, so I made a new Repo and added the vehicle_mangos_8877.patch to it only and got pa couple patch errors, fixed them and then got the same 24 warnings in the compiler. Can somebody please verify if I made a mistake or not.

Thank You

Link to comment
Share on other sites

@NetSky:

I think some crashs are errors due to wrong or no pointer initialisation.

If a pointer isn't initialized correctly its a Wild-Pointer. That means its pointing somewhere in the ram.

So when you override it with an other value and it is pointing to the wrong adress its going to crash.

I also tried the vehicle patch but it was very funny because i needed to rewrite the code in some cases.

And some lines were.....well useless. Such things like to exchange in a switch() command the "break;" with a

"return;". OK the code runs with both variants. But was that only to charge up the size of the patch-file? ;-)

Well but it is fine work. I dont know if i had done such a thing but i think its a question of specialisation.

All i know is that it is going to work on my "outdated" 8650 Rev^^ There are only to be some fixes done.

But i dont think that it will compatible to other revs or servers because i am using some extra stuff i developed.

But keep working^^ you can do it ;-)

sry for my english.^^'

Link to comment
Share on other sites

8877 is working good for me no crash yet but also no new vehicle support eather, I wish NetSky would release those new sql's atleast :cool:

as of 8896 something has happened again to the branch, I did my normal pull and updated mangos then compiled got a mess of warnings, so I made a new Repo and added the vehicle_mangos_8877.patch to it only and got pa couple patch errors, fixed them and then got the same 24 warnings in the compiler. Can somebody please verify if I made a mistake or not.

Thank You

After applying any patch, do komity in your local Git repository and then you do not have to upgrade every time a patch.!

commit creates a command git

commit -a -m "resolved confliсts"

Link to comment
Share on other sites

I have this error

SQL query:

INSERT INTO `vehicle_seat_data`
VALUES
(
'3129', '1'
)
INSERT INTO `npc_spellclick_spells`
VALUES
(
'33842', '63791', '13829', '1', '0', '3'
);

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `npc_spellclick_spells` VALUES
('33842', '63791', '13829', '1', '0',' at line 3 

Link to comment
Share on other sites

this error means, that you already have data from this INSERT query inside your database

if you are modifying something in your database, you should run cleansing query first like this

DELETE * FROM spell_script_target WHERE entry=52264;

then run INSERT query

Link to comment
Share on other sites

Okay but i think the problem is not in sql files who i need to add in db .. Just doesn't work and i don't know what to do.

u can check it: you need to create DK than go to the ebon hold castle, use .add 39700. Use it and if u will be on the dragon, the patch work.

But i have i problem: when i try to patch my sources with vehicle patch i got 2 conflicts.

1st in unit.cpp - i'd fix it by myself.

2nd in object.cpp

***************
*** 262,267 ****
             case TYPEID_UNIT:
             {
                 flags2 = ((Creature*)this)->canFly() ? (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING) : MOVEMENTFLAG_NONE;
             }
             break;
             case TYPEID_PLAYER:
--- 262,269 ----
             case TYPEID_UNIT:
             {
                 flags2 = ((Creature*)this)->canFly() ? (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING) : MOVEMENTFLAG_NONE;
+                 if(((Unit*)this)->GetVehicleGUID())
+                     flags2 |= (MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_FLY_UNK1);
             }
             break;
             case TYPEID_PLAYER:

I tryed to fix it, but i don't know where it must be situated.

in 8880 change this part of code had been rewrited.

            case TYPEID_UNIT:
           {
               flags2 = MOVEMENTFLAG_NONE;

               if (!((Creature*)this)->IsStopped())
                   flags2 |= MOVEMENTFLAG_FORWARD;         // not set if not really moving

               if (((Creature*)this)->canFly())
               {
                   flags2 |= MOVEMENTFLAG_LEVITATING;      // (ok) most seem to have this

                   if (((Creature*)this)->IsStopped())
                       flags2 |= MOVEMENTFLAG_FLY_UNK1;    // (ok) possibly some "hover" mode
                   else
                   {
                       if (((Creature*)this)->IsMounted())
                           flags2 |= MOVEMENTFLAG_FLYING;  // seems to be often when mounted
                       /* for further research
                       else
                           flags2 |= MOVEMENTFLAG_FLYING2; // not seen, but work on some, even if not "correct"
                       */
                   }
               }
           }

and i'm totaly confused now.

Link to comment
Share on other sites

I tryed it. The patch works. But exist many bugs with this patch: u can't fly or move using flyable vehicle, you can't cast all ranged spell.

2009-12-02 18:38:42 ERROR:SESSION: opcode CMSG_PET_CAST_SPELL (0x01F0) have unprocessed tail data (read stop at 44 from 97)

Very interesting patch but it doen't work correctly now.

Link to comment
Share on other sites

I tryed it. The patch works. But exist many bugs with this patch: u can't fly or move using flyable vehicle, you can't cast all ranged spell.

Very interesting patch but it doen't work correctly now.

Sorry for taking so long to post my views ,but what I've found and if you do the same you'll see the error, I don't know where to start at to fix and don't have enough programming skills to do it.

First off failed hunk in Object.h, second problem is 48 depreciated code warnings in VS 2008pro with only the vehicle patch in place. My expriance has been if a warning pops up it means that it is broken but how to fix? I haven't a clue and it won't matter what sql's you have in place if the data isn't flowing because of a bad line it won't work. :rolleyes:

Thats is what I've found and why I think vehicles are not working....So whats to be done to get it to compile correctly? that's the question next. :eek:

Link to comment
Share on other sites

Maybe it will help you: from Vehicle.dbc- vehicle_data_ID and VehicleSeat.dbc- vehicle_seat_data_ID

enum CustomVehicleFLags
{
   VF_CANT_MOVE                    = 0x0001,                   // vehicle не может двигаться, только поворачиваться, может быть реализуется специфичными аурами?
   VF_FACTION                      = 0x0002,                   // vehicle не наследует фракцию пассажира
   VF_DESPAWN_NPC                  = 0x0004,                   // vehicle деспавнится после использования
   VF_DESPAWN_AT_LEAVE             = 0x0008,                   // vehicle деспавнится после выхода водителя
   VF_CAN_BE_HEALED                = 0x0010,                   // vehicle может быть вылечено
   VF_GIVE_EXP                     = 0x0020,                   // vehicle разрешить получение XP
   VF_MOVEMENT                     = 0x0040,                   // vehicle двигается самостоятально, не зависимо от водителя, который только может кастовать спелы
   VF_NON_SELECTABLE               = 0x0080                    // vehicle нельзя выделить после входа водителя
   //VF_HAS_FUEL                     = 0x0100,                   // TODO : find out what energy type is fuel and implement this
};

enum CustomVehicleSeatFLags
{
   SF_MAIN_RIDER                   = 0x0001,                   // контролирующий vehicle может также кастовать спеллы
   SF_UNATTACKABLE                 = 0x0002,                   // сидящих внутри нельзя атаковать, пока vehicle не будет разрушен
   SF_CAN_CAST                     = 0x0004,                   // игрок/НИП могут поварачиваться и кастовать СОБСТВЕННЫЕ спеллы
   SF_UNACCESSIBLE                 = 0x0008                    // используется в скриптах
};

Link to comment
Share on other sites

Sorry for taking so long to post my views ,but what I've found and if you do the same you'll see the error, I don't know where to start at to fix and don't have enough programming skills to do it.

First off failed hunk in Object.h, second problem is 48 depreciated code warnings in VS 2008pro with only the vehicle patch in place. My expriance has been if a warning pops up it means that it is broken but how to fix? I haven't a clue and it won't matter what sql's you have in place if the data isn't flowing because of a bad line it won't work. :rolleyes:

Thats is what I've found and why I think vehicles are not working....So whats to be done to get it to compile correctly? that's the question next. :eek:

About 1st problem:

I attached my diff. Just reaplly the patch.

http://filebeam.com/5404b7b8a39d70af3b60751a2ba6abe3

2nd: Just forget about a warnings.

I'll try to do some fixes but i don't know for what to undertake at first.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use