Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

shark


dtd mods
 Share

Recommended Posts

hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments

but it not moves good confused.gif . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player? can you help me? plz

 

 

CODE

//-------------MAIN---------------

0000: NOP

 

:NONAME_2

0001: wait 0 ms

00D6: if

0256: player $PLAYER_CHAR defined

004D: jump_if_false @NONAME_2

0247: load_model 1608

038B: load_requested_models

 

:NONAME_58

0001: wait 0 ms

00D6: if

0102: actor $PLAYER_ACTOR in_sphere 320.6818 -1781.109 4.782 radius 1.2 1.2 30.0 sphere 1 stopped_on_foot

004D: jump_if_false @NONAME_58

0107: [email protected] = create_object 1608 at 344.252 -1781.124 5.2

09CA: set_object [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 1

 

:NONAME_148

0001: wait 25 ms

00D6: if

0256: player $PLAYER_CHAR defined

004D: jump_if_false @NONAME_240

034E: move_object [email protected] to 320.6818 -1781.109 4.782 speed 0.1 0.1 0.02 flag 0

01BB: store_object [email protected] position_to [email protected] [email protected] [email protected]

029B: [email protected] = init_object 1608 at 0.0 0.0 50.0

00D6: if

0021: [email protected] > 13.0

004D: jump_if_false @NONAME_148

 

:NONAME_240

0108: destroy_object 1608

0002: jump @NONAME_2

Link to comment
Share on other sites

If you want to check if the player is the ater use:

 

04AD:   actor $PLAYER_ACTOR in_water 

 

 

If you want to know all that stuff from ZAZ mod, decompile it and study it yourself. Thats much better.

Yl8KS.jpg
Link to comment
Share on other sites

 

hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments

but it not moves good  confused.gif  . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player?  can you help me? plz

 

 

 

sharks moving around CJ needs to calculate coords of player circle

use cosine for x coord and sinus for y coord of a defined radius

look in killersharkscript for this part:

 

 

:Sharks_9000B: [email protected] +=  1.0  // floating-point values 000F: [email protected] -=  1.0  // floating-point values//000F: [email protected] -=  0.01  // floating-point values000B: [email protected] +=  0.01  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000F: [email protected] -=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]: [email protected] +=  180.0  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values000F: [email protected] -=  180.0  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000B: [email protected] +=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]:   -90.0 > [email protected]  // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] =  270.0  // floating-point values0007: [email protected] =  0.0  // floating-point values0002: jump @Sharks_7

 

Link to comment
Share on other sites

 

hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments

but it not moves good  confused.gif  . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player?  can you help me? plz

 

 

 

sharks moving around CJ needs to calculate coords of player circle

use cosine for x coord and sinus for y coord of a defined radius

look in killersharkscript for this part:

 

 

:Sharks_9000B: [email protected] +=  1.0  // floating-point values 000F: [email protected] -=  1.0  // floating-point values//000F: [email protected] -=  0.01  // floating-point values000B: [email protected] +=  0.01  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000F: [email protected] -=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]: [email protected] +=  180.0  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values000F: [email protected] -=  180.0  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000B: [email protected] +=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]:   -90.0 > [email protected]  // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] =  270.0  // floating-point values0007: [email protected] =  0.0  // floating-point values0002: jump @Sharks_7

 

THANKS MY FRIEND! THE OPCODES 000F: 005B: 000B: AND 02F7: WHAT DOES IT DO?

Edited by dtd mods
Link to comment
Share on other sites

 

hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments

but it not moves good  confused.gif  . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player?  can you help me? plz

 

 

 

sharks moving around CJ needs to calculate coords of player circle

use cosine for x coord and sinus for y coord of a defined radius

look in killersharkscript for this part:

 

 

:Sharks_9000B: [email protected] +=  1.0  // floating-point values 000F: [email protected] -=  1.0  // floating-point values//000F: [email protected] -=  0.01  // floating-point values000B: [email protected] +=  0.01  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000F: [email protected] -=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]: [email protected] +=  180.0  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values000F: [email protected] -=  180.0  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000B: [email protected] +=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]:   -90.0 > [email protected]  // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] =  270.0  // floating-point values0007: [email protected] =  0.0  // floating-point values0002: jump @Sharks_7

 

THANKS MY FRIEND! THE OPCODES 000F: 005B: 000B: AND 02F7: WHAT DOES IT DO?

000F: substract a Float value from a LocalVariable Float value

[email protected] is the z_angle for the shark

[email protected] -= 180.0 is z_angle for the second shark on the opposite site

when objects moving in a circle need also to turn the objects z_angle

[email protected] is the z_angle for the circle to move

 

005B: add a LocalVariable Float to a LocalVariable Float value

 

000B: add a Float value to a LocalVariable Float value

 

02F7

requires the knowlege about math function sinus and cosine of a triangle

 

http://www.mathe-online.at/mathint/wfun/grafiken/sincos2.gif

user posted image

to get a point on the circle can used the sinus funktion with the z_angle

with 02F7 in gta you get a point on the circle, WITH RADIUS 1.0

multiplikate then the result with 5.0 and you get a point on the circle, WITH RADIUS 5.0

I used a variable value for the radius

006B: [email protected] *= [email protected] // floating-point values

but I set it at beginning to 30.5

0007: [email protected] = 30.5 // floating-point values

 

 

Link to comment
Share on other sites

hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments

but it not moves good  confused.gif  . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player?  can you help me? plz

 

 

 

sharks moving around CJ needs to calculate coords of player circle

use cosine for x coord and sinus for y coord of a defined radius

look in killersharkscript for this part:

 

 

:Sharks_9000B: [email protected] +=  1.0  // floating-point values 000F: [email protected] -=  1.0  // floating-point values//000F: [email protected] -=  0.01  // floating-point values000B: [email protected] +=  0.01  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000F: [email protected] -=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]: [email protected] +=  180.0  // floating-point values0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only0087: [email protected] = [email protected]  // floating-point values only02F6: 28@ = cosine [email protected]  // sinus swapped with cosine0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected]  // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0  // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values005B: [email protected] += [email protected]  // floating-point values000F: [email protected] -=  180.0  // floating-point values034E: move_object [email protected] to  [email protected] [email protected] [email protected] speed  0.3  0.3  0.3 flag  0000B: [email protected] +=  180.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]:   -90.0 > [email protected]  // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] =  270.0  // floating-point values0007: [email protected] =  0.0  // floating-point values0002: jump @Sharks_7

 

THANKS MY FRIEND! THE OPCODES 000F: 005B: 000B: AND 02F7: WHAT DOES IT DO?

000F: substract a Float value from a LocalVariable Float value

[email protected] is the z_angle for the shark

[email protected] -= 180.0 is z_angle for the second shark on the opposite site

when objects moving in a circle need also to turn the objects z_angle

[email protected] is the z_angle for the circle to move

 

005B: add a LocalVariable Float to a LocalVariable Float value

 

000B: add a Float value to a LocalVariable Float value

 

02F7

requires the knowlege about math function sinus and cosine of a triangle

 

http://www.mathe-online.at/mathint/wfun/grafiken/sincos2.gif

user posted image

to get a point on the circle can used the sinus funktion with the z_angle

with 02F7 in gta you get a point on the circle, WITH RADIUS 1.0

multiplikate then the result with 5.0 and you get a point on the circle, WITH RADIUS 5.0

I used a variable value for the radius

006B: [email protected] *= [email protected] // floating-point values

but I set it at beginning to 30.5

0007: [email protected] = 30.5 // floating-point values

thanks for helping me icon14.gif

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.