uNiverselEgacy Posted September 21, 2017 Share Posted September 21, 2017 Has anyone figured out how to do it in SP? I copied the code in the script as you can see below and it sort of works. There is only one problem though and that is the bombs don't trigger an explosion effect when they detonate. I only get the particle effect of some dirt/debris/smoke. The bomb does deal damage when they explode and the funny thing is if I use EXPLODE_PROJECTILES to manually make them explode the explosion effect is shown just fine. static void DROP_BOMB(float x1, float y1, float z1, float x2, float y2, float z2, int damage, BOOL p7, Hash weaponHash, Ped ownerPed, BOOL isAudible, BOOL isInvisible, float speed, Entity entity, BOOL p14, BOOL p15, BOOL p16, BOOL p17, BOOL p18, BOOL p19, BOOL p20) { invoke<Void>(0xBFE5756E7407064A, x1, y1, z1, x2, y2, z2, damage, p7, weaponHash, ownerPed, isAudible, isInvisible, speed, entity, p14, p15, p16, p17, p18, p19, p20); }void func_4986(Vehicle iParam0, Hash iParam1, Vector3 *uParam2, Vector3 *uParam3, Vector3 *uParam4, Vector3 *uParam5){ Vector3 vVar0; Vector3 Var1; Vector3 vVar2; Vector3 vVar3; Vector3 vVar4; Vector3 vVar5; GAMEPLAY::GET_MODEL_DIMENSIONS(iParam1, &vVar0, &Var1); vVar2.x = vVar0.x; vVar2.y = Var1.y; vVar2.z = vVar0.z; vVar3.x = Var1.x; vVar3.y = Var1.y; vVar3.z = vVar0.z; vVar4.x = vVar0.x; vVar4.y = vVar0.y; vVar4.z = vVar0.z; vVar5.x = Var1.x; vVar5.y = vVar0.y; vVar5.z = vVar0.z; *uParam2 = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(iParam0, vVar2.x, vVar2.y, vVar2.z); *uParam3 = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(iParam0, vVar3.x, vVar3.y, vVar3.z); *uParam4 = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(iParam0, vVar4.x, vVar4.y, vVar4.z); *uParam5 = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(iParam0, vVar5.x, vVar5.y, vVar5.z);}static float func_4983(Vehicle iParam0){ float fVar0 = 0; switch (ENTITY::GET_ENTITY_MODEL(iParam0)) { case 0xD9927FE3: // cuban800 fVar0 = 0.5f; break; case -749299473: fVar0 = 0.45f; break; case -975345305: fVar0 = 0.46f; break; case -1700874274: fVar0 = 0.55f; break; case -392675425: fVar0 = 0.5f; break; case 1043222410: fVar0 = 0.6f; break; case -32878452: fVar0 = 0.43f; break; case -42959138: fVar0 = 0.5f; break; } return fVar0;}static float func_4985(float fParam0, float fParam1, float fParam2, float fParam3, float fParam4){ return ((((fParam1 - fParam0) / (fParam3 - fParam2)) * (fParam4 - fParam2)) + fParam0);}static Vector3 func_4984(Vector3 vParam0, Vector3 vParam1, float fParam2, float fParam3, float fParam4){ return MAKE_VECTOR3(func_4985(vParam0.x, vParam1.x, fParam2, fParam3, fParam4), func_4985(vParam0.y, vParam1.y, fParam2, fParam3, fParam4), func_4985(vParam0.z, vParam1.z, fParam2, fParam3, fParam4));}static void drop_bomb(Vehicle iParam0, Ped ped){ // VEHICLE_WEAPON_BOMB VEHICLE_WEAPON_BOMB_INCENDIARY VEHICLE_WEAPON_BOMB_GAS VEHICLE_WEAPON_BOMB_CLUSTER Hash weaponHashes[] = {0x9AF0B90C, 0x6AF7A717, 0x5540A91E, 0x0D28BCA3}; // W_Smug_Bomb_01, W_Smug_Bomb_04, W_Smug_Bomb_03, W_Smug_Bomb_02 Hash weaponModelHashes[] = {0xC4A21131, 0x351A7220, 0x23E64FB8, 0xD6D0B58E}; Vector3 vVar0; Vector3 vVar1; Vector3 vVar2; Vector3 vVar3; Vector3 vVar4; Vector3 vVar5; Vector3 vVar6; Vector3 vVar7; auto type = VEHICLE::GET_VEHICLE_MOD(Globals::curVehicle, 9); if (type < 0 || type >= ARRAYSIZE(weaponHashes)) return; request_model(weaponModelHashes[type]); func_4986(iParam0, ENTITY::GET_ENTITY_MODEL(iParam0), &vVar0, &vVar1, &vVar2, &vVar3); vVar4 = func_4984(vVar0, vVar1, 0.0f, 1.0f, 0.5f); vVar5 = func_4984(vVar2, vVar3, 0.0f, 1.0f, 0.5f); vVar4.z = (vVar4.z + 0.4f); vVar5.z = (vVar5.z + 0.4f); vVar6 = func_4984(vVar4, vVar5, 0.0f, 1.0f, func_4983(iParam0)); vVar4.z = (vVar4.z - 0.2f); vVar5.z = (vVar5.z - 0.2f); vVar7 = func_4984(vVar4, vVar5, 0.0f, 1.0f, (func_4983(iParam0) - 0.0004f)); DROP_BOMB(vVar6.x, vVar6.y, vVar6.z, vVar7.x, vVar7.y, vVar7.z, 0, FALSE, weaponHashes[type], ped, TRUE, TRUE, 0.0f, 0, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE); AUDIO::PLAY_SOUND_FRONTEND(-1, "bomb_deployed", "DLC_SM_Bomb_Bay_Bombs_Sounds", TRUE);} Link to comment Share on other sites More sharing options...
uNiverselEgacy Posted September 23, 2017 Author Share Posted September 23, 2017 I mean anyone any thoughts? Link to comment Share on other sites More sharing options...
K^2 Posted September 24, 2017 Share Posted September 24, 2017 You are calling DROP_BOMB with damage = 0 and isInvisible set. Have you tried playing with these values? Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
uNiverselEgacy Posted September 24, 2017 Author Share Posted September 24, 2017 You are calling DROP_BOMB with damage = 0 and isInvisible set. Have you tried playing with these values? Those are the exact values in the script. I've tried different values but they don't seem to make any difference. The parameter names are from NativeDB. Apparently some of them don't seem to do what their names suggest. Link to comment Share on other sites More sharing options...
K^2 Posted September 25, 2017 Share Posted September 25, 2017 The code overall doesn't do much, other than computing the correct starting position for the bomb, so outside of playing with parameters passed to DROP_BOMB, not a whole lot that can go wrong. Could there be another script triggered on actual explosion? Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
SkelePap Posted October 11, 2017 Share Posted October 11, 2017 So how's the progress on this? Will you also make the countermeasures work in SP? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now