Quantcast

Jump to content

» «
Photo

Can anyone make a mod where cars explode when a train hits it?

4 replies to this topic
gtatrainlover
  • gtatrainlover

    Square Civilian

  • Members
  • Joined: 05 Jul 2012

#1

Posted 10 October 2013 - 10:18 PM

Hello World,

This is one of my personal request:can anyone make a CLEO mod where as soon as a vehicle gets hit by a train it explodes like in GTA2 and LCS and in the mission ¨Wrong Side Of The Tracks¨.


Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#2

Posted 13 October 2013 - 01:29 PM Edited by SilentPL, 15 October 2013 - 12:49 PM.

Alhough there is a pinned request topic, I liked the concept and decided to make it.

Warning: untested!

[fixed code below]

Compiled code:
https://dl.dropboxus...rain_explode.cs
  • gtatrainlover likes this

gtatrainlover
  • gtatrainlover

    Square Civilian

  • Members
  • Joined: 05 Jul 2012

#3

Posted 13 October 2013 - 10:23 PM

Alhough there is a pinned request topic, I liked the concept and decided to make it.

Warning: untested!
 

{$CLEO}
{
    Vehicles explode when hit by a train
    Made by Silent
}
VAR
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]     : Int
END
// Read CPool<CVehicle,CHeli> ptr
READ_MEMORY 0xB74494 4 FALSE [email protected]
// Read a pointer to entries array...
READ_MEMORY [email protected] 4 FALSE [email protected]
// ...uID array pointer...
[email protected] += 0x4
READ_MEMORY [email protected] 4 FALSE [email protected]
// ...and pool size
[email protected] += 0x4
READ_MEMORY [email protected] 4 FALSE [email protected]

WHILE TRUE
    WAIT 100

    // Iterate through entire pool
    [email protected] = 0
    [email protected] = [email protected]
    [email protected] = [email protected]
    WHILE [email protected] > [email protected]
        READ_MEMORY [email protected] 1 FALSE [email protected]
        IF IS_BIT_SET [email protected] 7
        THEN
            // Valid vehicle, let's check if it's not a train
            0A8E: [email protected] = [email protected] + 0x590
            READ_MEMORY [email protected] 4 FALSE [email protected]
            IF NOT [email protected] == 6
            THEN
                // It's not a train, let's see if it was damaged by a train
                0A8E: [email protected] = [email protected] + 0xDC
                READ_MEMORY [email protected] 4 FALSE [email protected]
                IF NOT [email protected] == 0
                THEN
                    // Now the tricky part
                    0A8E: [email protected] = [email protected] + 0x36
                    [email protected] = 0
                    READ_MEMORY [email protected] 1 FALSE [email protected]
                    CLEAR_BIT [email protected] 3
                    CLEAR_BIT [email protected] 4
                    CLEAR_BIT [email protected] 5
                    CLEAR_BIT [email protected] 6
                    CLEAR_BIT [email protected] 7
                    IF [email protected] == 2  // Is damage entity a vehicle?
                    THEN
                        0A8E: [email protected] = [email protected] + 0x590
                        READ_MEMORY [email protected] 4 FALSE [email protected]
                        IF [email protected] == 6  // Is a train?
                        THEN
                            // Let's get its SCM handle and explode it then
                            CALL_METHOD_RETURN 0x424160 [email protected] 1 0 [email protected] [email protected]
                            IF NOT IS_CAR_DEAD [email protected]
                            THEN
                                EXPLODE_CAR [email protected]
                            END
                        END
                    END
                END
            END
        END
        [email protected] += 1
        [email protected] += 0xA18
        [email protected] += 1
    END
END
Compiled code:
https://dl.dropboxus...rain_explode.cs

 

it didnt work. the car doesnt explode.Try fixing it please


Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#4

Posted 15 October 2013 - 12:50 PM

OK, fixed it, now works fine:

{$CLEO}
{
    Vehicles explode when hit by a train
    Made by Silent
}
VAR
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]      : Int
    [email protected]     : Int
END
// Read CPool<CVehicle,CHeli> ptr
READ_MEMORY 0x4958E3 4 FALSE [email protected]
READ_MEMORY [email protected] 4 FALSE [email protected]
// Read a pointer to entries array...
READ_MEMORY [email protected] 4 FALSE [email protected]
// ...uID array pointer...
[email protected] += 0x4
READ_MEMORY [email protected] 4 FALSE [email protected]
// ...and pool size
[email protected] += 0x4
READ_MEMORY [email protected] 4 FALSE [email protected]
// We still need pool pointer later, so restore [email protected]
[email protected] -= 0x8

WHILE TRUE
    WAIT 100

    // Iterate through entire pool
    [email protected] = 0
    [email protected] = [email protected]
    [email protected] = [email protected]
    WHILE [email protected] > [email protected]
        READ_MEMORY [email protected] 1 FALSE [email protected]
        IF NOT IS_BIT_SET [email protected] 7
        THEN
            // Valid vehicle, let's check if it's not a train
            0A8E: [email protected] = [email protected] + 0x590
            READ_MEMORY [email protected] 4 FALSE [email protected]
            IF NOT [email protected] == 6
            THEN
                // It's not a train, let's see if it was damaged by a train
                0A8E: [email protected] = [email protected] + 0xDC
                READ_MEMORY [email protected] 4 FALSE [email protected]
                IF NOT [email protected] == 0
                THEN
                    // Now the tricky part
                    0A8E: [email protected] = [email protected] + 0x36
                    [email protected] = 0
                    READ_MEMORY [email protected] 1 FALSE [email protected]
                    CLEAR_BIT [email protected] 3
                    CLEAR_BIT [email protected] 4
                    CLEAR_BIT [email protected] 5
                    CLEAR_BIT [email protected] 6
                    CLEAR_BIT [email protected] 7
                    IF [email protected] == 2  // Is damage entity a vehicle?
                    THEN
                        0A8E: [email protected] = [email protected] + 0x590
                        READ_MEMORY [email protected] 4 FALSE [email protected]
                        IF [email protected] == 6  // Is a train?
                        THEN
                            // Let's get its SCM handle and explode it then
                            CALL_METHOD_RETURN 0x424160 [email protected] 1 0 [email protected] [email protected]
                            IF NOT IS_CAR_DEAD [email protected]
                            THEN
                                EXPLODE_CAR [email protected]
                            END
                        END
                    END
                END
            END
        END
        [email protected] += 1
        [email protected] += 0xA18
        [email protected] += 1
    END
END
Compiled:
https://dl.dropboxus...rain_explode.cs

gtatrainlover
  • gtatrainlover

    Square Civilian

  • Members
  • Joined: 05 Jul 2012

#5

Posted 15 October 2013 - 11:10 PM

Alhough there is a pinned request topic, I liked the concept and decided to make it.

Warning: untested!

[fixed code below]

Compiled code:
https://dl.dropboxus...rain_explode.cs

Thanks man you rule!!!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users